summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormm <mm@FreeBSD.org>2013-03-18 09:39:51 +0000
committermm <mm@FreeBSD.org>2013-03-18 09:39:51 +0000
commit09f7f9e4ff3041f8e236af6af32f05f1d181e23d (patch)
tree3c4abec07471e6306baa1e9a0a3c02f70623a423
parent713c2d790d75eb897ffb4bf09b789cf8940e6ce4 (diff)
parent7479840eb88c237a735d25cf9f01cc3a07cef955 (diff)
downloadFreeBSD-src-09f7f9e4ff3041f8e236af6af32f05f1d181e23d.zip
FreeBSD-src-09f7f9e4ff3041f8e236af6af32f05f1d181e23d.tar.gz
MFC @248461
-rw-r--r--ObsoleteFiles.inc51
-rw-r--r--bin/cp/cp.123
-rw-r--r--bin/ls/ls.120
-rw-r--r--bin/mkdir/mkdir.119
-rw-r--r--bin/mv/mv.112
-rw-r--r--bin/ps/ps.16
-rw-r--r--bin/rm/rm.115
-rw-r--r--bin/rmdir/rmdir.114
-rw-r--r--bin/sh/jobs.c7
-rw-r--r--cddl/contrib/opensolaris/cmd/zdb/zdb.c1
-rw-r--r--cddl/contrib/opensolaris/cmd/zfs/zfs.82
-rw-r--r--cddl/contrib/opensolaris/cmd/zpool/zpool.87
-rw-r--r--cddl/contrib/opensolaris/cmd/zpool/zpool_main.c5
-rw-r--r--contrib/binutils/gas/config/tc-arm.c74
-rw-r--r--contrib/libc-vis/unvis.337
-rw-r--r--contrib/libc-vis/unvis.c6
-rw-r--r--contrib/libc-vis/vis.3144
-rw-r--r--contrib/libc-vis/vis.c800
-rw-r--r--contrib/libc-vis/vis.h5
-rw-r--r--contrib/tzdata/africa72
-rw-r--r--contrib/tzdata/antarctica6
-rw-r--r--contrib/tzdata/asia48
-rw-r--r--contrib/tzdata/australasia11
-rw-r--r--contrib/tzdata/europe127
-rw-r--r--contrib/tzdata/northamerica56
-rw-r--r--contrib/tzdata/southamerica66
-rw-r--r--contrib/tzdata/zone.tab5
-rw-r--r--contrib/unvis/Makefile6
-rw-r--r--contrib/unvis/unvis.1 (renamed from usr.bin/unvis/unvis.1)39
-rw-r--r--contrib/unvis/unvis.c (renamed from usr.bin/unvis/unvis.c)76
-rw-r--r--contrib/vis/Makefile7
-rw-r--r--contrib/vis/extern.h39
-rw-r--r--contrib/vis/foldit.c (renamed from usr.bin/vis/foldit.c)22
-rw-r--r--contrib/vis/vis.1 (renamed from usr.bin/vis/vis.1)81
-rw-r--r--contrib/vis/vis.c276
-rw-r--r--crypto/openssh/session.c6
-rw-r--r--etc/mtree/BSD.include.dist2
-rw-r--r--games/fortune/datfiles/Makefile27
-rw-r--r--games/fortune/datfiles/fortunes-o.fake2
-rw-r--r--games/fortune/datfiles/fortunes-o.real15437
-rw-r--r--games/fortune/datfiles/fortunes-o.sp.ok1700
-rw-r--r--gnu/lib/libgcc/Makefile6
-rw-r--r--lib/libc/gen/Makefile.inc19
-rw-r--r--lib/libc/gen/Symbol.map2
-rw-r--r--lib/libc/gen/getcontext.34
-rw-r--r--lib/libc/net/nscachedcli.c9
-rw-r--r--lib/libc/stdlib/realpath.32
-rw-r--r--lib/libc/sys/chflags.24
-rw-r--r--lib/libipsec/test-policy.c15
-rw-r--r--lib/libncp/CREDITS27
-rw-r--r--lib/libncp/Makefile16
-rw-r--r--lib/libncp/ipx.c352
-rw-r--r--lib/libncp/ipxsap.h92
-rw-r--r--lib/libncp/ncpl_bind.c267
-rw-r--r--lib/libncp/ncpl_conn.c511
-rw-r--r--lib/libncp/ncpl_crypt.c139
-rw-r--r--lib/libncp/ncpl_file.c263
-rw-r--r--lib/libncp/ncpl_misc.c294
-rw-r--r--lib/libncp/ncpl_msg.c130
-rw-r--r--lib/libncp/ncpl_net.c147
-rw-r--r--lib/libncp/ncpl_nls.c423
-rw-r--r--lib/libncp/ncpl_queue.c222
-rw-r--r--lib/libncp/ncpl_rcfile.c406
-rw-r--r--lib/libncp/ncpl_rpc.c136
-rw-r--r--lib/libncp/ncpl_subr.c490
-rw-r--r--lib/libncp/sap.c301
-rw-r--r--lib/libnetgraph/msg.c2
-rw-r--r--lib/libprocstat/nwfs.c76
-rw-r--r--lib/libusb/Makefile13
-rw-r--r--lib/libusb/libusb.h3
-rw-r--r--lib/libusb/libusb01.c9
-rw-r--r--lib/libusb/libusb10.c16
-rw-r--r--lib/libusb/libusb10.h2
-rw-r--r--lib/libusb/libusb10_desc.c9
-rw-r--r--lib/libusb/libusb10_io.c9
-rw-r--r--lib/libusb/libusb20.c8
-rw-r--r--lib/libusb/libusb20.h8
-rw-r--r--lib/libusb/libusb20_desc.c8
-rw-r--r--lib/libusb/libusb20_desc.h4
-rw-r--r--lib/libusb/libusb20_ugen20.c18
-rw-r--r--lib/libusb/libusb_global_linux.h69
-rw-r--r--lib/libusb/usb.h5
-rw-r--r--lib/libutil/gr_util.c104
-rw-r--r--lib/libutil/pidfile.c31
-rw-r--r--sbin/ccdconfig/ccdconfig.86
-rw-r--r--sbin/ffsinfo/ffsinfo.84
-rw-r--r--sbin/geom/class/concat/gconcat.84
-rw-r--r--sbin/geom/class/mirror/gmirror.84
-rw-r--r--sbin/geom/class/raid/graid.82
-rw-r--r--sbin/geom/class/stripe/gstripe.84
-rw-r--r--sbin/gvinum/gvinum.89
-rw-r--r--sbin/hastctl/hastctl.812
-rw-r--r--sbin/hastctl/hastctl.c74
-rw-r--r--sbin/hastd/hastd.88
-rw-r--r--sbin/hastd/secondary.c2
-rw-r--r--sbin/hastd/subr.c64
-rw-r--r--sbin/recoverdisk/recoverdisk.c2
-rw-r--r--share/examples/Makefile3
-rw-r--r--share/examples/cvsup/README4
-rw-r--r--share/examples/cvsup/cvs-supfile12
-rw-r--r--share/examples/cvsup/ports-supfile74
-rw-r--r--share/examples/cvsup/refuse13
-rw-r--r--share/examples/cvsup/refuse.README44
-rw-r--r--share/examples/cvsup/stable-supfile15
-rw-r--r--share/examples/nwclient/dot.nwfsrc78
-rw-r--r--share/examples/nwclient/nwfs.sh.sample34
-rw-r--r--share/man/man4/Makefile1
-rw-r--r--share/man/man4/cas.42
-rw-r--r--share/man/man4/ccd.44
-rw-r--r--share/man/man4/geom.437
-rw-r--r--share/man/man4/sge.42
-rw-r--r--share/man/man4/udp.446
-rw-r--r--share/man/man4/vinum.41171
-rw-r--r--share/misc/bsd-family-tree15
-rw-r--r--share/misc/committers-ports.dot2
-rw-r--r--share/misc/organization.dot7
-rw-r--r--sys/Makefile2
-rw-r--r--sys/amd64/amd64/pmap.c90
-rw-r--r--sys/amd64/include/pmap.h4
-rw-r--r--sys/amd64/vmm/intel/vmx.c7
-rw-r--r--sys/amd64/vmm/vmm.c8
-rw-r--r--sys/amd64/vmm/vmm_stat.c13
-rw-r--r--sys/amd64/vmm/vmm_stat.h27
-rw-r--r--sys/arm/arm/bcopy_page.S4
-rw-r--r--sys/arm/arm/bcopyinout.S5
-rw-r--r--sys/arm/arm/bcopyinout_xscale.S4
-rw-r--r--sys/arm/arm/blockio.S11
-rw-r--r--sys/arm/arm/bus_space_asm_generic.S23
-rw-r--r--sys/arm/arm/copystr.S3
-rw-r--r--sys/arm/arm/cpufunc_asm.S15
-rw-r--r--sys/arm/arm/cpufunc_asm_arm10.S13
-rw-r--r--sys/arm/arm/cpufunc_asm_arm11.S12
-rw-r--r--sys/arm/arm/cpufunc_asm_arm11x6.S9
-rw-r--r--sys/arm/arm/cpufunc_asm_arm7tdmi.S6
-rw-r--r--sys/arm/arm/cpufunc_asm_arm8.S12
-rw-r--r--sys/arm/arm/cpufunc_asm_arm9.S11
-rw-r--r--sys/arm/arm/cpufunc_asm_armv4.S6
-rw-r--r--sys/arm/arm/cpufunc_asm_armv5.S9
-rw-r--r--sys/arm/arm/cpufunc_asm_armv5_ec.S9
-rw-r--r--sys/arm/arm/cpufunc_asm_armv6.S10
-rw-r--r--sys/arm/arm/cpufunc_asm_armv7.S16
-rw-r--r--sys/arm/arm/cpufunc_asm_fa526.S15
-rw-r--r--sys/arm/arm/cpufunc_asm_ixp12x0.S2
-rw-r--r--sys/arm/arm/cpufunc_asm_pj4b.S15
-rw-r--r--sys/arm/arm/cpufunc_asm_sa1.S21
-rw-r--r--sys/arm/arm/cpufunc_asm_sa11x0.S5
-rw-r--r--sys/arm/arm/cpufunc_asm_sheeva.S11
-rw-r--r--sys/arm/arm/cpufunc_asm_xscale.S27
-rw-r--r--sys/arm/arm/cpufunc_asm_xscale_c3.S20
-rw-r--r--sys/arm/arm/db_trace.c32
-rw-r--r--sys/arm/arm/disassem.c2
-rw-r--r--sys/arm/arm/elf_trampoline.c15
-rw-r--r--sys/arm/arm/exception.S9
-rw-r--r--sys/arm/arm/fiq_subr.S2
-rw-r--r--sys/arm/arm/fusu.S14
-rw-r--r--sys/arm/arm/in_cksum_arm.S6
-rw-r--r--sys/arm/arm/irq_dispatch.S1
-rw-r--r--sys/arm/arm/locore.S10
-rw-r--r--sys/arm/arm/pmap-v6.c39
-rw-r--r--sys/arm/arm/pmap.c93
-rw-r--r--sys/arm/arm/setcpsr.S2
-rw-r--r--sys/arm/arm/support.S8
-rw-r--r--sys/arm/arm/swtch.S6
-rw-r--r--sys/arm/at91/if_ate.c9
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_sdhci.c116
-rw-r--r--sys/arm/include/asm.h14
-rw-r--r--sys/arm/include/bus.h8
-rw-r--r--sys/arm/include/param.h2
-rw-r--r--sys/arm/include/pmap.h2
-rw-r--r--sys/arm/include/signal.h1
-rw-r--r--sys/arm/ti/cpsw/if_cpsw.c2
-rw-r--r--sys/arm/ti/ti_mmchs.c5
-rw-r--r--sys/boot/common/load_elf.c13
-rw-r--r--sys/boot/fdt/fdt_loader_cmd.c49
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h13
-rw-r--r--sys/cddl/dev/dtrace/powerpc/dtrace_asm.S56
-rw-r--r--sys/cddl/dev/dtrace/powerpc/dtrace_isa.c14
-rw-r--r--sys/cddl/dev/dtrace/powerpc/dtrace_subr.c74
-rw-r--r--sys/cddl/dev/fbt/fbt_powerpc.c1321
-rw-r--r--sys/compat/ndis/kern_ndis.c8
-rw-r--r--sys/conf/Makefile.arm47
-rw-r--r--sys/conf/NOTES2
-rw-r--r--sys/conf/files5
-rw-r--r--sys/conf/files.arm3
-rw-r--r--sys/conf/ldscript.arm1
-rw-r--r--sys/dev/acpica/acpi_hpet.c3
-rw-r--r--sys/dev/acpica/acpi_powerres.c2
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416reg.h1
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c4
-rw-r--r--sys/dev/ath/if_ath.c111
-rw-r--r--sys/dev/ath/if_ath_rx.c24
-rw-r--r--sys/dev/ath/if_ath_rx_edma.c7
-rw-r--r--sys/dev/ath/if_ath_sysctl.c23
-rw-r--r--sys/dev/ath/if_ath_tx.c11
-rw-r--r--sys/dev/ath/if_athioctl.h19
-rw-r--r--sys/dev/ath/if_athvar.h10
-rw-r--r--sys/dev/bge/if_bge.c20
-rw-r--r--sys/dev/ichwd/ichwd.c2
-rw-r--r--sys/dev/iscsi/initiator/isc_soc.c6
-rw-r--r--sys/dev/puc/pucdata.c20
-rw-r--r--sys/dev/re/if_re.c6
-rw-r--r--sys/dev/sis/if_sis.c4
-rw-r--r--sys/dev/sis/if_sisreg.h1
-rw-r--r--sys/dev/sound/pci/hda/hdaa_patches.c5
-rw-r--r--sys/dev/sound/pci/hda/hdac.h3
-rw-r--r--sys/dev/sound/pcm/sndstat.c8
-rw-r--r--sys/dev/usb/serial/uftdi.c2
-rw-r--r--sys/dev/usb/usb_device.c10
-rw-r--r--sys/dev/usb/usb_request.c54
-rw-r--r--sys/dev/usb/usbdevs9
-rw-r--r--sys/dev/usb/wlan/if_run.c1
-rw-r--r--sys/fs/cd9660/cd9660_vnops.c2
-rw-r--r--sys/fs/ext2fs/ext2_balloc.c2
-rw-r--r--sys/fs/ext2fs/ext2_vnops.c9
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c4
-rw-r--r--sys/fs/nfs/nfsport.h23
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c8
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c6
-rw-r--r--sys/fs/nwfs/nwfs.h79
-rw-r--r--sys/fs/nwfs/nwfs_io.c599
-rw-r--r--sys/fs/nwfs/nwfs_ioctl.c89
-rw-r--r--sys/fs/nwfs/nwfs_mount.h68
-rw-r--r--sys/fs/nwfs/nwfs_node.c379
-rw-r--r--sys/fs/nwfs/nwfs_node.h96
-rw-r--r--sys/fs/nwfs/nwfs_subr.c553
-rw-r--r--sys/fs/nwfs/nwfs_subr.h90
-rw-r--r--sys/fs/nwfs/nwfs_vfsops.c439
-rw-r--r--sys/fs/nwfs/nwfs_vnops.c967
-rw-r--r--sys/fs/smbfs/smbfs_smb.c12
-rw-r--r--sys/fs/smbfs/smbfs_vnops.c22
-rw-r--r--sys/fs/tmpfs/tmpfs_vnops.c1
-rw-r--r--sys/fs/udf/udf_vnops.c5
-rw-r--r--sys/geom/gate/g_gate.c2
-rw-r--r--sys/i386/i386/pmap.c107
-rw-r--r--sys/i386/include/pmap.h4
-rw-r--r--sys/i386/xen/pmap.c47
-rw-r--r--sys/ia64/ia64/pmap.c24
-rw-r--r--sys/kern/capabilities.conf2
-rw-r--r--sys/kern/imgact_elf.c14
-rw-r--r--sys/kern/kern_et.c2
-rw-r--r--sys/kern/kern_racct.c6
-rw-r--r--sys/kern/kern_synch.c7
-rw-r--r--sys/kern/kern_time.c6
-rw-r--r--sys/kern/kern_timeout.c4
-rw-r--r--sys/kern/kern_umtx.c121
-rw-r--r--sys/kern/subr_sleepqueue.c12
-rw-r--r--sys/kern/subr_trap.c11
-rw-r--r--sys/kern/uipc_mbuf.c144
-rw-r--r--sys/kern/uipc_sockbuf.c4
-rw-r--r--sys/kern/uipc_socket.c7
-rw-r--r--sys/kern/uipc_syscalls.c24
-rw-r--r--sys/kern/uipc_usrreq.c36
-rw-r--r--sys/kern/vfs_bio.c45
-rw-r--r--sys/kern/vfs_cluster.c26
-rw-r--r--sys/kern/vfs_syscalls.c9
-rw-r--r--sys/kern/vfs_vnops.c45
-rw-r--r--sys/libkern/arm/aeabi_unwind.c (renamed from sys/netncp/ncpio.h)62
-rw-r--r--sys/libkern/arm/divsi3.S13
-rw-r--r--sys/libkern/arm/ffs.S2
-rw-r--r--sys/libkern/arm/ldivmod.S2
-rw-r--r--sys/libkern/arm/memcpy.S (renamed from sys/netncp/ncp_login.c)27
-rw-r--r--sys/libkern/arm/memset.S (renamed from usr.bin/vis/extern.h)37
-rw-r--r--sys/mips/mips/pmap.c45
-rw-r--r--sys/modules/ath/Makefile7
-rw-r--r--sys/modules/dtrace/Makefile3
-rw-r--r--sys/modules/dtrace/dtraceall/dtraceall.c4
-rw-r--r--sys/modules/dtrace/fbt/Makefile4
-rw-r--r--sys/modules/ncp/Makefile15
-rw-r--r--sys/modules/nwfs/Makefile15
-rw-r--r--sys/modules/uart/Makefile3
-rw-r--r--sys/net/bpf.c2
-rw-r--r--sys/net/bridgestp.c4
-rw-r--r--sys/net/if_bridge.c1
-rw-r--r--sys/net/if_gre.c3
-rw-r--r--sys/net/rtsock.c19
-rw-r--r--sys/net80211/ieee80211_output.c3
-rw-r--r--sys/net80211/ieee80211_superg.c2
-rw-r--r--sys/netinet/igmp.c4
-rw-r--r--sys/netinet/ip_carp.c4
-rw-r--r--sys/netinet/ip_input.c2
-rw-r--r--sys/netinet/ip_mroute.c7
-rw-r--r--sys/netinet/ip_options.c4
-rw-r--r--sys/netinet/ip_output.c4
-rw-r--r--sys/netinet/libalias/alias.c16
-rw-r--r--sys/netinet/libalias/alias_db.c7
-rw-r--r--sys/netinet/tcp_output.c22
-rw-r--r--sys/netinet/tcp_subr.c2
-rw-r--r--sys/netinet6/icmp6.c100
-rw-r--r--sys/netinet6/ip6_input.c35
-rw-r--r--sys/netinet6/ip6_mroute.c5
-rw-r--r--sys/netinet6/ip6_output.c47
-rw-r--r--sys/netinet6/mld6.c6
-rw-r--r--sys/netinet6/nd6_nbr.c26
-rw-r--r--sys/netinet6/raw_ip6.c2
-rw-r--r--sys/netipsec/key.c154
-rw-r--r--sys/netncp/ncp.h392
-rw-r--r--sys/netncp/ncp_cfg.h9
-rw-r--r--sys/netncp/ncp_conn.c662
-rw-r--r--sys/netncp/ncp_conn.h229
-rw-r--r--sys/netncp/ncp_crypt.c271
-rw-r--r--sys/netncp/ncp_file.h76
-rw-r--r--sys/netncp/ncp_lib.h246
-rw-r--r--sys/netncp/ncp_mod.c529
-rw-r--r--sys/netncp/ncp_ncp.c503
-rw-r--r--sys/netncp/ncp_ncp.h127
-rw-r--r--sys/netncp/ncp_nls.c304
-rw-r--r--sys/netncp/ncp_nls.h88
-rw-r--r--sys/netncp/ncp_rq.c480
-rw-r--r--sys/netncp/ncp_rq.h136
-rw-r--r--sys/netncp/ncp_sock.c381
-rw-r--r--sys/netncp/ncp_subr.c137
-rw-r--r--sys/netncp/ncp_subr.h116
-rw-r--r--sys/netncp/ncp_user.h91
-rw-r--r--sys/netncp/nwerror.h634
-rw-r--r--sys/netpfil/pf/if_pfsync.c2
-rw-r--r--sys/netpfil/pf/pf.c2
-rw-r--r--sys/netsmb/smb_dev.c11
-rw-r--r--sys/nfs/krpc_subr.c4
-rw-r--r--sys/nfs/nfs_common.c4
-rw-r--r--sys/nfsclient/nfs_bio.c8
-rw-r--r--sys/nfsclient/nfs_subs.c37
-rw-r--r--sys/nfsclient/nfs_vfsops.c4
-rw-r--r--sys/nfsclient/nfs_vnops.c73
-rw-r--r--sys/nfsclient/nfsm_subs.h28
-rw-r--r--sys/nfsclient/nfsmount.h2
-rw-r--r--sys/powerpc/aim/mmu_oea.c27
-rw-r--r--sys/powerpc/aim/mmu_oea64.c69
-rw-r--r--sys/powerpc/aim/trap.c19
-rw-r--r--sys/powerpc/aim/trap_subr32.S7
-rw-r--r--sys/powerpc/aim/trap_subr64.S7
-rw-r--r--sys/powerpc/booke/pmap.c33
-rw-r--r--sys/powerpc/powerpc/mmu_if.m8
-rw-r--r--sys/powerpc/powerpc/pmap_dispatch.c10
-rw-r--r--sys/rpc/clnt_dg.c2
-rw-r--r--sys/rpc/clnt_rc.c3
-rw-r--r--sys/rpc/clnt_vc.c7
-rw-r--r--sys/rpc/rpc_generic.c4
-rw-r--r--sys/rpc/rpcm_subs.h2
-rw-r--r--sys/rpc/svc.c4
-rw-r--r--sys/rpc/svc_dg.c3
-rw-r--r--sys/rpc/svc_vc.c6
-rw-r--r--sys/sparc64/sparc64/pmap.c8
-rw-r--r--sys/sys/buf.h6
-rw-r--r--sys/sys/mbuf.h23
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/sys/vnode.h2
-rw-r--r--sys/ufs/ffs/ffs_balloc.c12
-rw-r--r--sys/ufs/ffs/ffs_vnops.c6
-rw-r--r--sys/ufs/ufs/ufs_vnops.c1
-rw-r--r--sys/vm/_vm_radix.h (renamed from sys/netncp/ncp_sock.h)40
-rw-r--r--sys/vm/pmap.h2
-rw-r--r--sys/vm/vm_kern.c8
-rw-r--r--sys/vm/vm_object.c13
-rw-r--r--sys/vm/vm_object.h12
-rw-r--r--sys/vm/vm_page.c334
-rw-r--r--sys/vm/vm_page.h3
-rw-r--r--sys/vm/vm_radix.c777
-rw-r--r--sys/vm/vm_radix.h (renamed from sys/netncp/ncp_rcfile.h)49
-rw-r--r--sys/vm/vm_reserv.c71
-rw-r--r--sys/vm/vnode_pager.c2
-rw-r--r--sys/xdr/xdr_mbuf.c7
-rw-r--r--tools/regression/bin/sh/builtins/wait6.03
-rw-r--r--tools/regression/bin/sh/builtins/wait7.04
-rw-r--r--tools/regression/pjdfstest/tests/misc.sh4
-rw-r--r--tools/regression/security/cap_test/cap_test_capabilities.c63
-rw-r--r--usr.bin/ee/nls/ru_RU.KOI8-R/ee.msg4
-rw-r--r--usr.bin/find/find.h2
-rw-r--r--usr.bin/find/function.c47
-rw-r--r--usr.bin/grep/regex/tre-fastmatch.c2
-rw-r--r--usr.bin/head/head.115
-rw-r--r--usr.bin/ncplist/Makefile9
-rw-r--r--usr.bin/ncplist/ncplist.188
-rw-r--r--usr.bin/ncplist/ncplist.c474
-rw-r--r--usr.bin/ncplogin/Makefile11
-rw-r--r--usr.bin/ncplogin/ncplogin.1262
-rw-r--r--usr.bin/ncplogin/ncplogin.c205
-rw-r--r--usr.bin/ncplogin/ncplogout.156
-rw-r--r--usr.bin/netstat/netstat.18
-rw-r--r--usr.bin/renice/renice.812
-rw-r--r--usr.bin/script/script.12
-rw-r--r--usr.bin/tail/tail.113
-rw-r--r--usr.bin/top/machine.c11
-rw-r--r--usr.bin/unifdef/unifdefall.sh3
-rw-r--r--usr.bin/unvis/Makefile2
-rw-r--r--usr.bin/vis/Makefile4
-rw-r--r--usr.bin/vis/vis.c189
-rw-r--r--usr.sbin/ac/ac.820
-rw-r--r--usr.sbin/bhyve/pci_passthru.c3
-rw-r--r--usr.sbin/bhyve/pci_virtio_net.c2
-rw-r--r--usr.sbin/mount_nwfs/Makefile15
-rw-r--r--usr.sbin/mount_nwfs/mount_nwfs.8230
-rw-r--r--usr.sbin/mount_nwfs/mount_nwfs.c369
-rw-r--r--usr.sbin/pkg/Makefile2
-rw-r--r--usr.sbin/usbconfig/usbconfig.c1
395 files changed, 6711 insertions, 36087 deletions
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index cfa085f..45b72de6 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -38,6 +38,51 @@
# xargs -n1 | sort | uniq -d;
# done
+OLD_FILES+=usr/share/man/man4/vinum.4.gz
+# 20130311: Ports are no more available via cvsup
+OLD_FILES+=usr/share/examples/cvsup/ports-supfile
+OLD_FILES+=usr/share/examples/cvsup/refuse
+OLD_FILES+=usr/share/examples/cvsup/refuse.README
+# 20130309: NWFS and NCP supports removed
+OLD_FILES+=usr/bin/ncplist
+OLD_FILES+=usr/bin/ncplogin
+OLD_FILES+=usr/bin/ncplogout
+OLD_FILES+=usr/include/fs/nwfs/nwfs.h
+OLD_FILES+=usr/include/fs/nwfs/nwfs_mount.h
+OLD_FILES+=usr/include/fs/nwfs/nwfs_node.h
+OLD_FILES+=usr/include/fs/nwfs/nwfs_subr.h
+OLD_DIRS+=usr/include/fs/nwfs
+OLD_FILES+=usr/include/netncp/ncp.h
+OLD_FILES+=usr/include/netncp/ncp_cfg.h
+OLD_FILES+=usr/include/netncp/ncp_conn.h
+OLD_FILES+=usr/include/netncp/ncp_file.h
+OLD_FILES+=usr/include/netncp/ncp_lib.h
+OLD_FILES+=usr/include/netncp/ncp_ncp.h
+OLD_FILES+=usr/include/netncp/ncp_nls.h
+OLD_FILES+=usr/include/netncp/ncp_rcfile.h
+OLD_FILES+=usr/include/netncp/ncp_rq.h
+OLD_FILES+=usr/include/netncp/ncp_sock.h
+OLD_FILES+=usr/include/netncp/ncp_subr.h
+OLD_FILES+=usr/include/netncp/ncp_user.h
+OLD_FILES+=usr/include/netncp/ncpio.h
+OLD_FILES+=usr/include/netncp/nwerror.h
+OLD_DIRS+=usr/include/netncp
+OLD_FILES+=usr/lib/libncp.a
+OLD_FILES+=usr/lib/libncp.so
+OLD_LIBS+=usr/lib/libncp.so.4
+OLD_FILES+=usr/lib/libncp_p.a
+OLD_FILES+=usr/lib32/libncp.a
+OLD_FILES+=usr/lib32/libncp.so
+OLD_LIBS+=usr/lib32/libncp.so.4
+OLD_FILES+=usr/lib32/libncp_p.a
+OLD_FILES+=usr/sbin/mount_nwfs
+OLD_FILES+=usr/share/examples/nwclient/dot.nwfsrc
+OLD_FILES+=usr/share/examples/nwclient/nwfs.sh.sample
+OLD_DIRS+=usr/share/examples/nwclient
+OLD_FILES+=usr/share/man/man1/ncplist.1.gz
+OLD_FILES+=usr/share/man/man1/ncplogin.1.gz
+OLD_FILES+=usr/share/man/man1/ncplogout.1.gz
+OLD_FILES+=usr/share/man/man8/mount_nwfs.8.gz
# 20130302: NTFS support removed
OLD_FILES+=rescue/mount_ntfs
OLD_FILES+=sbin/mount_ntfs
@@ -62,6 +107,12 @@ OLD_FILES+=usr/share/man/man8/mount_portalfs.8.gz
OLD_FILES+=usr/share/man/man4/coda.4.gz
# 20130302: XFS support removed
OLD_FILES+=usr/share/man/man5/xfs.5.gz
+# 20130302: Capsicum overhaul
+OLD_FILES+=usr/share/man/man2/cap_getrights.2.gz
+OLD_FILES+=usr/share/man/man2/cap_new.2.gz
+# 20130213: OpenSSL 1.0.1e import
+OLD_FILES+=usr/share/openssl/man/man3/EVP_PKEY_verifyrecover.3.gz
+OLD_FILES+=usr/share/openssl/man/man3/EVP_PKEY_verifyrecover_init.3.gz
# 20130116: removed long unused directories for .1aout section manpages
OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout
OLD_FILES+=usr/share/man/en.UTF-8/man1aout
diff --git a/bin/cp/cp.1 b/bin/cp/cp.1
index 8c014b4..169f350 100644
--- a/bin/cp/cp.1
+++ b/bin/cp/cp.1
@@ -32,7 +32,7 @@
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd September 4, 2012
+.Dd March 15, 2013
.Dt CP 1
.Os
.Sh NAME
@@ -251,6 +251,27 @@ signal, the current input and output file and the percentage complete
will be written to the standard output.
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+Make a copy of file
+.Pa foo
+named
+.Pa bar :
+.Pp
+.Dl $ cp foo bar
+.Pp
+Copy a group of files to the
+.Pa /tmp
+directory:
+.Pp
+.Dl $ cp *.txt /tmp
+.Pp
+Copy the directory
+.Pa junk
+and all of its contents (including any subdirectories) to the
+.Pa /tmp
+directory:
+.Pp
+.Dl $ cp -R junk /tmp
.Sh COMPATIBILITY
Historic versions of the
.Nm
diff --git a/bin/ls/ls.1 b/bin/ls/ls.1
index aa4fc18..7c72652 100644
--- a/bin/ls/ls.1
+++ b/bin/ls/ls.1
@@ -32,7 +32,7 @@
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
.\" $FreeBSD$
.\"
-.Dd November 8, 2012
+.Dd March 15, 2013
.Dt LS 1
.Os
.Sh NAME
@@ -718,6 +718,24 @@ for more information.
.El
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+List the contents of the current working directory in long format:
+.Pp
+.Dl $ ls -l
+.Pp
+In addition to listing the contents of the current working directory in
+long format, show inode numbers, file flags (see
+.Xr chflags 1 ) ,
+and suffix each filename with a symbol representing its file type:
+.Pp
+.Dl $ ls -lioF
+.Pp
+List the files in
+.Pa /var/log ,
+sorting the output such that the mostly recently modified entries are
+printed first:
+.Pp
+.Dl $ ls -lt /var/log
.Sh COMPATIBILITY
The group field is now automatically included in the long listing for
files in order to be compatible with the
diff --git a/bin/mkdir/mkdir.1 b/bin/mkdir/mkdir.1
index 0f8d812..d702348 100644
--- a/bin/mkdir/mkdir.1
+++ b/bin/mkdir/mkdir.1
@@ -32,7 +32,7 @@
.\" @(#)mkdir.1 8.2 (Berkeley) 1/25/94
.\" $FreeBSD$
.\"
-.Dd January 25, 1994
+.Dd March 15, 2013
.Dt MKDIR 1
.Os
.Sh NAME
@@ -87,6 +87,23 @@ Be verbose when creating directories, listing them as they are created.
The user must have write permission in the parent directory.
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+Create a directory named
+.Pa foobar :
+.Pp
+.Dl $ mkdir foobar
+.Pp
+Create a directory named
+.Pa foobar
+and set its file mode to 700:
+.Pp
+.Dl $ mkdir -m 700 foobar
+.Pp
+Create a directory named
+.Pa cow/horse/monkey ,
+creating any non-existent intermediate directories as necessary:
+.Pp
+.Dl $ mkdir -p cow/horse/monkey
.Sh COMPATIBILITY
The
.Fl v
diff --git a/bin/mv/mv.1 b/bin/mv/mv.1
index 5199f27..298dbf9 100644
--- a/bin/mv/mv.1
+++ b/bin/mv/mv.1
@@ -32,7 +32,7 @@
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
-.Dd August 28, 2012
+.Dd March 15, 2013
.Dt MV 1
.Os
.Sh NAME
@@ -155,6 +155,16 @@ rm -rf source_file
.Ed
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+Rename file
+.Pa foo
+to
+.Pa bar ,
+overwriting
+.Pa bar
+if it already exists:
+.Pp
+.Dl $ mv -f foo bar
.Sh COMPATIBILITY
The
.Fl h ,
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 7f69137..1a364f5 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd February 7, 2013
+.Dd March 15, 2013
.Dt PS 1
.Os
.Sh NAME
@@ -689,6 +689,10 @@ attempts to automatically determine the terminal width.
.It Pa /boot/kernel/kernel
default system namelist
.El
+.Sh EXAMPLES
+Display information on all system processes:
+.Pp
+.Dl $ ps -auxw
.Sh SEE ALSO
.Xr kill 1 ,
.Xr pgrep 1 ,
diff --git a/bin/rm/rm.1 b/bin/rm/rm.1
index ad81066..3588f38 100644
--- a/bin/rm/rm.1
+++ b/bin/rm/rm.1
@@ -32,7 +32,7 @@
.\" @(#)rm.1 8.5 (Berkeley) 12/5/94
.\" $FreeBSD$
.\"
-.Dd October 31, 2010
+.Dd March 15, 2013
.Dt RM 1
.Os
.Sh NAME
@@ -193,6 +193,19 @@ When
is specified with
.Fl f
the file will be overwritten and removed even if it has hard links.
+.Sh EXAMPLES
+Recursively remove all files contained within the
+.Pa foobar
+directory hierarchy:
+.Pp
+.Dl $ rm -rf foobar
+.Pp
+Either of these commands will remove the file
+.Pa -f :
+.Bd -literal -offset indent
+$ rm -- -f
+$ rm ./-f
+.Ed
.Sh COMPATIBILITY
The
.Nm
diff --git a/bin/rmdir/rmdir.1 b/bin/rmdir/rmdir.1
index 688d144..ededd43 100644
--- a/bin/rmdir/rmdir.1
+++ b/bin/rmdir/rmdir.1
@@ -32,7 +32,7 @@
.\" @(#)rmdir.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
-.Dd March 21, 2004
+.Dd March 15, 2013
.Dt RMDIR 1
.Os
.Sh NAME
@@ -86,6 +86,18 @@ successfully.
.It Li >0
An error occurred.
.El
+.Sh EXAMPLES
+Remove the directory
+.Pa foobar ,
+if it is empty:
+.Pp
+.Dl $ rmdir foobar
+.Pp
+Remove all directories up to and including
+.Pa cow ,
+stopping at the first non-empty directory (if any):
+.Pp
+.Dl $ rmdir -p cow/horse/monkey
.Sh SEE ALSO
.Xr rm 1
.Sh STANDARDS
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index 5a2790b..a092884 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -458,14 +458,15 @@ freejob(struct job *jp)
int
-waitcmd(int argc, char **argv)
+waitcmd(int argc __unused, char **argv __unused)
{
struct job *job;
int status, retval;
struct job *jp;
- if (argc > 1) {
- job = getjob(argv[1]);
+ nextopt("");
+ if (*argptr != NULL) {
+ job = getjob(*argptr);
} else {
job = NULL;
}
diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
index 1859c34..f34121f 100644
--- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c
+++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c
@@ -1256,6 +1256,7 @@ dump_bpobj(bpobj_t *bpo, char *name, int indent)
continue;
}
dump_bpobj(&subbpo, "subobj", indent + 1);
+ bpobj_close(&subbpo);
}
} else {
(void) printf(" %*s: object %llu, %llu blkptrs, %s\n",
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs.8 b/cddl/contrib/opensolaris/cmd/zfs/zfs.8
index ca80c0b..cfaf01f 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs.8
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs.8
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 10, 2013
+.Dd March 1, 2013
.Dt ZFS 8
.Os
.Sh NAME
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 b/cddl/contrib/opensolaris/cmd/zpool/zpool.8
index 4c82741..715439b 100644
--- a/cddl/contrib/opensolaris/cmd/zpool/zpool.8
+++ b/cddl/contrib/opensolaris/cmd/zpool/zpool.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 15, 2012
+.Dd March 14, 2013
.Dt ZPOOL 8
.Os
.Sh NAME
@@ -1608,14 +1608,15 @@ is specified, the command exits after
.Ar count
reports are printed.
.Pp
-If a scrub or resilver is in progress, this command reports the percentage done
-and the estimated time to completion. Both of these are only approximate,
+If a scrub or resilver is in progress, this command reports the percentage
+done and the estimated time to completion. Both of these are only approximate,
because the amount of data in the pool and the other workloads on the system
can change.
.Bl -tag -width indent
.It Fl x
Only display status for pools that are exhibiting errors or are otherwise
unavailable.
+Warnings about pools not using the latest on-disk format will not be included.
.It Fl v
Displays verbose data error information, printing out a complete list of all
data errors since the last complete pool scrub.
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
index ba4397a..7e0fa18 100644
--- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
+++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
@@ -4037,7 +4037,10 @@ status_callback(zpool_handle_t *zhp, void *data)
* If we were given 'zpool status -x', only report those pools with
* problems.
*/
- if (reason == ZPOOL_STATUS_OK && cbp->cb_explain) {
+ if (cbp->cb_explain &&
+ (reason == ZPOOL_STATUS_OK ||
+ reason == ZPOOL_STATUS_VERSION_OLDER ||
+ reason == ZPOOL_STATUS_FEAT_DISABLED)) {
if (!cbp->cb_allpools) {
(void) printf(gettext("pool '%s' is healthy\n"),
zpool_get_name(zhp));
diff --git a/contrib/binutils/gas/config/tc-arm.c b/contrib/binutils/gas/config/tc-arm.c
index daaae00..c8f3149 100644
--- a/contrib/binutils/gas/config/tc-arm.c
+++ b/contrib/binutils/gas/config/tc-arm.c
@@ -651,6 +651,7 @@ struct asm_opcode
#define BAD_ARGS _("bad arguments to instruction")
#define BAD_PC _("r15 not allowed here")
+#define BAD_SP _("r13 not allowed here")
#define BAD_COND _("instruction cannot be conditional")
#define BAD_OVERLAP _("registers may not be the same")
#define BAD_HIREG _("lo register required")
@@ -659,6 +660,7 @@ struct asm_opcode
#define BAD_BRANCH _("branch must be last instruction in IT block")
#define BAD_NOT_IT _("instruction not allowed in IT block")
#define BAD_FPU _("selected FPU does not support instruction")
+#define BAD_VMRS _("APSR_nzcv may only be used with fpscr")
static struct hash_control *arm_ops_hsh;
static struct hash_control *arm_cond_hsh;
@@ -5164,10 +5166,6 @@ parse_neon_mov (char **str, int *which_operand)
Case 10: VMOV.F32 <Sd>, #<imm>
Case 11: VMOV.F64 <Dd>, #<imm> */
inst.operands[i].immisfloat = 1;
- else if (parse_big_immediate (&ptr, i) == SUCCESS)
- /* Case 2: VMOV<c><q>.<dt> <Qd>, #<imm>
- Case 3: VMOV<c><q>.<dt> <Dd>, #<imm> */
- ;
else if ((val = arm_typed_reg_parse (&ptr, REG_TYPE_NSDQ, &rtype,
&optype)) != FAIL)
{
@@ -5207,6 +5205,10 @@ parse_neon_mov (char **str, int *which_operand)
inst.operands[i++].present = 1;
}
}
+ else if (parse_big_immediate (&ptr, i) == SUCCESS)
+ /* Case 2: VMOV<c><q>.<dt> <Qd>, #<imm>
+ Case 3: VMOV<c><q>.<dt> <Dd>, #<imm> */
+ ;
else
{
first_error (_("expected <Rm> or <Dm> or <Qm> operand"));
@@ -7095,6 +7097,68 @@ do_vfp_nsyn_msr (void)
return SUCCESS;
}
+static int
+do_vfp_vmrs (void)
+{
+ int rt;
+
+ /* The destination register can be r0-r14 or APSR_nzcv */
+ if (inst.operands[0].reg > 14)
+ {
+ inst.error = BAD_PC;
+ return FAIL;
+ }
+
+ /* If the destination is r13 and not in ARM mode then unprefictable */
+ if (thumb_mode && inst.operands[0].reg == REG_SP)
+ {
+ inst.error = BAD_SP;
+ return FAIL;
+ }
+
+ /* If the destination is APSR_nzcv */
+ if (inst.operands[0].isvec && inst.operands[1].reg != 1)
+ {
+ inst.error = BAD_VMRS;
+ return FAIL;
+ }
+
+ if (inst.operands[0].isvec)
+ rt = 15;
+ else
+ rt = inst.operands[0].reg;
+
+ /* Or in the registers to use */
+ inst.instruction |= rt << 12;
+ inst.instruction |= inst.operands[1].reg << 16;
+
+ return SUCCESS;
+}
+
+static int
+do_vfp_vmsr (void)
+{
+ /* The destination register can be r0-r14 or APSR_nzcv */
+ if (inst.operands[1].reg > 14)
+ {
+ inst.error = BAD_PC;
+ return FAIL;
+ }
+
+ /* If the destination is r13 and not in ARM mode then unprefictable */
+ if (thumb_mode && inst.operands[0].reg == REG_SP)
+ {
+ inst.error = BAD_SP;
+ return FAIL;
+ }
+
+ /* Or in the registers to use */
+ inst.instruction |= inst.operands[1].reg << 12;
+ inst.instruction |= inst.operands[0].reg << 16;
+
+ return SUCCESS;
+}
+
static void
do_mrs (void)
{
@@ -15726,6 +15790,8 @@ static const struct asm_opcode insns[] =
cCE(ftouizs, ebc0ac0, 2, (RVS, RVS), vfp_sp_monadic),
cCE(fmrx, ef00a10, 2, (RR, RVC), rd_rn),
cCE(fmxr, ee00a10, 2, (RVC, RR), rn_rd),
+ cCE(vmrs, ef00a10, 2, (APSR_RR, RVC), vfp_vmrs),
+ cCE(vmsr, ee00a10, 2, (RVC, RR), vfp_vmsr),
/* Memory operations. */
cCE(flds, d100a00, 2, (RVS, ADDRGLDC), vfp_sp_ldst),
diff --git a/contrib/libc-vis/unvis.3 b/contrib/libc-vis/unvis.3
index 472c49d..34ebde6 100644
--- a/contrib/libc-vis/unvis.3
+++ b/contrib/libc-vis/unvis.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: unvis.3,v 1.23 2011/03/17 14:06:29 wiz Exp $
+.\" $NetBSD: unvis.3,v 1.27 2012/12/15 07:34:36 wiz Exp $
.\" $FreeBSD$
.\"
.\" Copyright (c) 1989, 1991, 1993
@@ -126,15 +126,17 @@ The
function has several return codes that must be handled properly.
They are:
.Bl -tag -width UNVIS_VALIDPUSH
-.It Li \&0 (zero)
+.It Li \&0 No (zero)
Another character is necessary; nothing has been recognized yet.
.It Dv UNVIS_VALID
A valid character has been recognized and is available at the location
-pointed to by cp.
+pointed to by
+.Fa cp .
.It Dv UNVIS_VALIDPUSH
A valid character has been recognized and is available at the location
-pointed to by cp; however, the character currently passed in should
-be passed in again.
+pointed to by
+.Fa cp ;
+however, the character currently passed in should be passed in again.
.It Dv UNVIS_NOCHAR
A valid sequence was detected, but no character was produced.
This return code is necessary to indicate a logical break between characters.
@@ -150,7 +152,7 @@ one more time with flag set to
to extract any remaining character (the character passed in is ignored).
.Pp
The
-.Ar flag
+.Fa flag
argument is also used to specify the encoding style of the source.
If set to
.Dv VIS_HTTPSTYLE
@@ -161,7 +163,8 @@ will decode URI strings as specified in RFC 1808.
If set to
.Dv VIS_HTTP1866 ,
.Fn unvis
-will decode URI strings as specified in RFC 1866.
+will decode entity references and numeric character references
+as specified in RFC 1866.
If set to
.Dv VIS_MIMESTYLE ,
.Fn unvis
@@ -169,7 +172,9 @@ will decode MIME Quoted-Printable strings as specified in RFC 2045.
If set to
.Dv VIS_NOESCAPE ,
.Fn unvis
-will not decode \e quoted characters.
+will not decode
+.Ql \e
+quoted characters.
.Pp
The following code fragment illustrates a proper use of
.Fn unvis .
@@ -204,7 +209,7 @@ The functions
and
.Fn strnunvisx
will return \-1 on error and set
-.Va errno
+.Va errno
to:
.Bl -tag -width Er
.It Bq Er EINVAL
@@ -212,7 +217,7 @@ An invalid escape sequence was detected, or the decoder is in an unknown state.
.El
.Pp
In addition the functions
-.Fn strnunvis
+.Fn strnunvis
and
.Fn strnunvisx
will can also set
@@ -244,4 +249,14 @@ and
functions appeared in
.Nx 6.0
and
-.Fx 10.0 .
+.Fx 9.2 .
+.Sh BUGS
+The names
+.Dv VIS_HTTP1808
+and
+.Dv VIS_HTTP1866
+are wrong.
+Percent-encoding was defined in RFC 1738, the original RFC for URL.
+RFC 1866 defines HTML 2.0, an application of SGML, from which it
+inherits concepts of numeric character references and entity
+references.
diff --git a/contrib/libc-vis/unvis.c b/contrib/libc-vis/unvis.c
index d87812a..9cf112c 100644
--- a/contrib/libc-vis/unvis.c
+++ b/contrib/libc-vis/unvis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $ */
+/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $");
+__RCSID("$NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
__FBSDID("$FreeBSD$");
@@ -90,7 +90,7 @@ __weak_alias(strnunvisx,_strnunvisx)
* RFC 1866
*/
static const struct nv {
- const char name[7];
+ char name[7];
uint8_t value;
} nv[] = {
{ "AElig", 198 }, /* capital AE diphthong (ligature) */
diff --git a/contrib/libc-vis/vis.3 b/contrib/libc-vis/vis.3
index 6f5b15f..9d2cb31 100644
--- a/contrib/libc-vis/vis.3
+++ b/contrib/libc-vis/vis.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: vis.3,v 1.29 2012/12/14 22:55:59 christos Exp $
+.\" $NetBSD: vis.3,v 1.39 2013/02/20 20:05:26 christos Exp $
.\" $FreeBSD$
.\"
.\" Copyright (c) 1989, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)vis.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd December 14, 2012
+.Dd February 19, 2013
.Dt VIS 3
.Os
.Sh NAME
@@ -40,12 +40,14 @@
.Nm strnvis ,
.Nm strvisx ,
.Nm strnvisx ,
+.Nm strenvisx ,
.Nm svis ,
.Nm snvis ,
.Nm strsvis ,
.Nm strsnvis ,
-.Nm strsvisx
-.Nm strsnvisx
+.Nm strsvisx ,
+.Nm strsnvisx ,
+.Nm strsenvisx
.Nd visually encode characters
.Sh LIBRARY
.Lb libc
@@ -63,6 +65,8 @@
.Fn strvisx "char *dst" "const char *src" "size_t len" "int flag"
.Ft int
.Fn strnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag"
+.Ft int
+.Fn strenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "int *cerr_ptr"
.Ft char *
.Fn svis "char *dst" "int c" "int flag" "int nextc" "const char *extra"
.Ft char *
@@ -75,6 +79,8 @@
.Fn strsvisx "char *dst" "const char *src" "size_t len" "int flag" "const char *extra"
.Ft int
.Fn strsnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra"
+.Ft int
+.Fn strsenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" "int *cerr_ptr"
.Sh DESCRIPTION
The
.Fn vis
@@ -89,11 +95,11 @@ needs no encoding, it is copied in unaltered.
The string is null terminated, and a pointer to the end of the string is
returned.
The maximum length of any encoding is four
-characters (not including the trailing
+bytes (not including the trailing
.Dv NUL ) ;
thus, when
encoding a set of characters into a buffer, the size of the buffer should
-be four times the number of characters encoded, plus one for the trailing
+be four times the number of bytes encoded, plus one for the trailing
.Dv NUL .
The flag parameter is used for altering the default range of
characters considered for encoding and for altering the visual
@@ -142,16 +148,17 @@ terminate
The size of
.Fa dst
must be four times the number
-of characters encoded from
+of bytes encoded from
.Fa src
(plus one for the
.Dv NUL ) .
Both
-forms return the number of characters in dst (not including
-the trailing
+forms return the number of characters in
+.Fa dst
+(not including the trailing
.Dv NUL ) .
The
-.Dq n
+.Dq Nm n
versions of the functions also take an additional argument
.Fa dlen
that indicates the length of the
@@ -159,7 +166,7 @@ that indicates the length of the
buffer.
If
.Fa dlen
-is not large enough to fix the converted string then the
+is not large enough to fit the converted string then the
.Fn strnvis
and
.Fn strnvisx
@@ -167,6 +174,14 @@ functions return \-1 and set
.Va errno
to
.Dv ENOSPC .
+The
+.Fn strenvisx
+function takes an additional argument,
+.Fa cerr_ptr ,
+that is used to pass in and out a multibyte conversion error flag.
+This is useful when processing single characters at a time when
+it is possible that the locale may be set to something other
+than the locale of the characters in the input data.
.Pp
The functions
.Fn svis ,
@@ -174,16 +189,18 @@ The functions
.Fn strsvis ,
.Fn strsnvis ,
.Fn strsvisx ,
+.Fn strsnvisx ,
and
-.Fn strsnvisx
+.Fn strsenvisx
correspond to
.Fn vis ,
.Fn nvis ,
.Fn strvis ,
.Fn strnvis ,
.Fn strvisx ,
+.Fn strnvisx ,
and
-.Fn strnvisx
+.Fn strenvisx
but have an additional argument
.Fa extra ,
pointing to a
@@ -214,14 +231,13 @@ and
.Fn strnvisx ) ,
and the type of representation used.
By default, all non-graphic characters,
-except space, tab, and newline are encoded.
-(See
-.Xr isgraph 3 . )
+except space, tab, and newline are encoded (see
+.Xr isgraph 3 ) .
The following flags
alter this:
.Bl -tag -width VIS_WHITEX
.It Dv VIS_GLOB
-Also encode magic characters
+Also encode the magic characters
.Ql ( * ,
.Ql \&? ,
.Ql \&[
@@ -243,11 +259,13 @@ Synonym for
\&|
.Dv VIS_NL .
.It Dv VIS_SAFE
-Only encode "unsafe" characters.
+Only encode
+.Dq unsafe
+characters.
Unsafe means control characters which may cause common terminals to perform
unexpected functions.
Currently this form allows space, tab, newline, backspace, bell, and
-return - in addition to all graphic characters - unencoded.
+return \(em in addition to all graphic characters \(em unencoded.
.El
.Pp
(The above flags have no effect for
@@ -287,8 +305,8 @@ Use an
to represent meta characters (characters with the 8th
bit set), and use caret
.Ql ^
-to represent control characters see
-.Pf ( Xr iscntrl 3 ) .
+to represent control characters (see
+.Xr iscntrl 3 ) .
The following formats are used:
.Bl -tag -width xxxxx
.It Dv \e^C
@@ -335,19 +353,20 @@ Use C-style backslash sequences to represent standard non-printable
characters.
The following sequences are used to represent the indicated characters:
.Bd -unfilled -offset indent
-.Li \ea Tn - BEL No (007)
-.Li \eb Tn - BS No (010)
-.Li \ef Tn - NP No (014)
-.Li \en Tn - NL No (012)
-.Li \er Tn - CR No (015)
-.Li \es Tn - SP No (040)
-.Li \et Tn - HT No (011)
-.Li \ev Tn - VT No (013)
-.Li \e0 Tn - NUL No (000)
+.Li \ea Tn \(em BEL No (007)
+.Li \eb Tn \(em BS No (010)
+.Li \ef Tn \(em NP No (014)
+.Li \en Tn \(em NL No (012)
+.Li \er Tn \(em CR No (015)
+.Li \es Tn \(em SP No (040)
+.Li \et Tn \(em HT No (011)
+.Li \ev Tn \(em VT No (013)
+.Li \e0 Tn \(em NUL No (000)
.Ed
.Pp
-When using this format, the nextc parameter is looked at to determine
-if a
+When using this format, the
+.Fa nextc
+parameter is looked at to determine if a
.Dv NUL
character can be encoded as
.Ql \e0
@@ -374,8 +393,8 @@ represents a lower case hexadecimal digit.
.It Dv VIS_MIMESTYLE
Use MIME Quoted-Printable encoding as described in RFC 2045, only don't
break lines and don't handle CRLF.
-The form is:
-.Ql %XX
+The form is
+.Ql =XX
where
.Em X
represents an upper case hexadecimal digit.
@@ -392,6 +411,41 @@ meta characters as
.Ql M-C ) .
With this flag set, the encoding is
ambiguous and non-invertible.
+.Sh MULTIBYTE CHARACTER SUPPORT
+These functions support multibyte character input.
+The encoding conversion is influenced by the setting of the
+.Ev LC_CTYPE
+environment variable which defines the set of characters
+that can be copied without encoding.
+.Pp
+When 8-bit data is present in the input,
+.Ev LC_CTYPE
+must be set to the correct locale or to the C locale.
+If the locales of the data and the conversion are mismatched,
+multibyte character recognition may fail and encoding will be performed
+byte-by-byte instead.
+.Pp
+As noted above,
+.Fa dst
+must be four times the number of bytes processed from
+.Fa src .
+But note that each multibyte character can be up to
+.Dv MB_LEN_MAX
+bytes
+.\" (see
+.\" .Xr multibyte 3 )
+so in terms of multibyte characters,
+.Fa dst
+must be four times
+.Dv MB_LEN_MAX
+times the number of characters processed from
+.Fa src .
+.Sh ENVIRONMENT
+.Bl -tag -width ".Ev LC_CTYPE"
+.It Ev LC_CTYPE
+Specify the locale of the input data.
+Set to C if the input data locale is unknown.
+.El
.Sh ERRORS
The functions
.Fn nvis
@@ -407,11 +461,11 @@ and
.Fn strsnvisx ,
will return \-1 when the
.Fa dlen
-destination buffer length size is not enough to perform the conversion while
+destination buffer size is not enough to perform the conversion while
setting
.Va errno
to:
-.Bl -tag -width Er
+.Bl -tag -width ".Bq Er ENOSPC"
.It Bq Er ENOSPC
The destination buffer size is not large enough to perform the conversion.
.El
@@ -419,18 +473,23 @@ The destination buffer size is not large enough to perform the conversion.
.Xr unvis 1 ,
.Xr vis 1 ,
.Xr glob 3 ,
+.\" .Xr multibyte 3 ,
.Xr unvis 3
.Rs
.%A T. Berners-Lee
.%T Uniform Resource Locators (URL)
-.%O RFC1738
+.%O "RFC 1738"
+.Re
+.Rs
+.%T "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies"
+.%O "RFC 2045"
.Re
.Sh HISTORY
The
.Fn vis ,
.Fn strvis ,
and
-.Fa strvisx
+.Fn strvisx
functions first appeared in
.Bx 4.4 .
The
@@ -441,7 +500,7 @@ and
functions appeared in
.Nx 1.5
and
-.Fx 10.0 .
+.Fx 9.2 .
The buffer size limited versions of the functions
.Po Fn nvis ,
.Fn strnvis ,
@@ -451,6 +510,9 @@ The buffer size limited versions of the functions
and
.Fn strsnvisx Pc
appeared in
-.Nx 6.0
and
-.Fx 10.0 .
+.Fx 9.2 .
+Myltibyte character support was added in
+.Nx 7.0
+and
+.Fx 9.2 .
diff --git a/contrib/libc-vis/vis.c b/contrib/libc-vis/vis.c
index 040c28c..2ba6b5b 100644
--- a/contrib/libc-vis/vis.c
+++ b/contrib/libc-vis/vis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $ */
+/* $NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -57,19 +57,23 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $");
+__RCSID("$NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $");
#endif /* LIBC_SCCS and not lint */
+#ifdef __FBSDID
__FBSDID("$FreeBSD$");
+#define _DIAGASSERT(x) assert(x)
+#endif
#include "namespace.h"
#include <sys/types.h>
+#include <sys/param.h>
#include <assert.h>
#include <vis.h>
#include <errno.h>
#include <stdlib.h>
-
-#define _DIAGASSERT(x) assert(x)
+#include <wchar.h>
+#include <wctype.h>
#ifdef __weak_alias
__weak_alias(strvisx,_strvisx)
@@ -81,65 +85,66 @@ __weak_alias(strvisx,_strvisx)
#include <stdio.h>
#include <string.h>
-static char *do_svis(char *, size_t *, int, int, int, const char *);
+/*
+ * The reason for going through the trouble to deal with character encodings
+ * in vis(3), is that we use this to safe encode output of commands. This
+ * safe encoding varies depending on the character set. For example if we
+ * display ps output in French, we don't want to display French characters
+ * as M-foo.
+ */
+
+static wchar_t *do_svis(wchar_t *, wint_t, int, wint_t, const wchar_t *);
#undef BELL
-#define BELL '\a'
-
-#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
-#define iswhite(c) (c == ' ' || c == '\t' || c == '\n')
-#define issafe(c) (c == '\b' || c == BELL || c == '\r')
-#define xtoa(c) "0123456789abcdef"[c]
-#define XTOA(c) "0123456789ABCDEF"[c]
-
-#define MAXEXTRAS 9
-
-#define MAKEEXTRALIST(flag, extra, orig_str) \
-do { \
- const char *orig = orig_str; \
- const char *o = orig; \
- char *e; \
- while (*o++) \
- continue; \
- extra = malloc((size_t)((o - orig) + MAXEXTRAS)); \
- if (!extra) break; \
- for (o = orig, e = extra; (*e++ = *o++) != '\0';) \
- continue; \
- e--; \
- if (flag & VIS_GLOB) { \
- *e++ = '*'; \
- *e++ = '?'; \
- *e++ = '['; \
- *e++ = '#'; \
- } \
- if (flag & VIS_SP) *e++ = ' '; \
- if (flag & VIS_TAB) *e++ = '\t'; \
- if (flag & VIS_NL) *e++ = '\n'; \
- if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \
- *e = '\0'; \
-} while (/*CONSTCOND*/0)
+#define BELL L'\a'
+
+#define iswoctal(c) (((u_char)(c)) >= L'0' && ((u_char)(c)) <= L'7')
+#define iswwhite(c) (c == L' ' || c == L'\t' || c == L'\n')
+#define iswsafe(c) (c == L'\b' || c == BELL || c == L'\r')
+#define xtoa(c) L"0123456789abcdef"[c]
+#define XTOA(c) L"0123456789ABCDEF"[c]
+
+#define MAXEXTRAS 10
+
+#if !HAVE_NBTOOL_CONFIG_H
+#ifndef __NetBSD__
+/*
+ * On NetBSD MB_LEN_MAX is currently 32 which does not fit on any integer
+ * integral type and it is probably wrong, since currently the maximum
+ * number of bytes and character needs is 6. Until this is fixed, the
+ * loops below are using sizeof(uint64_t) - 1 instead of MB_LEN_MAX, and
+ * the assertion is commented out.
+ */
+#ifdef __FreeBSD__
+/*
+ * On FreeBSD including <sys/systm.h> for CTASSERT only works in kernel
+ * mode.
+ */
+#ifndef CTASSERT
+#define CTASSERT(x) _CTASSERT(x, __LINE__)
+#define _CTASSERT(x, y) __CTASSERT(x, y)
+#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1]
+#endif
+#endif /* __FreeBSD__ */
+CTASSERT(MB_LEN_MAX <= sizeof(uint64_t));
+#endif /* !__NetBSD__ */
+#endif
/*
* This is do_hvis, for HTTP style (RFC 1808)
*/
-static char *
-do_hvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra)
+static wchar_t *
+do_hvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra)
{
-
- if ((isascii(c) && isalnum(c))
+ if (iswalnum(c)
/* safe */
- || c == '$' || c == '-' || c == '_' || c == '.' || c == '+'
+ || c == L'$' || c == L'-' || c == L'_' || c == L'.' || c == L'+'
/* extra */
- || c == '!' || c == '*' || c == '\'' || c == '(' || c == ')'
- || c == ',') {
- dst = do_svis(dst, dlen, c, flag, nextc, extra);
- } else {
- if (dlen) {
- if (*dlen < 3)
- return NULL;
- *dlen -= 3;
- }
- *dst++ = '%';
+ || c == L'!' || c == L'*' || c == L'\'' || c == L'(' || c == L')'
+ || c == L',')
+ dst = do_svis(dst, c, flags, nextc, extra);
+ else {
+ *dst++ = L'%';
*dst++ = xtoa(((unsigned int)c >> 4) & 0xf);
*dst++ = xtoa((unsigned int)c & 0xf);
}
@@ -151,312 +156,448 @@ do_hvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra)
* This is do_mvis, for Quoted-Printable MIME (RFC 2045)
* NB: No handling of long lines or CRLF.
*/
-static char *
-do_mvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra)
+static wchar_t *
+do_mvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra)
{
- if ((c != '\n') &&
+ if ((c != L'\n') &&
/* Space at the end of the line */
- ((isspace(c) && (nextc == '\r' || nextc == '\n')) ||
+ ((iswspace(c) && (nextc == L'\r' || nextc == L'\n')) ||
/* Out of range */
- (!isspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) ||
- /* Specific char to be escaped */
- strchr("#$@[\\]^`{|}~", c) != NULL)) {
- if (dlen) {
- if (*dlen < 3)
- return NULL;
- *dlen -= 3;
- }
- *dst++ = '=';
+ (!iswspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) ||
+ /* Specific char to be escaped */
+ wcschr(L"#$@[\\]^`{|}~", c) != NULL)) {
+ *dst++ = L'=';
*dst++ = XTOA(((unsigned int)c >> 4) & 0xf);
*dst++ = XTOA((unsigned int)c & 0xf);
- } else {
- dst = do_svis(dst, dlen, c, flag, nextc, extra);
- }
+ } else
+ dst = do_svis(dst, c, flags, nextc, extra);
return dst;
}
/*
- * This is do_vis, the central code of vis.
- * dst: Pointer to the destination buffer
- * c: Character to encode
- * flag: Flag word
- * nextc: The character following 'c'
- * extra: Pointer to the list of extra characters to be
- * backslash-protected.
+ * Output single byte of multibyte character.
*/
-static char *
-do_svis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra)
+static wchar_t *
+do_mbyte(wchar_t *dst, wint_t c, int flags, wint_t nextc, int iswextra)
{
- int isextra;
- size_t odlen = dlen ? *dlen : 0;
-
- isextra = strchr(extra, c) != NULL;
-#define HAVE(x) \
- do { \
- if (dlen) { \
- if (*dlen < (x)) \
- goto out; \
- *dlen -= (x); \
- } \
- } while (/*CONSTCOND*/0)
- if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) ||
- ((flag & VIS_SAFE) && issafe(c)))) {
- HAVE(1);
- *dst++ = c;
- return dst;
- }
- if (flag & VIS_CSTYLE) {
- HAVE(2);
+ if (flags & VIS_CSTYLE) {
switch (c) {
- case '\n':
- *dst++ = '\\'; *dst++ = 'n';
+ case L'\n':
+ *dst++ = L'\\'; *dst++ = L'n';
return dst;
- case '\r':
- *dst++ = '\\'; *dst++ = 'r';
+ case L'\r':
+ *dst++ = L'\\'; *dst++ = L'r';
return dst;
- case '\b':
- *dst++ = '\\'; *dst++ = 'b';
+ case L'\b':
+ *dst++ = L'\\'; *dst++ = L'b';
return dst;
case BELL:
- *dst++ = '\\'; *dst++ = 'a';
+ *dst++ = L'\\'; *dst++ = L'a';
return dst;
- case '\v':
- *dst++ = '\\'; *dst++ = 'v';
+ case L'\v':
+ *dst++ = L'\\'; *dst++ = L'v';
return dst;
- case '\t':
- *dst++ = '\\'; *dst++ = 't';
+ case L'\t':
+ *dst++ = L'\\'; *dst++ = L't';
return dst;
- case '\f':
- *dst++ = '\\'; *dst++ = 'f';
+ case L'\f':
+ *dst++ = L'\\'; *dst++ = L'f';
return dst;
- case ' ':
- *dst++ = '\\'; *dst++ = 's';
+ case L' ':
+ *dst++ = L'\\'; *dst++ = L's';
return dst;
- case '\0':
- *dst++ = '\\'; *dst++ = '0';
- if (isoctal(nextc)) {
- HAVE(2);
- *dst++ = '0';
- *dst++ = '0';
+ case L'\0':
+ *dst++ = L'\\'; *dst++ = L'0';
+ if (iswoctal(nextc)) {
+ *dst++ = L'0';
+ *dst++ = L'0';
}
return dst;
default:
- if (isgraph(c)) {
- *dst++ = '\\'; *dst++ = c;
+ if (iswgraph(c)) {
+ *dst++ = L'\\';
+ *dst++ = c;
return dst;
}
- if (dlen)
- *dlen = odlen;
}
}
- if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) {
- HAVE(4);
- *dst++ = '\\';
- *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0';
- *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0';
- *dst++ = (c & 07) + '0';
+ if (iswextra || ((c & 0177) == L' ') || (flags & VIS_OCTAL)) {
+ *dst++ = L'\\';
+ *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + L'0';
+ *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + L'0';
+ *dst++ = (c & 07) + L'0';
} else {
- if ((flag & VIS_NOSLASH) == 0) {
- HAVE(1);
- *dst++ = '\\';
- }
+ if ((flags & VIS_NOSLASH) == 0)
+ *dst++ = L'\\';
if (c & 0200) {
- HAVE(1);
- c &= 0177; *dst++ = 'M';
+ c &= 0177;
+ *dst++ = L'M';
}
- if (iscntrl(c)) {
- HAVE(2);
- *dst++ = '^';
+ if (iswcntrl(c)) {
+ *dst++ = L'^';
if (c == 0177)
- *dst++ = '?';
+ *dst++ = L'?';
else
- *dst++ = c + '@';
+ *dst++ = c + L'@';
} else {
- HAVE(2);
- *dst++ = '-'; *dst++ = c;
+ *dst++ = L'-';
+ *dst++ = c;
}
}
+
return dst;
-out:
- *dlen = odlen;
- return NULL;
}
-typedef char *(*visfun_t)(char *, size_t *, int, int, int, const char *);
+/*
+ * This is do_vis, the central code of vis.
+ * dst: Pointer to the destination buffer
+ * c: Character to encode
+ * flags: Flags word
+ * nextc: The character following 'c'
+ * extra: Pointer to the list of extra characters to be
+ * backslash-protected.
+ */
+static wchar_t *
+do_svis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra)
+{
+ int iswextra, i, shft;
+ uint64_t bmsk, wmsk;
+
+ iswextra = wcschr(extra, c) != NULL;
+ if (!iswextra && (iswgraph(c) || iswwhite(c) ||
+ ((flags & VIS_SAFE) && iswsafe(c)))) {
+ *dst++ = c;
+ return dst;
+ }
+
+ /* See comment in istrsenvisx() output loop, below. */
+ wmsk = 0;
+ for (i = sizeof(wmsk) - 1; i >= 0; i--) {
+ shft = i * NBBY;
+ bmsk = (uint64_t)0xffLL << shft;
+ wmsk |= bmsk;
+ if ((c & wmsk) || i == 0)
+ dst = do_mbyte(dst, (wint_t)(
+ (uint64_t)(c & bmsk) >> shft),
+ flags, nextc, iswextra);
+ }
+
+ return dst;
+}
+
+typedef wchar_t *(*visfun_t)(wchar_t *, wint_t, int, wint_t, const wchar_t *);
/*
* Return the appropriate encoding function depending on the flags given.
*/
static visfun_t
-getvisfun(int flag)
+getvisfun(int flags)
{
- if (flag & VIS_HTTPSTYLE)
+ if (flags & VIS_HTTPSTYLE)
return do_hvis;
- if (flag & VIS_MIMESTYLE)
+ if (flags & VIS_MIMESTYLE)
return do_mvis;
return do_svis;
}
/*
- * isnvis - visually encode characters, also encoding the characters
- * pointed to by `extra'
+ * Expand list of extra characters to not visually encode.
*/
-static char *
-isnvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra)
+static wchar_t *
+makeextralist(int flags, const char *src)
{
- char *nextra = NULL;
- visfun_t f;
+ wchar_t *dst, *d;
+ size_t len;
- _DIAGASSERT(dst != NULL);
- _DIAGASSERT(extra != NULL);
- MAKEEXTRALIST(flag, nextra, extra);
- if (!nextra) {
- if (dlen && *dlen == 0) {
- errno = ENOSPC;
- return NULL;
- }
- *dst = '\0'; /* can't create nextra, return "" */
- return dst;
- }
- f = getvisfun(flag);
- dst = (*f)(dst, dlen, c, flag, nextc, nextra);
- free(nextra);
- if (dst == NULL || (dlen && *dlen == 0)) {
- errno = ENOSPC;
+ len = strlen(src);
+ if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL)
return NULL;
+
+ if (mbstowcs(dst, src, len) == (size_t)-1) {
+ size_t i;
+ for (i = 0; i < len; i++)
+ dst[i] = (wint_t)(u_char)src[i];
+ d = dst + len;
+ } else
+ d = dst + wcslen(dst);
+
+ if (flags & VIS_GLOB) {
+ *d++ = L'*';
+ *d++ = L'?';
+ *d++ = L'[';
+ *d++ = L'#';
}
- *dst = '\0';
- return dst;
-}
-char *
-svis(char *dst, int c, int flag, int nextc, const char *extra)
-{
- return isnvis(dst, NULL, c, flag, nextc, extra);
-}
+ if (flags & VIS_SP) *d++ = L' ';
+ if (flags & VIS_TAB) *d++ = L'\t';
+ if (flags & VIS_NL) *d++ = L'\n';
+ if ((flags & VIS_NOSLASH) == 0) *d++ = L'\\';
+ *d = L'\0';
-char *
-snvis(char *dst, size_t dlen, int c, int flag, int nextc, const char *extra)
-{
- return isnvis(dst, &dlen, c, flag, nextc, extra);
+ return dst;
}
-
/*
- * strsvis, strsvisx - visually encode characters from src into dst
- *
- * Extra is a pointer to a \0-terminated list of characters to
- * be encoded, too. These functions are useful e. g. to
- * encode strings in such a way so that they are not interpreted
- * by a shell.
- *
- * Dst must be 4 times the size of src to account for possible
- * expansion. The length of dst, not including the trailing NULL,
- * is returned.
- *
- * Strsvisx encodes exactly len bytes from src into dst.
- * This is useful for encoding a block of data.
+ * istrsenvisx()
+ * The main internal function.
+ * All user-visible functions call this one.
*/
static int
-istrsnvis(char *dst, size_t *dlen, const char *csrc, int flag, const char *extra)
+istrsenvisx(char *mbdst, size_t *dlen, const char *mbsrc, size_t mblength,
+ int flags, const char *mbextra, int *cerr_ptr)
{
- int c;
- char *start;
- char *nextra = NULL;
- const unsigned char *src = (const unsigned char *)csrc;
+ wchar_t *dst, *src, *pdst, *psrc, *start, *extra;
+ size_t len, olen;
+ uint64_t bmsk, wmsk;
+ wint_t c;
visfun_t f;
-
- _DIAGASSERT(dst != NULL);
- _DIAGASSERT(src != NULL);
- _DIAGASSERT(extra != NULL);
- MAKEEXTRALIST(flag, nextra, extra);
- if (!nextra) {
- *dst = '\0'; /* can't create nextra, return "" */
- return 0;
+ int clen = 0, cerr = 0, error = -1, i, shft;
+ ssize_t mbslength, maxolen;
+
+ _DIAGASSERT(mbdst != NULL);
+ _DIAGASSERT(mbsrc != NULL);
+ _DIAGASSERT(mbextra != NULL);
+
+ /*
+ * Input (mbsrc) is a char string considered to be multibyte
+ * characters. The input loop will read this string pulling
+ * one character, possibly multiple bytes, from mbsrc and
+ * converting each to wchar_t in src.
+ *
+ * The vis conversion will be done using the wide char
+ * wchar_t string.
+ *
+ * This will then be converted back to a multibyte string to
+ * return to the caller.
+ */
+
+ /* Allocate space for the wide char strings */
+ psrc = pdst = extra = NULL;
+ if (!mblength)
+ mblength = strlen(mbsrc);
+ if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL)
+ return -1;
+ if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL)
+ goto out;
+ dst = pdst;
+ src = psrc;
+
+ /* Use caller's multibyte conversion error flag. */
+ if (cerr_ptr)
+ cerr = *cerr_ptr;
+
+ /*
+ * Input loop.
+ * Handle up to mblength characters (not bytes). We do not
+ * stop at NULs because we may be processing a block of data
+ * that includes NULs.
+ */
+ mbslength = (ssize_t)mblength;
+ /*
+ * When inputing a single character, must also read in the
+ * next character for nextc, the look-ahead character.
+ */
+ if (mbslength == 1)
+ mbslength++;
+ while (mbslength > 0) {
+ /* Convert one multibyte character to wchar_t. */
+ if (!cerr)
+ clen = mbtowc(src, mbsrc, MB_LEN_MAX);
+ if (cerr || clen < 0) {
+ /* Conversion error, process as a byte instead. */
+ *src = (wint_t)(u_char)*mbsrc;
+ clen = 1;
+ cerr = 1;
+ }
+ if (clen == 0)
+ /*
+ * NUL in input gives 0 return value. process
+ * as single NUL byte and keep going.
+ */
+ clen = 1;
+ /* Advance buffer character pointer. */
+ src++;
+ /* Advance input pointer by number of bytes read. */
+ mbsrc += clen;
+ /* Decrement input byte count. */
+ mbslength -= clen;
+ }
+ len = src - psrc;
+ src = psrc;
+ /*
+ * In the single character input case, we will have actually
+ * processed two characters, c and nextc. Reset len back to
+ * just a single character.
+ */
+ if (mblength < len)
+ len = mblength;
+
+ /* Convert extra argument to list of characters for this mode. */
+ extra = makeextralist(flags, mbextra);
+ if (!extra) {
+ if (dlen && *dlen == 0) {
+ errno = ENOSPC;
+ goto out;
+ }
+ *mbdst = '\0'; /* can't create extra, return "" */
+ error = 0;
+ goto out;
}
- f = getvisfun(flag);
- for (start = dst; (c = *src++) != '\0'; /* empty */) {
- dst = (*f)(dst, dlen, c, flag, *src, nextra);
+
+ /* Look up which processing function to call. */
+ f = getvisfun(flags);
+
+ /*
+ * Main processing loop.
+ * Call do_Xvis processing function one character at a time
+ * with next character available for look-ahead.
+ */
+ for (start = dst; len > 0; len--) {
+ c = *src++;
+ dst = (*f)(dst, c, flags, len >= 1 ? *src : L'\0', extra);
if (dst == NULL) {
errno = ENOSPC;
- return -1;
+ goto out;
}
}
- free(nextra);
- if (dlen && *dlen == 0) {
- errno = ENOSPC;
- return -1;
+
+ /* Terminate the string in the buffer. */
+ *dst = L'\0';
+
+ /*
+ * Output loop.
+ * Convert wchar_t string back to multibyte output string.
+ * If we have hit a multi-byte conversion error on input,
+ * output byte-by-byte here. Else use wctomb().
+ */
+ len = wcslen(start);
+ maxolen = dlen ? *dlen : (wcslen(start) * MB_LEN_MAX + 1);
+ olen = 0;
+ for (dst = start; len > 0; len--) {
+ if (!cerr)
+ clen = wctomb(mbdst, *dst);
+ if (cerr || clen < 0) {
+ /*
+ * Conversion error, process as a byte(s) instead.
+ * Examine each byte and higher-order bytes for
+ * data. E.g.,
+ * 0x000000000000a264 -> a2 64
+ * 0x000000001f00a264 -> 1f 00 a2 64
+ */
+ clen = 0;
+ wmsk = 0;
+ for (i = sizeof(wmsk) - 1; i >= 0; i--) {
+ shft = i * NBBY;
+ bmsk = (uint64_t)0xffLL << shft;
+ wmsk |= bmsk;
+ if ((*dst & wmsk) || i == 0)
+ mbdst[clen++] = (char)(
+ (uint64_t)(*dst & bmsk) >>
+ shft);
+ }
+ cerr = 1;
+ }
+ /* If this character would exceed our output limit, stop. */
+ if (olen + clen > (size_t)maxolen)
+ break;
+ /* Advance output pointer by number of bytes written. */
+ mbdst += clen;
+ /* Advance buffer character pointer. */
+ dst++;
+ /* Incrment output character count. */
+ olen += clen;
}
- *dst = '\0';
- return (int)(dst - start);
+
+ /* Terminate the output string. */
+ *mbdst = '\0';
+
+ /* Pass conversion error flag out. */
+ if (cerr_ptr)
+ *cerr_ptr = cerr;
+
+ free(extra);
+ free(pdst);
+ free(psrc);
+
+ return (int)olen;
+out:
+ free(extra);
+ free(pdst);
+ free(psrc);
+ return error;
}
+#endif
-int
-strsvis(char *dst, const char *csrc, int flag, const char *extra)
+#if !HAVE_SVIS
+/*
+ * The "svis" variants all take an "extra" arg that is a pointer
+ * to a NUL-terminated list of characters to be encoded, too.
+ * These functions are useful e. g. to encode strings in such a
+ * way so that they are not interpreted by a shell.
+ */
+
+char *
+svis(char *mbdst, int c, int flags, int nextc, const char *mbextra)
{
- return istrsnvis(dst, NULL, csrc, flag, extra);
+ char cc[2];
+ int ret;
+
+ cc[0] = c;
+ cc[1] = nextc;
+
+ ret = istrsenvisx(mbdst, NULL, cc, 1, flags, mbextra, NULL);
+ if (ret < 0)
+ return NULL;
+ return mbdst + ret;
}
-int
-strsnvis(char *dst, size_t dlen, const char *csrc, int flag, const char *extra)
+char *
+snvis(char *mbdst, size_t dlen, int c, int flags, int nextc, const char *mbextra)
{
- return istrsnvis(dst, &dlen, csrc, flag, extra);
+ char cc[2];
+ int ret;
+
+ cc[0] = c;
+ cc[1] = nextc;
+
+ ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, mbextra, NULL);
+ if (ret < 0)
+ return NULL;
+ return mbdst + ret;
}
-static int
-istrsnvisx(char *dst, size_t *dlen, const char *csrc, size_t len, int flag,
- const char *extra)
+int
+strsvis(char *mbdst, const char *mbsrc, int flags, const char *mbextra)
{
- unsigned char c;
- char *start;
- char *nextra = NULL;
- const unsigned char *src = (const unsigned char *)csrc;
- visfun_t f;
+ return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, mbextra, NULL);
+}
- _DIAGASSERT(dst != NULL);
- _DIAGASSERT(src != NULL);
- _DIAGASSERT(extra != NULL);
- MAKEEXTRALIST(flag, nextra, extra);
- if (! nextra) {
- if (dlen && *dlen == 0) {
- errno = ENOSPC;
- return -1;
- }
- *dst = '\0'; /* can't create nextra, return "" */
- return 0;
- }
+int
+strsnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags, const char *mbextra)
+{
+ return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, mbextra, NULL);
+}
- f = getvisfun(flag);
- for (start = dst; len > 0; len--) {
- c = *src++;
- dst = (*f)(dst, dlen, c, flag, len > 1 ? *src : '\0', nextra);
- if (dst == NULL) {
- errno = ENOSPC;
- return -1;
- }
- }
- free(nextra);
- if (dlen && *dlen == 0) {
- errno = ENOSPC;
- return -1;
- }
- *dst = '\0';
- return (int)(dst - start);
+int
+strsvisx(char *mbdst, const char *mbsrc, size_t len, int flags, const char *mbextra)
+{
+ return istrsenvisx(mbdst, NULL, mbsrc, len, flags, mbextra, NULL);
}
int
-strsvisx(char *dst, const char *csrc, size_t len, int flag, const char *extra)
+strsnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags,
+ const char *mbextra)
{
- return istrsnvisx(dst, NULL, csrc, len, flag, extra);
+ return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, NULL);
}
int
-strsnvisx(char *dst, size_t dlen, const char *csrc, size_t len, int flag,
- const char *extra)
+strsenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags,
+ const char *mbextra, int *cerr_ptr)
{
- return istrsnvisx(dst, &dlen, csrc, len, flag, extra);
+ return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, mbextra, cerr_ptr);
}
#endif
@@ -464,120 +605,83 @@ strsnvisx(char *dst, size_t dlen, const char *csrc, size_t len, int flag,
/*
* vis - visually encode characters
*/
-static char *
-invis(char *dst, size_t *dlen, int c, int flag, int nextc)
+char *
+vis(char *mbdst, int c, int flags, int nextc)
{
- char *extra = NULL;
- unsigned char uc = (unsigned char)c;
- visfun_t f;
+ char cc[2];
+ int ret;
- _DIAGASSERT(dst != NULL);
+ cc[0] = c;
+ cc[1] = nextc;
- MAKEEXTRALIST(flag, extra, "");
- if (! extra) {
- if (dlen && *dlen == 0) {
- errno = ENOSPC;
- return NULL;
- }
- *dst = '\0'; /* can't create extra, return "" */
- return dst;
- }
- f = getvisfun(flag);
- dst = (*f)(dst, dlen, uc, flag, nextc, extra);
- free(extra);
- if (dst == NULL || (dlen && *dlen == 0)) {
- errno = ENOSPC;
+ ret = istrsenvisx(mbdst, NULL, cc, 1, flags, "", NULL);
+ if (ret < 0)
return NULL;
- }
- *dst = '\0';
- return dst;
+ return mbdst + ret;
}
char *
-vis(char *dst, int c, int flag, int nextc)
+nvis(char *mbdst, size_t dlen, int c, int flags, int nextc)
{
- return invis(dst, NULL, c, flag, nextc);
-}
+ char cc[2];
+ int ret;
-char *
-nvis(char *dst, size_t dlen, int c, int flag, int nextc)
-{
- return invis(dst, &dlen, c, flag, nextc);
-}
+ cc[0] = c;
+ cc[1] = nextc;
+ ret = istrsenvisx(mbdst, &dlen, cc, 1, flags, "", NULL);
+ if (ret < 0)
+ return NULL;
+ return mbdst + ret;
+}
/*
- * strvis, strvisx - visually encode characters from src into dst
+ * strvis - visually encode characters from src into dst
*
* Dst must be 4 times the size of src to account for possible
* expansion. The length of dst, not including the trailing NULL,
* is returned.
- *
- * Strvisx encodes exactly len bytes from src into dst.
- * This is useful for encoding a block of data.
*/
-static int
-istrnvis(char *dst, size_t *dlen, const char *src, int flag)
-{
- char *extra = NULL;
- int rv;
-
- MAKEEXTRALIST(flag, extra, "");
- if (!extra) {
- if (dlen && *dlen == 0) {
- errno = ENOSPC;
- return -1;
- }
- *dst = '\0'; /* can't create extra, return "" */
- return 0;
- }
- rv = istrsnvis(dst, dlen, src, flag, extra);
- free(extra);
- return rv;
-}
int
-strvis(char *dst, const char *src, int flag)
+strvis(char *mbdst, const char *mbsrc, int flags)
{
- return istrnvis(dst, NULL, src, flag);
+ return istrsenvisx(mbdst, NULL, mbsrc, 0, flags, "", NULL);
}
int
-strnvis(char *dst, size_t dlen, const char *src, int flag)
+strnvis(char *mbdst, size_t dlen, const char *mbsrc, int flags)
{
- return istrnvis(dst, &dlen, src, flag);
+ return istrsenvisx(mbdst, &dlen, mbsrc, 0, flags, "", NULL);
}
-static int
-istrnvisx(char *dst, size_t *dlen, const char *src, size_t len, int flag)
-{
- char *extra = NULL;
- int rv;
+/*
+ * strvisx - visually encode characters from src into dst
+ *
+ * Dst must be 4 times the size of src to account for possible
+ * expansion. The length of dst, not including the trailing NULL,
+ * is returned.
+ *
+ * Strvisx encodes exactly len characters from src into dst.
+ * This is useful for encoding a block of data.
+ */
- MAKEEXTRALIST(flag, extra, "");
- if (!extra) {
- if (dlen && *dlen == 0) {
- errno = ENOSPC;
- return -1;
- }
- *dst = '\0'; /* can't create extra, return "" */
- return 0;
- }
- rv = istrsnvisx(dst, dlen, src, len, flag, extra);
- free(extra);
- return rv;
+int
+strvisx(char *mbdst, const char *mbsrc, size_t len, int flags)
+{
+ return istrsenvisx(mbdst, NULL, mbsrc, len, flags, "", NULL);
}
int
-strvisx(char *dst, const char *src, size_t len, int flag)
+strnvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags)
{
- return istrnvisx(dst, NULL, src, len, flag);
+ return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", NULL);
}
int
-strnvisx(char *dst, size_t dlen, const char *src, size_t len, int flag)
+strenvisx(char *mbdst, size_t dlen, const char *mbsrc, size_t len, int flags,
+ int *cerr_ptr)
{
- return istrnvisx(dst, &dlen, src, len, flag);
+ return istrsenvisx(mbdst, &dlen, mbsrc, len, flags, "", cerr_ptr);
}
-
#endif
diff --git a/contrib/libc-vis/vis.h b/contrib/libc-vis/vis.h
index cd7680e..beb029c 100644
--- a/contrib/libc-vis/vis.h
+++ b/contrib/libc-vis/vis.h
@@ -1,4 +1,4 @@
-/* $NetBSD: vis.h,v 1.20 2012/12/14 21:36:59 christos Exp $ */
+/* $NetBSD: vis.h,v 1.21 2013/02/20 17:01:15 christos Exp $ */
/* $FreeBSD$ */
/*-
@@ -96,9 +96,12 @@ int strsnvis(char *, size_t, const char *, int, const char *);
int strvisx(char *, const char *, size_t, int);
int strnvisx(char *, size_t, const char *, size_t, int);
+int strenvisx(char *, size_t, const char *, size_t, int, int *);
int strsvisx(char *, const char *, size_t, int, const char *);
int strsnvisx(char *, size_t, const char *, size_t, int, const char *);
+int strsenvisx(char *, size_t, const char *, size_t , int, const char *,
+ int *);
int strunvis(char *, const char *);
int strnunvis(char *, size_t, const char *);
diff --git a/contrib/tzdata/africa b/contrib/tzdata/africa
index 54c7a1e..5f4f8eb 100644
--- a/contrib/tzdata/africa
+++ b/contrib/tzdata/africa
@@ -6,7 +6,7 @@
# go ahead and edit the file (and please send any changes to
# tz@iana.org for general use in the future).
-# From Paul Eggert (2006-03-22):
+# From Paul Eggert (2013-02-21):
#
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -25,6 +25,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
@@ -116,8 +120,12 @@ Zone Africa/Porto-Novo 0:10:28 - LMT 1912
1:00 - WAT
# Botswana
+# From Paul Eggert (2013-02-21):
+# Milne says they were regulated by the Cape Town Signal in 1899;
+# assume they switched to 2:00 when Cape Town did.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Gaborone 1:43:40 - LMT 1885
+ 1:30 - SAST 1903 Mar
2:00 - CAT 1943 Sep 19 2:00
2:00 1:00 CAST 1944 Mar 19 2:00
2:00 - CAT
@@ -189,6 +197,11 @@ Zone Africa/Djibouti 2:52:36 - LMT 1911 Jul
# Egypt
+# Milne says Cairo used 2:05:08.9, the local mean time of the Abbasizeh
+# observatory; round to nearest. Milne also says that the official time for
+# Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this
+# did not apply to Cairo, Alexandria, or Port Said.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Egypt 1940 only - Jul 15 0:00 1:00 S
Rule Egypt 1940 only - Oct 1 0:00 0 -
@@ -329,7 +342,7 @@ Rule Egypt 2010 only - Sep 10 0:00 1:00 S
Rule Egypt 2010 only - Sep lastThu 23:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Africa/Cairo 2:05:00 - LMT 1900 Oct
+Zone Africa/Cairo 2:05:09 - LMT 1900 Oct
2:00 Egypt EE%sT
# Equatorial Guinea
@@ -833,6 +846,41 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou
# 3:00 am Friday, July 20, 2012 and will again be advanced by 60 minutes
# August 20, 2012 from 2:00 am.
+# From Paul Eggert (2013-03-06):
+# Morocco's daylight-saving transitions due to Ramadan seem to be
+# announced a bit in advance. On 2012-07-11 the Moroccan government
+# announced that year's Ramadan daylight-saving transitions would be
+# 2012-07-20 and 2012-08-20; see
+# <http://www.mmsp.gov.ma/fr/actualites.aspx?id=288>.
+#
+# To estimate what the Moroccan government will do in future years,
+# transition dates for 2013 through 2021 were determined by running
+# the following program under GNU Emacs 24.3:
+#
+# (let ((islamic-year 1434))
+# (while (< islamic-year 1444)
+# (let ((a
+# (calendar-gregorian-from-absolute
+# (calendar-islamic-to-absolute (list 9 1 islamic-year))))
+# (b
+# (calendar-gregorian-from-absolute
+# (calendar-islamic-to-absolute (list 10 1 islamic-year)))))
+# (insert
+# (format
+# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 3:00\t0\t-\n"
+# "Rule\tMorocco\t%d\tonly\t-\t%s\t %2d\t 2:00\t1:00\tS\n")
+# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a))
+# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b)))))
+# (setq islamic-year (+ 1 islamic-year))))
+#
+# with the results hand-edited for 2020-2022, when the normal spring-forward
+# date falls during the estimated Ramadan.
+#
+# From 2023 through 2038 Ramadan is not predicted to overlap with
+# daylight saving time. Starting in 2039 there will be overlap again,
+# but 32-bit time_t values roll around in 2038 so for now do not worry
+# about dates after 2038.
+
# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Morocco 1939 only - Sep 12 0:00 1:00 S
@@ -858,10 +906,28 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S
Rule Morocco 2010 only - Aug 8 0:00 0 -
Rule Morocco 2011 only - Apr 3 0:00 1:00 S
Rule Morocco 2011 only - Jul 31 0 0 -
-Rule Morocco 2012 max - Apr lastSun 2:00 1:00 S
+Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S
Rule Morocco 2012 max - Sep lastSun 3:00 0 -
Rule Morocco 2012 only - Jul 20 3:00 0 -
Rule Morocco 2012 only - Aug 20 2:00 1:00 S
+Rule Morocco 2013 only - Jul 9 3:00 0 -
+Rule Morocco 2013 only - Aug 8 2:00 1:00 S
+Rule Morocco 2014 only - Jun 29 3:00 0 -
+Rule Morocco 2014 only - Jul 29 2:00 1:00 S
+Rule Morocco 2015 only - Jun 18 3:00 0 -
+Rule Morocco 2015 only - Jul 18 2:00 1:00 S
+Rule Morocco 2016 only - Jun 7 3:00 0 -
+Rule Morocco 2016 only - Jul 7 2:00 1:00 S
+Rule Morocco 2017 only - May 27 3:00 0 -
+Rule Morocco 2017 only - Jun 26 2:00 1:00 S
+Rule Morocco 2018 only - May 16 3:00 0 -
+Rule Morocco 2018 only - Jun 15 2:00 1:00 S
+Rule Morocco 2019 only - May 6 3:00 0 -
+Rule Morocco 2019 only - Jun 5 2:00 1:00 S
+Rule Morocco 2020 only - May 24 2:00 1:00 S
+Rule Morocco 2021 only - May 13 2:00 1:00 S
+Rule Morocco 2022 only - May 3 2:00 1:00 S
+Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26
diff --git a/contrib/tzdata/antarctica b/contrib/tzdata/antarctica
index f55cbde..d55924b 100644
--- a/contrib/tzdata/antarctica
+++ b/contrib/tzdata/antarctica
@@ -50,10 +50,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 -
Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 -
Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S
-Rule ChileAQ 2012 only - Apr Sun>=23 3:00u 0 -
-Rule ChileAQ 2012 only - Sep Sun>=2 4:00u 1:00 S
-Rule ChileAQ 2013 max - Mar Sun>=9 3:00u 0 -
-Rule ChileAQ 2013 max - Oct Sun>=9 4:00u 1:00 S
+Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 -
+Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
# These rules are stolen from the `australasia' file.
Rule AusAQ 1917 only - Jan 1 0:01 1:00 -
diff --git a/contrib/tzdata/asia b/contrib/tzdata/asia
index d5562c8..1f09fa3 100644
--- a/contrib/tzdata/asia
+++ b/contrib/tzdata/asia
@@ -6,7 +6,7 @@
# go ahead and edit the file (and please send any changes to
# tz@iana.org for general use in the future).
-# From Paul Eggert (2006-03-22):
+# From Paul Eggert (2013-02-21):
#
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
@@ -25,6 +25,10 @@
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
@@ -279,9 +283,12 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan
8:00 - BNT
# Burma / Myanmar
+
+# Milne says 6:24:40 was the meridian of the time ball observatory at Rangoon.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Rangoon 6:24:40 - LMT 1880 # or Yangon
- 6:24:36 - RMT 1920 # Rangoon Mean Time?
+ 6:24:40 - RMT 1920 # Rangoon Mean Time?
6:30 - BURT 1942 May # Burma Time
9:00 - JST 1945 May 3
6:30 - MMT # Myanmar Time
@@ -384,7 +391,8 @@ Zone Asia/Harbin 8:26:44 - LMT 1928 # or Haerbin
8:00 PRC C%sT
# Zhongyuan Time ("Central plain Time")
# most of China
-Zone Asia/Shanghai 8:05:52 - LMT 1928
+# Milne gives 8:05:56.7; round to nearest.
+Zone Asia/Shanghai 8:05:57 - LMT 1928
8:00 Shang C%sT 1949
8:00 PRC C%sT
# Long-shu Time (probably due to Long and Shu being two names of that area)
@@ -481,6 +489,10 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
8:00 PRC C%sT
+# Hong Kong (Xianggang)
+
+# Milne gives 7:36:41.7; round this.
+
# From Lee Yiu Chung (2009-10-24):
# I found there are some mistakes for the...DST rule for Hong
# Kong. [According] to the DST record from Hong Kong Observatory (actually,
@@ -547,7 +559,6 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar
# The Japanese surrender of Hong Kong was signed 1945-09-15.
# For lack of anything better, use start of those days as the transition times.
-# Hong Kong (Xianggang)
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule HK 1941 only - Apr 1 3:30 1:00 S
Rule HK 1941 only - Sep 30 3:30 0 -
@@ -569,7 +580,7 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S
Rule HK 1979 only - May Sun>=8 3:30 1:00 S
Rule HK 1979 only - Oct Sun>=16 3:30 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Hong_Kong 7:36:36 - LMT 1904 Oct 30
+Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30
8:00 HK HK%sT 1941 Dec 25
9:00 - JST 1945 Sep 15
8:00 HK HK%sT
@@ -646,6 +657,9 @@ Zone Asia/Macau 7:34:20 - LMT 1912
###############################################################################
# Cyprus
+#
+# Milne says the Eastern Telegraph Company used 2:14:00. Stick with LMT.
+#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
Rule Cyprus 1975 only - Oct 12 0:00 0 -
@@ -1804,8 +1818,11 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
5:45 - NPT # Nepal Time
# Oman
+
+# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Muscat 3:54:20 - LMT 1920
+Zone Asia/Muscat 3:54:24 - LMT 1920
4:00 - GST
# Pakistan
@@ -2400,6 +2417,13 @@ Zone Asia/Singapore 6:55:25 - LMT 1901 Jan 1
# no information
# Sri Lanka
+
+# From Paul Eggert (2013-02-21):
+# Milne says "Madras mean time use from May 1, 1898. Prior to this Colombo
+# mean time, 5h. 4m. 21.9s. F., was used." But 5:04:21.9 differs considerably
+# from Colombo's meridian 5:19:24, so for now ignore Milne and stick with
+# Shanks and Pottenger.
+
# From Paul Eggert (1996-09-03):
# "Sri Lanka advances clock by an hour to avoid blackout"
# (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24,
@@ -2699,6 +2723,12 @@ Zone Asia/Tashkent 4:37:12 - LMT 1924 May 2
# Vietnam
+# From Paul Eggert (2013-02-21):
+# Milne gives 7:16:56 for the meridian of Saigon in 1899, as being
+# used in Lower Laos, Cambodia, and Annam. But this is quite a ways
+# from Saigon's location. For now, ignore this and stick with Shanks
+# and Pottenger.
+
# From Arthur David Olson (2008-03-18):
# The English-language name of Vietnam's most populous city is "Ho Chi Min City";
# we use Ho_Chi_Minh below to avoid a name of more than 14 characters.
@@ -2712,6 +2742,10 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jun 9
7:00 - ICT
# Yemen
+
+# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
+# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Aden 3:00:48 - LMT 1950
+Zone Asia/Aden 2:59:54 - LMT 1950
3:00 - AST
diff --git a/contrib/tzdata/australasia b/contrib/tzdata/australasia
index bef6f20..58df73d 100644
--- a/contrib/tzdata/australasia
+++ b/contrib/tzdata/australasia
@@ -246,6 +246,9 @@ Zone Indian/Cocos 6:27:40 - LMT 1900
6:30 - CCT # Cocos Islands Time
# Fiji
+
+# Milne gives 11:55:44 for Suva.
+
# From Alexander Krivenyshev (2009-11-10):
# According to Fiji Broadcasting Corporation, Fiji plans to re-introduce DST
# from November 29th 2009 to April 25th 2010.
@@ -339,7 +342,7 @@ Rule Fiji 2010 max - Oct Sun>=18 2:00 1:00 S
Rule Fiji 2011 only - Mar Sun>=1 3:00 0 -
Rule Fiji 2012 max - Jan Sun>=18 3:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Pacific/Fiji 11:53:40 - LMT 1915 Oct 26 # Suva
+Zone Pacific/Fiji 11:55:44 - LMT 1915 Oct 26 # Suva
12:00 Fiji FJ%sT # Fiji Time
# French Polynesia
@@ -782,7 +785,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# go ahead and edit the file (and please send any changes to
# tz@iana.org for general use in the future).
-# From Paul Eggert (2006-03-22):
+# From Paul Eggert (2013-02-21):
# A good source for time zone historical data outside the U.S. is
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
@@ -800,6 +803,10 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
# I found in the UCLA library.
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# A reliable and entertaining source about time zones is
# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
#
diff --git a/contrib/tzdata/europe b/contrib/tzdata/europe
index ad9816c..5081a52 100644
--- a/contrib/tzdata/europe
+++ b/contrib/tzdata/europe
@@ -30,6 +30,12 @@
# William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03)
#
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>. He writes:
+# "It is requested that corrections and additions to these tables
+# may be sent to Mr. John Milne, Royal Geographical Society,
+# Savile Row, London." Nowadays please email them to tz@iana.org.
+#
# Brazil's Departamento Servico da Hora (DSH),
# <a href="http://pcdsh01.on.br/HISTHV.htm">
# History of Summer Time
@@ -666,6 +672,8 @@ Zone Europe/Andorra 0:06:04 - LMT 1901
# Austria
+# Milne says Vienna time was 1:05:21.
+
# From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and
# 1945-11-18, but the Austrian Federal Office of Metrology and
# Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged"
@@ -683,7 +691,7 @@ Rule Austria 1948 only - Apr 18 2:00s 1:00 S
Rule Austria 1980 only - Apr 6 0:00 1:00 S
Rule Austria 1980 only - Sep 28 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Europe/Vienna 1:05:20 - LMT 1893 Apr
+Zone Europe/Vienna 1:05:21 - LMT 1893 Apr
1:00 C-Eur CE%sT 1920
1:00 Austria CE%sT 1940 Apr 1 2:00s
1:00 C-Eur CE%sT 1945 Apr 2 2:00s
@@ -1239,6 +1247,21 @@ Zone Europe/Berlin 0:53:28 - LMT 1893 Apr
1:00 Germany CE%sT 1980
1:00 EU CE%sT
+# From Tobias Conradi (2011-09-12):
+# Busingen <http://www.buesingen.de>, surrounded by the Swiss canton
+# Schaffhausen, did not start observing DST in 1980 as the rest of DE
+# (West Germany at that time) and DD (East Germany at that time) did.
+# DD merged into DE, the area is currently covered by code DE in ISO 3166-1,
+# which in turn is covered by the zone Europe/Berlin.
+#
+# Source for the time in Busingen 1980:
+# http://www.srf.ch/player/video?id=c012c029-03b7-4c2b-9164-aa5902cd58d3
+
+# From Arthur David Olson (2012-03-03):
+# Busingen and Zurich have shared clocks since 1970.
+
+Link Europe/Zurich Europe/Busingen
+
# Georgia
# Please see the "asia" file for Asia/Tbilisi.
# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
@@ -2043,6 +2066,70 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
# Russia
+# From Alexander Krivenyshev (2011-09-15):
+# Based on last Russian Government Decree # 725 on August 31, 2011
+# (Government document
+# <a href="http://www.government.ru/gov/results/16355/print/">
+# http://www.government.ru/gov/results/16355/print/
+# </a>
+# in Russian)
+# there are few corrections have to be made for some Russian time zones...
+# All updated Russian Time Zones were placed in table and translated to English
+# by WorldTimeZone.com at the link below:
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia36.htm">
+# http://www.worldtimezone.com/dst_news/dst_news_russia36.htm
+# </a>
+
+# From Sanjeev Gupta (2011-09-27):
+# Scans of [Decree #23 of January 8, 1992] are available at:
+# <a href="http://government.consultant.ru/page.aspx?1223966">
+# http://government.consultant.ru/page.aspx?1223966
+# They are in Cyrillic letters (presumably Russian).
+
+# From Arthur David Olson (2012-05-09):
+# Regarding the instant when clocks in time-zone-shifting parts of Russia
+# changed in September 2011:
+#
+# One source is
+# < a href="http://government.ru/gov/results/16355/>
+# http://government.ru/gov/results/16355/
+# </a>
+# which, according to translate.google.com, begins "Decree of August 31,
+# 2011 No 725" and contains no other dates or "effective date" information.
+#
+# Another source is
+# <a href="http://www.rg.ru/2011/09/06/chas-zona-dok.html">
+# http://www.rg.ru/2011/09/06/chas-zona-dok.html
+# </a>
+# which, according to translate.google.com, begins "Resolution of the
+# Government of the Russian Federation on August 31, 2011 N 725" and also
+# contains "Date first official publication: September 6, 2011 Posted on:
+# in the 'RG' - Federal Issue number 5573 September 6, 2011" but which
+# does not contain any "effective date" information.
+#
+# Another source is
+# <a href="http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7">
+# http://en.wikipedia.org/wiki/Oymyakonsky_District#cite_note-RuTime-7
+# </a>
+# which, in note 8, contains "Resolution #725 of August 31, 2011...
+# Effective as of after 7 days following the day of the official publication"
+# but which does not contain any reference to September 6, 2011.
+#
+# The Wikipedia article refers to
+# <a href="http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896">
+# http://base.consultant.ru/cons/cgi/online.cgi?req=doc;base=LAW;n=118896
+# </a>
+# which seems to copy the text of the government.ru page.
+#
+# Tobias Conradi combines Wikipedia's
+# "as of after 7 days following the day of the official publication"
+# with www.rg.ru's "Date of first official publication: September 6, 2011" to get
+# September 13, 2011 as the cutover date (unusually, a Tuesday, as Tobias Conradi notes).
+#
+# None of the sources indicates a time of day for changing clocks.
+#
+# Go with 2011-09-13 0:00s.
+
# From Paul Eggert (2006-03-22):
# Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
@@ -2270,14 +2357,32 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15
# [parts of] Respublika Sakha (Yakutiya).
# From Oscar van Vlijmen (2009-11-29):
-# The Sakha districts are: Bulunskij, Verkhoyanskij, Tomponskij, Ust'-Majskij,
-# Ust'-Yanskij.
+# The Sakha districts are: Bulunskij, Verkhoyanskij, ... Ust'-Yanskij.
Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15
9:00 - VLAT 1930 Jun 21 # Vladivostok Time
10:00 Russia VLA%sT 1991 Mar 31 2:00s
9:00 Russia VLA%sST 1992 Jan 19 2:00s
10:00 Russia VLA%sT 2011 Mar 27 2:00s
11:00 - VLAT
+
+# From Arthur David Olson (2012-05-09):
+# Tomponskij and Ust'-Majskij switched from Vladivostok time to Yakutsk time
+# in 2011.
+#
+# From Paul Eggert (2012-11-25):
+# Shanks and Pottenger (2003) has Khandyga on Yakutsk time.
+# Make a wild guess that it switched to Vladivostok time in 2004.
+# This transition is no doubt wrong, but we have no better info.
+#
+Zone Asia/Khandyga 9:02:13 - LMT 1919 Dec 15
+ 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
+ 9:00 Russia YAK%sT 1991 Mar 31 2:00s
+ 8:00 Russia YAK%sT 1992 Jan 19 2:00s
+ 9:00 Russia YAK%sT 2004
+ 10:00 Russia VLA%sT 2011 Mar 27 2:00s
+ 11:00 - VLAT 2011 Sep 13 0:00s # Decree 725?
+ 10:00 - YAKT
+
#
# Sakhalinskaya oblast'.
# The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
@@ -2296,14 +2401,26 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23
# From Oscar van Vlijmen (2009-11-29):
# The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij,
-# Nizhnekolymskij, Ojmyakonskij, Srednekolymskij.
+# Nizhnekolymskij, ... Srednekolymskij.
Zone Asia/Magadan 10:03:12 - LMT 1924 May 2
10:00 - MAGT 1930 Jun 21 # Magadan Time
11:00 Russia MAG%sT 1991 Mar 31 2:00s
10:00 Russia MAG%sT 1992 Jan 19 2:00s
11:00 Russia MAG%sT 2011 Mar 27 2:00s
12:00 - MAGT
-#
+
+# From Arthur David Olson (2012-05-09):
+# Ojmyakonskij and the Kuril Islands switched from
+# Magadan time to Vladivostok time in 2011.
+Zone Asia/Ust-Nera 9:32:54 - LMT 1919 Dec 15
+ 8:00 - YAKT 1930 Jun 21 # Yakutsk Time
+ 9:00 Russia YAKT 1981 Apr 1
+ 11:00 Russia MAG%sT 1991 Mar 31 2:00s
+ 10:00 Russia MAG%sT 1992 Jan 19 2:00s
+ 11:00 Russia MAG%sT 2011 Mar 27 2:00s
+ 12:00 - MAGT 2011 Sep 13 0:00s # Decree 725?
+ 11:00 - VLAT
+
# From Oscar van Vlijmen (2001-08-25): [This region consists of]
# Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
#
diff --git a/contrib/tzdata/northamerica b/contrib/tzdata/northamerica
index 772d7a4..1964903 100644
--- a/contrib/tzdata/northamerica
+++ b/contrib/tzdata/northamerica
@@ -1019,6 +1019,9 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# William Willett, The Waste of Daylight, 19th edition
# </a> (1914-03)
#
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# See the `europe' file for Greenland.
# Canada
@@ -2554,6 +2557,8 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
# Bahamas
#
+# For 1899 Milne gives -5:09:29.5; round that.
+#
# From Sue Williams (2006-12-07):
# The Bahamas announced about a month ago that they plan to change their DST
# rules to sync with the U.S. starting in 2007....
@@ -2563,11 +2568,14 @@ Zone America/Antigua -4:07:12 - LMT 1912 Mar 2
Rule Bahamas 1964 1975 - Oct lastSun 2:00 0 S
Rule Bahamas 1964 1975 - Apr lastSun 2:00 1:00 D
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Nassau -5:09:24 - LMT 1912 Mar 2
+Zone America/Nassau -5:09:30 - LMT 1912 Mar 2
-5:00 Bahamas E%sT 1976
-5:00 US E%sT
# Barbados
+
+# For 1899 Milne gives -3:58:29.2; round that.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Barb 1977 only - Jun 12 2:00 1:00 D
Rule Barb 1977 1978 - Oct Sun>=1 2:00 0 S
@@ -2575,8 +2583,8 @@ Rule Barb 1978 1980 - Apr Sun>=15 2:00 1:00 D
Rule Barb 1979 only - Sep 30 2:00 0 S
Rule Barb 1980 only - Sep 25 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Barbados -3:58:28 - LMT 1924 # Bridgetown
- -3:58:28 - BMT 1932 # Bridgetown Mean Time
+Zone America/Barbados -3:58:29 - LMT 1924 # Bridgetown
+ -3:58:29 - BMT 1932 # Bridgetown Mean Time
-4:00 Barb A%sT
# Belize
@@ -2594,6 +2602,9 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# Bermuda
+# For 1899 Milne gives -4:19:18.3 as the meridian of the clock tower,
+# Bermuda dockyard, Ireland I; round that.
+
# From Dan Jones, reporting in The Royal Gazette (2006-06-26):
# Next year, however, clocks in the US will go forward on the second Sunday
@@ -2603,7 +2614,7 @@ Zone America/Belize -5:52:48 - LMT 1912 Apr
# http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Atlantic/Bermuda -4:19:04 - LMT 1930 Jan 1 2:00 # Hamilton
+Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton
-4:00 - AST 1974 Apr 28 2:00
-4:00 Bahamas A%sT 1976
-4:00 US A%sT
@@ -2615,6 +2626,9 @@ Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown
-5:00 - EST
# Costa Rica
+
+# Milne gives -5:36:13.3 as San Jose mean time; round to nearest.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CR 1979 1980 - Feb lastSun 0:00 1:00 D
Rule CR 1979 1980 - Jun Sun>=1 0:00 0 S
@@ -2625,14 +2639,19 @@ Rule CR 1991 only - Jul 1 0:00 0 S
Rule CR 1992 only - Mar 15 0:00 0 S
# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Costa_Rica -5:36:20 - LMT 1890 # San Jose
- -5:36:20 - SJMT 1921 Jan 15 # San Jose Mean Time
+Zone America/Costa_Rica -5:36:13 - LMT 1890 # San Jose
+ -5:36:13 - SJMT 1921 Jan 15 # San Jose Mean Time
-6:00 CR C%sT
# Coco
# no information; probably like America/Costa_Rica
# Cuba
+# From Paul Eggert (2013-02-21):
+# Milne gives -5:28:50.45 for the observatory at Havana, -5:29:23.57
+# for the port, and -5:30 for meteorological observations.
+# For now, stick with Shanks & Pottenger.
+
# From Arthur David Olson (1999-03-29):
# The 1999-03-28 exhibition baseball game held in Havana, Cuba, between
# the Cuban National Team and the Baltimore Orioles was carried live on
@@ -2981,24 +3000,21 @@ Zone America/Guatemala -6:02:04 - LMT 1918 Oct 5
# apparently using the same start and end date as USA/Canada.
# So this means they have already changed their time.
#
-# (Sources in French):
-# <a href="http://www.alterpresse.org/spip.php?article12510">
# http://www.alterpresse.org/spip.php?article12510
-# </a>
-# <a href="http://radiovision2000haiti.net/home/?p=13253">
# http://radiovision2000haiti.net/home/?p=13253
-# </a>
#
-# Our coverage:
-# <a href="http://www.timeanddate.com/news/time/haiti-dst-2012.html">
-# http://www.timeanddate.com/news/time/haiti-dst-2012.html
-# </a>
-
# From Arthur David Olson (2012-03-11):
# The alterpresse.org source seems to show a US-style leap from 2:00 a.m. to
# 3:00 a.m. rather than the traditional Haitian jump at midnight.
-# Assume a US-style fall back as well XXX.
-# Do not yet assume that the change carries forward past 2012 XXX.
+# Assume a US-style fall back as well.
+
+# From Steffen Thorsen (2013-03-10):
+# It appears that Haiti is observing DST this year as well, same rules
+# as US/Canada. They did it last year as well, and it looks like they
+# are going to observe DST every year now...
+#
+# http://radiovision2000haiti.net/public/haiti-avis-changement-dheure-dimanche/
+# http://www.canalplushaiti.net/?p=6714
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Haiti 1983 only - May 8 0:00 1:00 D
@@ -3010,8 +3026,8 @@ Rule Haiti 1988 1997 - Apr Sun>=1 1:00s 1:00 D
Rule Haiti 1988 1997 - Oct lastSun 1:00s 0 S
Rule Haiti 2005 2006 - Apr Sun>=1 0:00 1:00 D
Rule Haiti 2005 2006 - Oct lastSun 0:00 0 S
-Rule Haiti 2012 only - Mar Sun>=8 2:00 1:00 D
-Rule Haiti 2012 only - Nov Sun>=1 2:00 0 S
+Rule Haiti 2012 max - Mar Sun>=8 2:00 1:00 D
+Rule Haiti 2012 max - Nov Sun>=1 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Port-au-Prince -4:49:20 - LMT 1890
-4:49 - PPMT 1917 Jan 24 12:00 # P-a-P MT
diff --git a/contrib/tzdata/southamerica b/contrib/tzdata/southamerica
index 3301a43..9ef8b82 100644
--- a/contrib/tzdata/southamerica
+++ b/contrib/tzdata/southamerica
@@ -11,6 +11,10 @@
# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
# San Diego: ACS Publications, Inc. (2003).
#
+# For data circa 1899, a common source is:
+# Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
+# <http://www.jstor.org/stable/1774359>.
+#
# Gwillim Law writes that a good source
# for recent time zone data is the International Air Transport
# Association's Standard Schedules Information Manual (IATA SSIM),
@@ -381,21 +385,11 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# <a/>
# is the official page for the Province Government).
#
-# There's also a note in only one of the major national papers (La Nación) at
-# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
+# There's also a note in only one of the major national papers ...
# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
-# </a>
-#
-# The press release says:
-# (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
-# atrasar una hora sus relojes.
#
-# A partir de entonces, San Luis establecerá el huso horario propio de
-# la Provincia. De esta manera, durante el periodo del calendario anual
-# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
-# domingo de marzo y las 24:00 del segundo sábado de octubre.
-# Quick&dirty translation
-# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
+# The press release says [quick and dirty translation]:
+# ... announced that next Sunday, at 00:00, Puntanos (the San Luis
# inhabitants) will have to turn back one hour their clocks
#
# Since then, San Luis will establish its own Province timezone. Thus,
@@ -457,6 +451,9 @@ Rule Arg 2008 only - Oct Sun>=15 0:00 1:00 S
# rules...San Luis is still using "Western ARgentina Time" and it got
# stuck on Summer daylight savings time even though the summer is over.
+# From Paul Eggert (2013-02-21):
+# Milne says Cordoba time was -4:16:48.2. Round to the nearest second.
+
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
#
# Buenos Aires (BA), Capital Federal (CF),
@@ -812,9 +809,9 @@ Zone America/La_Paz -4:32:36 - LMT 1890
# From Guilherme Bernardes Rodrigues (2011-10-07):
# There is news in the media, however there is still no decree about it.
-# I just send a e-mail to Zulmira Brandão at
+# I just send a e-mail to Zulmira Brandao at
# <a href="http://pcdsh01.on.br/">http://pcdsh01.on.br/</a> the
-# oficial agency about time in Brazil, and she confirmed that the old rule is
+# official agency about time in Brazil, and she confirmed that the old rule is
# still in force.
# From Guilherme Bernardes Rodrigues (2011-10-14)
@@ -1243,9 +1240,13 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# b. Saturday, September 1, 2012, clocks should go forward 60 minutes; that is,
# at 23:59:59, instead of passing to 0:00, the time should be adjusted to be
# 01:00 on September 2.
-#
-# Note that...this is yet another "temporary" change that will be reevaluated
-# AGAIN in 2013.
+
+# From Steffen Thorsen (2013-02-15):
+# According to several news sources, Chile has extended DST this year,
+# they will end DST later and start DST earlier than planned. They
+# hope to save energy. The new end date is 2013-04-28 00:00 and new
+# start date is 2013-09-08 00:00....
+# http://www.gob.cl/informa/2013/02/15/gobierno-anuncia-fechas-de-cambio-de-hora-para-el-ano-2013.htm
# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
# 'antarctica' file.
@@ -1288,10 +1289,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr Sun>=1 3:00u 0 -
Rule Chile 2011 only - May Sun>=2 3:00u 0 -
Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
-Rule Chile 2012 only - Apr Sun>=23 3:00u 0 -
-Rule Chile 2012 only - Sep Sun>=2 4:00u 1:00 S
-Rule Chile 2013 max - Mar Sun>=9 3:00u 0 -
-Rule Chile 2013 max - Oct Sun>=9 4:00u 1:00 S
+Rule Chile 2012 max - Apr Sun>=23 3:00u 0 -
+Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1313,17 +1312,23 @@ Zone Pacific/Easter -7:17:44 - LMT 1890
# San Felix, and Antarctic bases, are like America/Santiago.
# Colombia
+
+# Milne gives 4:56:16.4 for Bogota time in 1899; round to nearest. He writes,
+# "A variation of fifteen minutes in the public clocks of Bogota is not rare."
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule CO 1992 only - May 3 0:00 1:00 S
Rule CO 1993 only - Apr 4 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Bogota -4:56:20 - LMT 1884 Mar 13
- -4:56:20 - BMT 1914 Nov 23 # Bogota Mean Time
+Zone America/Bogota -4:56:16 - LMT 1884 Mar 13
+ -4:56:16 - BMT 1914 Nov 23 # Bogota Mean Time
-5:00 CO CO%sT # Colombia Time
# Malpelo, Providencia, San Andres
# no information; probably like America/Bogota
# Curacao
+
+# Milne gives 4:35:46.9 for Curacao mean time; round to nearest.
#
# From Paul Eggert (2006-03-22):
# Shanks & Pottenger say that The Bottom and Philipsburg have been at
@@ -1340,7 +1345,7 @@ Zone America/Bogota -4:56:20 - LMT 1884 Mar 13
# though, as far as we know.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone America/Curacao -4:35:44 - LMT 1912 Feb 12 # Willemstad
+Zone America/Curacao -4:35:47 - LMT 1912 Feb 12 # Willemstad
-4:30 - ANT 1965 # Netherlands Antilles Time
-4:00 - AST
@@ -1354,6 +1359,8 @@ Link America/Curacao America/Kralendijk # Bonaire, Sint Estatius and Saba
# Ecuador
#
+# Milne says the Sentral and South American Telegraph Company used -5:24:15.
+#
# From Paul Eggert (2007-03-04):
# Apparently Ecuador had a failed experiment with DST in 1992.
# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
@@ -1560,6 +1567,15 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 -
# ...
Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S
Rule Para 2010 max - Apr Sun>=8 0:00 0 -
+#
+# From Steffen Thorsen (2013-03-07):
+# Paraguay will end DST on 2013-03-24 00:00....
+# They do not tell if this will be a permanent change or just this year....
+# http://www.ande.gov.py/interna.php?id=1075
+#
+# From Paul Eggert (2013-03-07):
+# For now, assume it's just this year.
+Rule Para 2013 only - Mar 24 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone America/Asuncion -3:50:40 - LMT 1890
diff --git a/contrib/tzdata/zone.tab b/contrib/tzdata/zone.tab
index 97e3ea6..fd05b9c 100644
--- a/contrib/tzdata/zone.tab
+++ b/contrib/tzdata/zone.tab
@@ -159,7 +159,8 @@ CW +1211-06900 America/Curacao
CX -1025+10543 Indian/Christmas
CY +3510+03322 Asia/Nicosia
CZ +5005+01426 Europe/Prague
-DE +5230+01322 Europe/Berlin
+DE +5230+01322 Europe/Berlin most locations
+DE +4742+00841 Europe/Busingen Busingen
DJ +1136+04309 Africa/Djibouti
DK +5540+01235 Europe/Copenhagen
DM +1518-06124 America/Dominica
@@ -341,8 +342,10 @@ RU +5345+08707 Asia/Novokuznetsk Moscow+03 - Novokuznetsk
RU +5601+09250 Asia/Krasnoyarsk Moscow+04 - Yenisei River
RU +5216+10420 Asia/Irkutsk Moscow+05 - Lake Baikal
RU +6200+12940 Asia/Yakutsk Moscow+06 - Lena River
+RU +623923+1353314 Asia/Khandyga Moscow+06 - Tomponsky, Ust-Maysky
RU +4310+13156 Asia/Vladivostok Moscow+07 - Amur River
RU +4658+14242 Asia/Sakhalin Moscow+07 - Sakhalin Island
+RU +643337+1431336 Asia/Ust-Nera Moscow+07 - Oymyakonsky
RU +5934+15048 Asia/Magadan Moscow+08 - Magadan
RU +5301+15839 Asia/Kamchatka Moscow+08 - Kamchatka
RU +6445+17729 Asia/Anadyr Moscow+08 - Bering Sea
diff --git a/contrib/unvis/Makefile b/contrib/unvis/Makefile
new file mode 100644
index 0000000..677e61d
--- /dev/null
+++ b/contrib/unvis/Makefile
@@ -0,0 +1,6 @@
+# $NetBSD: Makefile,v 1.3 1994/12/06 07:36:07 jtc Exp $
+# @(#)Makefile 8.1 (Berkeley) 6/6/93
+
+PROG= unvis
+
+.include <bsd.prog.mk>
diff --git a/usr.bin/unvis/unvis.1 b/contrib/unvis/unvis.1
index e40d8df..5c84671 100644
--- a/usr.bin/unvis/unvis.1
+++ b/contrib/unvis/unvis.1
@@ -1,3 +1,5 @@
+.\" $NetBSD: unvis.1,v 1.10 2012/12/15 02:08:13 uwe Exp $
+.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -9,7 +11,7 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
+.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
@@ -26,9 +28,8 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)unvis.1 8.1 (Berkeley) 6/6/93
-.\" $FreeBSD$
.\"
-.Dd June 6, 1993
+.Dd November 27, 2010
.Dt UNVIS 1
.Os
.Sh NAME
@@ -36,14 +37,38 @@
.Nd "revert a visual representation of data back to original form"
.Sh SYNOPSIS
.Nm
-.Op Ar
+.Op Fl e
+.Op Fl Hh | Fl m
+.Op Ar file ...
.Sh DESCRIPTION
-The
.Nm
-utility is the inverse function of
+is the inverse function of
.Xr vis 1 .
It reverts
a visual representation of data back to its original form on standard output.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl e
+Don't decode \e escaped sequences.
+.It Fl H
+Decode entity references and numeric character references from RFC 1866.
+.Pq Dv VIS_HTTP1866
+.It Fl h
+Decode using the URI encoding from RFC 1808.
+.Pq Dv VIS_HTTP1808
+.It Fl m
+Decode using mime style.
+.Pq Dv VIS_MIMESTYLE
+.El
+.Pp
+Mixing
+.Fl h
+or
+.Fl H
+with
+.Fl m
+is not supported.
.Sh SEE ALSO
.Xr vis 1 ,
.Xr unvis 3 ,
@@ -51,5 +76,5 @@ a visual representation of data back to its original form on standard output.
.Sh HISTORY
The
.Nm
-command appeared in
+command appears in
.Bx 4.4 .
diff --git a/usr.bin/unvis/unvis.c b/contrib/unvis/unvis.c
index 0ae054b..d854a37 100644
--- a/usr.bin/unvis/unvis.c
+++ b/contrib/unvis/unvis.c
@@ -1,3 +1,5 @@
+/* $NetBSD: unvis.c,v 1.13 2010/11/27 19:46:25 christos Exp $ */
+
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -10,7 +12,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -27,18 +29,17 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static const char copyright[] =
-"@(#) Copyright (c) 1989, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
+__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
+ The Regents of the University of California. All rights reserved.");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] =
- "$FreeBSD$";
+__RCSID("$NetBSD: unvis.c,v 1.13 2010/11/27 19:46:25 christos Exp $");
#endif /* not lint */
#include <err.h>
@@ -47,46 +48,64 @@ static const char rcsid[] =
#include <unistd.h>
#include <vis.h>
-void process(FILE *, const char *);
-static void usage(void);
+static void process(FILE *, const char *, int);
int
main(int argc, char *argv[])
{
FILE *fp;
- int ch;
+ int ch, eflags = 0;
- while ((ch = getopt(argc, argv, "")) != -1)
+ setprogname(argv[0]);
+ while ((ch = getopt(argc, argv, "eHhm")) != -1)
switch((char)ch) {
+ case 'e':
+ eflags |= VIS_NOESCAPE;
+ break;
+ case 'H':
+ eflags |= VIS_HTTP1866;
+ break;
+ case 'h':
+ eflags |= VIS_HTTP1808;
+ break;
+ case 'm':
+ eflags |= VIS_MIMESTYLE;
+ break;
case '?':
default:
- usage();
+ (void)fprintf(stderr,
+ "Usage: %s [-e] [-Hh | -m] [file...]\n",
+ getprogname());
+ return EXIT_FAILURE;
}
argc -= optind;
argv += optind;
+ switch (eflags & (VIS_HTTP1808|VIS_HTTP1866|VIS_MIMESTYLE)) {
+ case VIS_HTTP1808|VIS_MIMESTYLE:
+ case VIS_HTTP1866|VIS_MIMESTYLE:
+ case VIS_HTTP1808|VIS_HTTP1866|VIS_MIMESTYLE:
+ errx(EXIT_FAILURE, "Can't mix -m with -h and/or -H");
+ /*NOTREACHED*/
+ default:
+ break;
+ }
+
if (*argv)
while (*argv) {
- if ((fp=fopen(*argv, "r")) != NULL)
- process(fp, *argv);
+ if ((fp = fopen(*argv, "r")) != NULL)
+ process(fp, *argv, eflags);
else
warn("%s", *argv);
argv++;
}
else
- process(stdin, "<stdin>");
- exit(0);
+ process(stdin, "<stdin>", eflags);
+ return EXIT_SUCCESS;
}
static void
-usage(void)
-{
- fprintf(stderr, "usage: unvis [file ...]\n");
- exit(1);
-}
-
-void
-process(FILE *fp, const char *filename)
+process(FILE *fp, const char *filename, int eflags)
{
int offset = 0, c, ret;
int state = 0;
@@ -95,12 +114,12 @@ process(FILE *fp, const char *filename)
while ((c = getc(fp)) != EOF) {
offset++;
again:
- switch(ret = unvis(&outc, (char)c, &state, 0)) {
+ switch(ret = unvis(&outc, (char)c, &state, eflags)) {
case UNVIS_VALID:
- putchar(outc);
+ (void)putchar(outc);
break;
case UNVIS_VALIDPUSH:
- putchar(outc);
+ (void)putchar(outc);
goto again;
case UNVIS_SYNBAD:
warnx("%s: offset: %d: can't decode", filename, offset);
@@ -111,8 +130,9 @@ process(FILE *fp, const char *filename)
break;
default:
errx(1, "bad return value (%d), can't happen", ret);
+ /* NOTREACHED */
}
}
- if (unvis(&outc, (char)0, &state, UNVIS_END) == UNVIS_VALID)
- putchar(outc);
+ if (unvis(&outc, (char)0, &state, eflags | UNVIS_END) == UNVIS_VALID)
+ (void)putchar(outc);
}
diff --git a/contrib/vis/Makefile b/contrib/vis/Makefile
new file mode 100644
index 0000000..696b62a
--- /dev/null
+++ b/contrib/vis/Makefile
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile,v 1.3 1994/11/17 07:55:57 jtc Exp $
+# @(#)Makefile 8.1 (Berkeley) 6/6/93
+
+PROG= vis
+SRCS= vis.c foldit.c
+
+.include <bsd.prog.mk>
diff --git a/contrib/vis/extern.h b/contrib/vis/extern.h
new file mode 100644
index 0000000..49b6f15
--- /dev/null
+++ b/contrib/vis/extern.h
@@ -0,0 +1,39 @@
+/* $NetBSD: extern.h,v 1.1 2009/02/10 23:06:31 christos Exp $ */
+
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+int foldit(const char *, int, int, int);
diff --git a/usr.bin/vis/foldit.c b/contrib/vis/foldit.c
index b3cbec3..789b14c 100644
--- a/usr.bin/vis/foldit.c
+++ b/contrib/vis/foldit.c
@@ -1,3 +1,5 @@
+/* $NetBSD: foldit.c,v 1.7 2009/02/10 23:06:31 christos Exp $ */
+
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -10,7 +12,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -28,21 +30,21 @@
*/
#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
#ifndef lint
-static const char sccsid[] = "@(#)foldit.c 8.1 (Berkeley) 6/6/93";
+#if 0
+static char sccsid[] = "@(#)foldit.c 8.1 (Berkeley) 6/6/93";
#endif
+__RCSID("$NetBSD: foldit.c,v 1.7 2009/02/10 23:06:31 christos Exp $");
+#endif /* not lint */
#include <stdio.h>
-
+#include <vis.h>
#include "extern.h"
int
-foldit(char *chunk, int col, int max)
+foldit(const char *chunk, int col, int max, int flags)
{
- char *cp;
+ const char *cp;
/*
* Keep track of column position. Insert hidden newline
@@ -66,10 +68,10 @@ again:
col++;
}
if (col > (max - 2)) {
- printf("\\\n");
+ printf(flags & VIS_MIMESTYLE ? "=\n" : "\\\n");
col = 0;
goto again;
- }
+ }
cp++;
}
return (col);
diff --git a/usr.bin/vis/vis.1 b/contrib/vis/vis.1
index 7851218..1b0b5edf 100644
--- a/usr.bin/vis/vis.1
+++ b/contrib/vis/vis.1
@@ -1,3 +1,5 @@
+.\" $NetBSD: vis.1,v 1.17 2013/02/14 14:00:00 christos Exp $
+.\"
.\" Copyright (c) 1989, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -9,7 +11,7 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 4. Neither the name of the University nor the names of its contributors
+.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
@@ -26,9 +28,8 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)vis.1 8.4 (Berkeley) 4/19/94
-.\" $FreeBSD$
.\"
-.Dd June 25, 2004
+.Dd February 13, 2013
.Dt VIS 1
.Os
.Sh NAME
@@ -36,13 +37,13 @@
.Nd display non-printable characters in a visual format
.Sh SYNOPSIS
.Nm
-.Op Fl cbflnostw
+.Op Fl bcfhlmnostw
+.Op Fl e Ar extra
.Op Fl F Ar foldwidth
-.Op Ar
+.Op Ar file ...
.Sh DESCRIPTION
-The
.Nm
-utility is a filter for converting non-printable characters
+is a filter for converting non-printable characters
into a visual representation.
It differs from
.Ql cat -v
@@ -55,7 +56,7 @@ various visual formats is given in
.Xr vis 3 .
.Pp
The options are as follows:
-.Bl -tag -width indent
+.Bl -tag -width Ds
.It Fl b
Turns off prepending of backslash before up-arrow control sequences
and meta characters, and disables the doubling of backslashes.
@@ -64,32 +65,43 @@ produces output which is neither invertible or precise, but does
represent a minimum of change to the input.
It is similar to
.Dq Li cat -v .
+.Pq Dv VIS_NOSLASH
.It Fl c
Request a format which displays a small subset of the
non-printable characters using C-style backslash sequences.
-.It Fl F
+.Pq Dv VIS_CSTYLE
+.It Fl e Ar extra
+Also encode characters in
+.Ar extra ,
+per
+.Xr svis 3 .
+.It Fl F Ar foldwidth
Causes
.Nm
-to fold output lines to
-.Ar foldwidth
-columns (default 80), like
+to fold output lines to foldwidth columns (default 80), like
.Xr fold 1 ,
except
-that a hidden newline sequence is used (which is removed
+that a hidden newline sequence is used, (which is removed
when inverting the file back to its original form with
.Xr unvis 1 ) .
If the last character in the encoded file does not end in a newline,
a hidden newline sequence is appended to the output.
This makes
the output usable with various editors and other utilities which
-typically do not work with partial lines.
+typically don't work with partial lines.
.It Fl f
Same as
.Fl F .
+.It Fl h
+Encode using the URI encoding from RFC 1808.
+.Pq Dv VIS_HTTPSTYLE
.It Fl l
Mark newlines with the visible sequence
.Ql \e$ ,
followed by the newline.
+.It Fl m
+Encode using the MIME Quoted-Printable encoding from RFC 2045.
+.Pq Dv VIS_MIMESTYLE
.It Fl n
Turns off any encoding, except for the fact that backslashes are
still doubled and hidden newline sequences inserted if
@@ -105,34 +117,53 @@ becomes like
an invertible version of the
.Xr fold 1
utility.
-That is, the output
-can be unfolded by running the output through
+That is, the output can be unfolded by running the output through
.Xr unvis 1 .
.It Fl o
Request a format which displays non-printable characters as
an octal number, \eddd.
+.Pq Dv VIS_OCTAL
.It Fl s
Only characters considered unsafe to send to a terminal are encoded.
This flag allows backspace, bell, and carriage return in addition
to the default space, tab and newline.
+.Pq Dv VIS_SAFE
.It Fl t
Tabs are also encoded.
+.Pq Dv VIS_TAB
.It Fl w
White space (space-tab-newline) is also encoded.
+.Pq Dv VIS_WHITE
.El
+.Sh MULTIBYTE CHARACTER SUPPORT
+.Nm
+supports multibyte character input.
+The encoding conversion is influenced by the setting of the
+.Ev LC_CTYPE
+environment variable which defines the set of characters that can be
+copied without encoding.
+.Pp
+When 8-bit data is present in the input,
+.Ev LC_CTYPE
+must be set to the correct locale or to the C locale.
+If the locales of the data and the conversion are mismatched, multibyte
+character recognition may fail and encoding will be performed byte-by-byte
+instead.
+.Sh ENVIRONMENT
+.Bl -tag -width ".Ev LC_CTYPE"
+.It Ev LC_CTYPE
+Specify the locale of the input data.
+Set to C if the input data locale is unknown.
.Sh SEE ALSO
.Xr unvis 1 ,
+.Xr svis 3 ,
.Xr vis 3
.Sh HISTORY
The
.Nm
-command appeared in
+command appears in
.Bx 4.4 .
-.Sh BUGS
-Due to limitations in the underlying
-.Xr vis 3
-function, the
-.Nm
-utility
-does not recognize multibyte characters, and thus may consider them to be
-non-printable when they are in fact printable (and vice versa).
+Myltibyte character support was added in
+.Nx 6.1
+and
+.Fx 9.2 .
diff --git a/contrib/vis/vis.c b/contrib/vis/vis.c
new file mode 100644
index 0000000..1509c81
--- /dev/null
+++ b/contrib/vis/vis.c
@@ -0,0 +1,276 @@
+/* $NetBSD: vis.c,v 1.22 2013/02/20 17:04:45 christos Exp $ */
+
+/*-
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#ifndef lint
+__COPYRIGHT("@(#) Copyright (c) 1989, 1993\
+ The Regents of the University of California. All rights reserved.");
+#endif /* not lint */
+
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)vis.c 8.1 (Berkeley) 6/6/93";
+#endif
+__RCSID("$NetBSD: vis.c,v 1.22 2013/02/20 17:04:45 christos Exp $");
+#endif /* not lint */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <wchar.h>
+#include <limits.h>
+#include <unistd.h>
+#include <err.h>
+#include <vis.h>
+
+#include "extern.h"
+
+static int eflags, fold, foldwidth = 80, none, markeol;
+#ifdef DEBUG
+int debug;
+#endif
+static const char *extra = "";
+
+static void process(FILE *);
+
+int
+main(int argc, char *argv[])
+{
+ FILE *fp;
+ int ch;
+ int rval;
+
+ while ((ch = getopt(argc, argv, "bcde:F:fhlmnostw")) != -1)
+ switch((char)ch) {
+ case 'b':
+ eflags |= VIS_NOSLASH;
+ break;
+ case 'c':
+ eflags |= VIS_CSTYLE;
+ break;
+#ifdef DEBUG
+ case 'd':
+ debug++;
+ break;
+#endif
+ case 'e':
+ extra = optarg;
+ break;
+ case 'F':
+ if ((foldwidth = atoi(optarg)) < 5) {
+ errx(1, "can't fold lines to less than 5 cols");
+ /* NOTREACHED */
+ }
+ markeol++;
+ break;
+ case 'f':
+ fold++; /* fold output lines to 80 cols */
+ break; /* using hidden newline */
+ case 'h':
+ eflags |= VIS_HTTPSTYLE;
+ break;
+ case 'l':
+ markeol++; /* mark end of line with \$ */
+ break;
+ case 'm':
+ eflags |= VIS_MIMESTYLE;
+ if (foldwidth == 80)
+ foldwidth = 76;
+ break;
+ case 'n':
+ none++;
+ break;
+ case 'o':
+ eflags |= VIS_OCTAL;
+ break;
+ case 's':
+ eflags |= VIS_SAFE;
+ break;
+ case 't':
+ eflags |= VIS_TAB;
+ break;
+ case 'w':
+ eflags |= VIS_WHITE;
+ break;
+ case '?':
+ default:
+ (void)fprintf(stderr,
+ "Usage: %s [-bcfhlmnostw] [-e extra]"
+ " [-F foldwidth] [file ...]\n", getprogname());
+ return 1;
+ }
+
+ if ((eflags & (VIS_HTTPSTYLE|VIS_MIMESTYLE)) ==
+ (VIS_HTTPSTYLE|VIS_MIMESTYLE))
+ errx(1, "Can't specify -m and -h at the same time");
+
+ argc -= optind;
+ argv += optind;
+
+ rval = 0;
+
+ if (*argv)
+ while (*argv) {
+ if ((fp = fopen(*argv, "r")) != NULL) {
+ process(fp);
+ (void)fclose(fp);
+ } else {
+ warn("%s", *argv);
+ rval = 1;
+ }
+ argv++;
+ }
+ else
+ process(stdin);
+ return rval;
+}
+
+static void
+process(FILE *fp)
+{
+ static int col = 0;
+ static char nul[] = "\0";
+ char *cp = nul + 1; /* so *(cp-1) starts out != '\n' */
+ wint_t c, c1, rachar;
+ char mbibuff[2 * MB_LEN_MAX + 1]; /* max space for 2 wchars */
+ char buff[4 * MB_LEN_MAX + 1]; /* max encoding length for one char */
+ int mbilen, cerr = 0, raerr = 0;
+
+ /*
+ * The input stream is considered to be multibyte characters.
+ * The input loop will read this data inputing one character,
+ * possibly multiple bytes, at a time and converting each to
+ * a wide character wchar_t.
+ *
+ * The vis(3) functions, however, require single either bytes
+ * or a multibyte string as their arguments. So we convert
+ * our input wchar_t and the following look-ahead wchar_t to
+ * a multibyte string for processing by vis(3).
+ */
+
+ /* Read one multibyte character, store as wchar_t */
+ c = getwc(fp);
+ if (c == WEOF && errno == EILSEQ) {
+ /* Error in multibyte data. Read one byte. */
+ c = (wint_t)getc(fp);
+ cerr = 1;
+ }
+ while (c != WEOF) {
+ /* Clear multibyte input buffer. */
+ memset(mbibuff, 0, sizeof(mbibuff));
+ /* Read-ahead next multibyte character. */
+ if (!cerr)
+ rachar = getwc(fp);
+ if (cerr || (rachar == WEOF && errno == EILSEQ)) {
+ /* Error in multibyte data. Read one byte. */
+ rachar = (wint_t)getc(fp);
+ raerr = 1;
+ }
+ if (none) {
+ /* Handle -n flag. */
+ cp = buff;
+ *cp++ = c;
+ if (c == '\\')
+ *cp++ = '\\';
+ *cp = '\0';
+ } else if (markeol && c == '\n') {
+ /* Handle -l flag. */
+ cp = buff;
+ if ((eflags & VIS_NOSLASH) == 0)
+ *cp++ = '\\';
+ *cp++ = '$';
+ *cp++ = '\n';
+ *cp = '\0';
+ } else {
+ /*
+ * Convert character using vis(3) library.
+ * At this point we will process one character.
+ * But we must pass the vis(3) library this
+ * character plus the next one because the next
+ * one is used as a look-ahead to decide how to
+ * encode this one under certain circumstances.
+ *
+ * Since our characters may be multibyte, e.g.,
+ * in the UTF-8 locale, we cannot use vis() and
+ * svis() which require byte input, so we must
+ * create a multibyte string and use strvisx().
+ */
+ /* Treat EOF as a NUL char. */
+ c1 = rachar;
+ if (c1 == WEOF)
+ c1 = L'\0';
+ /*
+ * If we hit a multibyte conversion error above,
+ * insert byte directly into string buff because
+ * wctomb() will fail. Else convert wchar_t to
+ * multibyte using wctomb().
+ */
+ if (cerr) {
+ *mbibuff = (char)c;
+ mbilen = 1;
+ } else
+ mbilen = wctomb(mbibuff, c);
+ /* Same for look-ahead character. */
+ if (raerr)
+ mbibuff[mbilen] = (char)c1;
+ else
+ wctomb(mbibuff + mbilen, c1);
+ /* Perform encoding on just first character. */
+ (void) strsenvisx(buff, 4 * MB_LEN_MAX, mbibuff,
+ 1, eflags, extra, &cerr);
+ }
+
+ cp = buff;
+ if (fold) {
+#ifdef DEBUG
+ if (debug)
+ (void)printf("<%02d,", col);
+#endif
+ col = foldit(cp, col, foldwidth, eflags);
+#ifdef DEBUG
+ if (debug)
+ (void)printf("%02d>", col);
+#endif
+ }
+ do {
+ (void)putchar(*cp);
+ } while (*++cp);
+ c = rachar;
+ cerr = raerr;
+ }
+ /*
+ * terminate partial line with a hidden newline
+ */
+ if (fold && *(cp - 1) != '\n')
+ (void)printf(eflags & VIS_MIMESTYLE ? "=\n" : "\\\n");
+}
diff --git a/crypto/openssh/session.c b/crypto/openssh/session.c
index 57a3e18..82913ff 100644
--- a/crypto/openssh/session.c
+++ b/crypto/openssh/session.c
@@ -1533,6 +1533,12 @@ do_setusercontext(struct passwd *pw)
perror("unable to set user context (setuser)");
exit(1);
}
+
+ /*
+ * FreeBSD's setusercontext() will not apply the user's
+ * own umask setting unless running with the user's UID.
+ */
+ setusercontext(lc, pw, pw->pw_uid, LOGIN_SETUMASK);
#else
/* Permanently switch to the desired uid. */
permanently_set_uid(pw);
diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist
index 374889d..4ad7894 100644
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -174,8 +174,6 @@
..
nullfs
..
- portalfs
- ..
procfs
..
udf
diff --git a/games/fortune/datfiles/Makefile b/games/fortune/datfiles/Makefile
index 100182f..bf13182 100644
--- a/games/fortune/datfiles/Makefile
+++ b/games/fortune/datfiles/Makefile
@@ -1,37 +1,22 @@
# @(#)Makefile 8.2 (Berkeley) 4/19/94
# $FreeBSD$
-FILES= fortunes freebsd-tips murphy startrek zippy
-BLDS= fortunes.dat murphy.dat startrek.dat zippy.dat \
- fortunes-o fortunes-o.dat freebsd-tips.dat
+DB= fortunes freebsd-tips murphy startrek zippy
# TO AVOID INSTALLING THE POTENTIALLY OFFENSIVE FORTUNES, COMMENT OUT THE
-# THREE LINES AND UNCOMMENT THE FOURTH LINE.
+# NEXT LINE.
+DB+= limerick murphy-o gerrold.limerick
-# THE THREE LINES:
-FILES+= limerick murphy-o gerrold.limerick
-BLDS+= limerick.dat murphy-o.dat gerrold.limerick.dat
-TYPE= real
-
-# THE FOURTH LINE:
-#TYPE= fake
-
-FILES+= ${BLDS}
+BLDS= ${DB:S/$/.dat/}
+FILES= ${DB} ${BLDS}
CLEANFILES+=${BLDS}
FILESDIR= ${SHAREDIR}/games/fortune
-.for f in fortunes freebsd-tips gerrold.limerick limerick murphy murphy-o startrek zippy
+.for f in ${DB}
$f.dat: $f
PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \
strfile -Cs ${.ALLSRC} ${.TARGET}
.endfor
-fortunes-o.dat: fortunes-o
- PATH=$$PATH:/usr/games:${.OBJDIR}/../strfile \
- strfile -Csx ${.ALLSRC} ${.TARGET}
-
-fortunes-o: fortunes-o.${TYPE}
- LC_ALL=C tr a-zA-Z n-za-mN-ZA-M < ${.ALLSRC} > ${.TARGET}
-
.include <bsd.prog.mk>
diff --git a/games/fortune/datfiles/fortunes-o.fake b/games/fortune/datfiles/fortunes-o.fake
deleted file mode 100644
index 3b3f5a3..0000000
--- a/games/fortune/datfiles/fortunes-o.fake
+++ /dev/null
@@ -1,2 +0,0 @@
-There are no potentially offensive fortunes installed on this
-system. For further details, contact your system administrator.
diff --git a/games/fortune/datfiles/fortunes-o.real b/games/fortune/datfiles/fortunes-o.real
deleted file mode 100644
index 851a439..0000000
--- a/games/fortune/datfiles/fortunes-o.real
+++ /dev/null
@@ -1,15437 +0,0 @@
-%% $FreeBSD$
-%
- PLAYGIRL, Inc.
- Philadelphia, Pa. 19369
-Dear Sir:
- Your name has been submitted to us with your photo. I regret to
-inform you that we will be unable to use your body in our centerfold. On
-a scale of one to ten, your body was rated a minus two by a panel of women
-ranging in age from 60 to 75 years. We tried to assemble a panel in the
-age bracket of 25 to 35 years, but we could not get them to stop laughing
-long enough to reach a decision. Should the taste of the American woman
-ever change so drastically that bodies such as yours would be appropriate
-in our magazine, you will be notified by this office. Please, don't call
-us.
- Sympathetically,
- Amanda L. Smith
-
-p.s. We also want to commend you for your unusual pose. Were you
- wounded in the war, or do you ride your bike a lot?
-%
- MOUNTIES:
-I'm a lumberjack and I'm OK, He's a lumberjack and he's OK,
-I sleep all night and I work all day. He sleeps all night and he works
- all day.
-
-I cut down trees, I eat my lunch, He cuts down trees, he eats his lunch,
-I go to the lavatory. He goes to the lavatory.
-On Wednesday I go shopping, On Wednesday he goes shopping,
-And have buttered scones for tea. And has buttered scones for tea.
-
-I cut down trees, I skip and jump, He cuts down trees, he skips and jumps,
-I like to press wild flowers, He likes to press wild flowers.
-I put on women's clothing, He puts on women's clothing,
-And hang around in bars. And hangs around in bars.
-
-I cut down trees, I wear high heels, He cuts down trees, he wears high heels,
-Suspenders and a bra. Suspenders? and a bra?
-I wish I'd been a girlie, That's rude...
-Just like my dear Pappa.
-%
- FROM THE DESK OF
- Snow White
-
-Dear Snow White:
-
- Thanks for last night.
-
- Sleepy, Doc, Grumpy, Sneezy, Happy, Dopey, Bashful
-%
- LEPROSY
-Leprosy, all my skin is falling off of me.
-I'm not half the man I used to be.
-Oh, how did I get leprosy?
-
-Syphilis, it all started with a simple kiss.
-Now it even hurts to take a piss.
-Oh why did I get syphilis?
-
-Why'd she have VD? I don't know, she wouldn't say.
-I did something wrong, now I long for yesterday ...
- -- To the tune of "Yesterday"
-%
- My Favorite Drugs [Sung to My Favorite Things]
-Reefers and roach clips and papers and rollers
-Cocaine and procaine for twenty year molars
-Reds and peyote to work out your bugs
-These are a few of my favorite drugs.
-
-Uppers and downers and methedrine freakout
-Take some amphetamines, watch your brains leak out
-Acid and mescaline pull out your plugs
-These are a few of my favorite drugs.
-
-Backs that are perfect for carrying monkeys
-Users of heroin, often called junkies
-Methadone helps then to stop being thugs
-Takes them off one of my favorite drugs.
-
- On a bad trip
- When the cops come
- When I lose my head
- I simply take more of my favorite drugs
- And then I'm not sad -- I'm dead!
-%
- NEW ADDITION TO THE LIBRARY:
-"Sally", the department's new inflatable doll, is available on a
-short-term removal basis only -- please sign her out and return her
-promptly to avoid extended waits. (We are still awaiting shipment of
-our "Big John" doll.)
-%
- The Snack
-Oh my God, screamed Mommy, You went and ate the Baby.
-
-What baby? asked Daddy. You know that's just the last of the leftover donkey.
-
-Donkey, my ass! said Mommy with some sentience. Do you think I don't
- recognize my own baby? Why I can still see his little privates
- caught in the gap between your front teeth. How many times have
- I told you to take only what's on the *top* two shelves of the freezer?
-
-But there wasn't a thing to eat, cried Daddy.
- And am I not the master of my own?
-
-Nothing to eat?
- What about the elephant testicles in aspic that I put up for you
- just last week in the ball jar? Our very first baby, too, wailed
- Mommy, that I was saving for Christmas dinner.
-
-Testicles, testicles, said Daddy. A man gets tired of testicles.
- -- L.L. Zeiger
-%
- ... But among the children of the Great Society there were
-those whose skins were black. And lo! Their portion was niggardly,
-and of the fatted calf they were sucking hind teat ...
- Now it came to pass that a prophet rose up amongst them, and
-they called him King. And he went unto Pharaoh and said, "Let my
-people go to the front of the bus."
- But Pharaoh answered: "In the fullness of time and with all
-deliberate speed shall this thing come to pass. When ye shall prove
-yourselves worthy, shall ye have your just portion -- yea, verily, like
-unto a snowball in Hell."
- -- "The Begatting of a President"
-%
- A bear and a rabbit are taking a crap in the woods. The bear looks
-over at the rabbit and asks, "Say, does shit ever stick to your fur?"
- "No."
- So the bear wiped his ass with the rabbit.
-%
- A business executive is consumed by jealousy: he suspects his wife
-of cheating on him. The suspicion grows and grows, and one morning as he
-drives to work he can't take it any more. He thinks to himself, "she
-probably just waited until I left so she could meet with her lover."
- When he gets to his office, he calls home. The maid answers. He
-says, "Hello. Is my wife there?"
- "Yes, sir", the maid whispers.
- "Is she with her lover?"
- The maid pauses, and then says, "Yes, sir, she is, and I must say
-that I feel terrible about how she treats you."
- The man yells, "That no good **#*&!!. If you feel as badly as you
-say you do, you must do this for me: go to my dresser and get my gun. Check
-to make sure that it's loaded. Then go upstairs and shoot both that cheating
-two-timing whore and her lover. Dispose of the gun, and then come back to
-the phone and tell me that it's over. Don't worry -- I'll protect you."
-The man hears footsteps, a drawer being opened, a click, more footsteps,
-silence... and then two shots. More footsteps. Finally the maid comes back
-to the phone and says "It's done."
- The man asks, "What did you do with the gun?"
- "I threw it behind the statue in the garden", the maid replies.
- "Statue in the garden? Say, what number is this, anyway?"
-%
- A cowboy, his horse and his dog were captured by hostile Indians.
-This wasn't really a problem for the animals as the Indians can always use
-them, but the cowboy is informed that he will be burned at the stake the
-following sunrise. That evening, the Indian chief tells the cowboy that
-he can one last wish, within reason, of course, before meeting his fate
-the following morning. The cowboy replies that all he really wants is to
-see his faithful dog, Rex, one last time. When the dog is brought by the
-Indians, the cowboy hugs his companion and whispers something into his ear.
-At once the dog runs off over the hill. Amazingly enough, a few hours later,
-he returns, accompanied by some two dozen prostitutes from a nearby town.
-Needless to say, the braves are delighted and as a reward offer the cowboy
-his dog to keep him company through the rest of the night. When the dog is
-brought forth the cowboy again runs his hand over Rex's head and then bends
-down to whisper into his ear: "This may be my last chance, Rex, so get it
-right this time -- go into town and get the posse!"
-%
- A farmer decides that his three sows should be bred, and contacts a
-buddy down the road, who owns several boars. They agree on a stud fee, and
-the farmer puts the sows in his pickup and takes them down the road to the
-boars. He leaves them all day, and when he picks them up that night, asks
-the man how he can tell if it "took" or not. The breeder replies that if,
-the next morning, the sows were grazing on grass, they were pregnant, but if
-they were rolling in the mud as usual, they probably weren't.
- Comes the morn, the sows are rolling in the mud as usual, so the
-farmer puts them in the truck and brings them back for a second full day of
-frolic. This continues for a week, since each morning the sows are rolling
-in the mud.
- Around the sixth day, the farmer wakes up and tells his wife, "I
-don't have the heart to look again. This is getting ridiculous. You check
-today." With that, the wife peeks out the bedroom window and starts to laugh.
- "What is it?" asks the farmer excitedly. "Are they grazing at last?"
- "Nope." replies his wife. "Two of them are jumping up and down in
-the back of your truck, and the other one is honking the horn!"
-%
- A grade school teacher was asking students what their parents did
-for a living. "Tim, you be first," she said. "What does your mother do
-all day?"
- Tim stood up and proudly said, "She's a doctor."
- "That's wonderful. How about you, Amie?"
- Amie shyly stood up, scuffed her feet and said, "My father is a
-mailman."
- "Thank you, Amie," said the teacher. "What about your father, Billy?"
- Billy proudly stood up and announced, "My daddy plays piano in a
-whorehouse."
- The teacher was aghast and promptly changed the subject to geography.
-Later that day she went to Billy's house and rang the bell. Billy's father
-answered the door. The teacher explained what his son had said and demanded
-an explanation.
- Billy's father replied, "Well, I'm really an attorney. But how do
-you explain a thing like that to a seven-year-old child?"
-%
- A great American Olympic wrestler was receiving last-minute advice
-from his coach about the upcoming match with the Soviet Champion.
- "This Russian guy is really good, very strong and quick. But I think
-you can take him. Remember, though, like I've told you before, don't let
-him get you in the Pretzel hold. With his strength you'd never get out."
- The American leaps onto the mat, and within moments the two behemoths
-are going crazy, struggling to get each other pinned. The American slowly
-gains ground and appears that he might actually win on points alone, when, in
-the blink of an eye, the Russian reverses him and whips him into the fatal
-Pretzel hold.
- The coach, off by the side, shakes his head in dismay, and sits down
-on the bench with his head between his hands. All of a sudden, there's a
-scream and the two wrestlers fly apart, the American regaining control and
-pinning the Russian. After the match, in the dressing room, the coach
-finally gets the winner alone. "Great job! But how the hell did you get out
-of the Pretzel Hold? I thought it was over for sure!"
- "Well, I did too. I was in the hold, about to be pinned, when I saw
-this huge pair of testicles hanging right in front of my eyes. I figured
-what the hell, so I stretched forward and bit them as hard as I could. Coach,
-you just don't know your own strength 'til you've bitten your own balls!"
-%
- A group of soldiers being prepared for a practice landing on a tropical
-island were warned of the one danger the island held, a poisonous snake that
-could be readily identified by its alternating orange and black bands. They
-were instructed, should they find one of these snakes, to grab the tail end of
-the snake with one hand and slide the other hand up the body of the snake to
-the snake's head. Then, forcefully, bend the thumb above the snake's head
-downward to break the snake's spine. All went well for the landing, the
-charge up the beach, and the move into the jungle. At one foxhole site, two
-men were starting to dig and wondering what had happened to their partner.
-Suddenly he staggered out of the underbrush, uniform in shreds, covered with
-blood. He collapsed to the ground. His buddies were so shocked they could
-only blurt out, "What happened?"
- "I ran from the beachhead to the edge of the jungle, and, as I hit the
-ground, I saw an orange and black striped snake right in front of me. I
-grabbed its tail end with my left hand. I placed my right hand above my left
-hand. I held firmly with my left hand and slid my right hand up the body of
-the snake. When I reached the head of the snake I flicked my right thumb down
-to break the snake's spine... did you ever goose a tiger?"
-%
- A guy finishes his 9 to 5, but, instead of going straight home, stops
-in at a local bar for a drink. He gets his beer, turns around to sit down,
-and finds himself face to face with a ravishing blonde. The two strike up a
-conversation, and really hit it off. After a couple drinks they leave the bar
-go back to her pad, to peruse her etchings. Which doesn't take long -- by
-seven they were happily engaged in intimate scratching.
- 'Round about midnight the guy rolled over in bed and spotted the clock:
-"Midnight! Already! I gotta get home! Honey, you have any baby powder?"
-He jumps out of bed and starts pulling his pants on, trying to find his shoes.
- "Baby powder?" she asks. But she comes back from the bathroom and
-hands him the powder. He frantically shakes it all over his hands, kisses her
-goodbye, and runs out the front door.
- He gets home, and sure enough, there's his wife, waiting in the
-doorway.
- "Okay," she mutters, "let's have it."
- "Well," he says sheepishly, looking down at his feet. "Okay. I went
-to a bar after work and met a gorgeous blonde and we really hit it off. We
-had a few drinks and went back to her place, and well, see..."
- "Oh yeah?" she says, "let me see your hands... Don't you lie to me!
-You've been bowling again!"
-%
- A guy returns from a long trip to Europe, having left his beloved
-dog in his brother's care. The minute he's cleared customs, he calls up his
-brother and inquires after his pet.
- "Your dog's dead," replies his brother bluntly.
- The guy is devastated. "You know how much that dog meant to me,"
-he moaned into the phone. "Couldn't you at least have thought of a nicer way
-of breaking the news? Couldn't you have said, `Well, you know, the dog got
-outside one day, and was crossing the street, and a car was speeding around a
-corner...' or something...? Why are you always so thoughtless?"
- "Look, I'm sorry," said his brother, "I guess I just didn't think."
- "Okay, okay, let's just put it behind us. How are you anyway?
-How's Mom?"
- His brother is silent a moment. "Uh," he stammers, "uh... Mom got
-outside one day..."
-%
- A guy walks into a pub and asks: "Does anyone here own a Doberman?
-I feel really bad about this, but my Chihuahua just killed it."
- A man leaps to his feet and replies, "Yes, I do, but how can that
-be? I raised that dog from a pup to be a vicious killer."
- "Yes, well, that's all well and good," replied the first, "but my
-dog's stuck in its throat."
-%
- A man came home from work and as he entered the house he yelled,
-"Hi, honey, I'm home."
- There was no response. He walked through the house and saw a note
-on the refrigerator. It read "I'm out with the girls and I'll be home about
-8. Either fix yourself something to eat, or wait for me and we'll eat when
-I get home."
- Well, he decided to wait until his wife returned. However, his
-stomach started to growl and he remembered that he had an apple left over
-from his lunch. He got the apple, polished it a little, and heard the
-doorbell ring. He went to the door and there stood a little blond haired
-girl holding out a little paper bag. "Trick or treat", she said.
- He looked at the girl, looked at the apple, thought how hungry he
-was, looked at the girl again, and with a slight sigh dropped his apple in
-the bag. The little girl looked down in the bag, looked up again, and
-complained, "You stupid son-of-a-bitch. You broke my cookies!"
-%
- A man dies and is getting his tour of heaven. His guide is pointing
-out the various features and landmarks when the man asks, "What's that cliff?"
- "Oh, you don't want to look down there. That's hell!"
- The man creeps up to the edge and looks over. He sees lush, green
-valleys, verdant farmland and trees everywhere. "This doesn't look so bad,"
-he says.
- Puzzled, the guide comes over and looks down. "Damn!" he snaps,
-"Those Mormons have been irrigating again!"
-%
- A man sank into the psychiatrist's couch and said, "I have a
-terrible problem, Doctor. I have a son at Harvard and another son at
-Princeton; I've just gifted each of them with a new Ferrari; I've got
-homes in Beverly Hills, Palm Beach, and a co-op in New York; and I've
-got a thriving ranch in Venezuela. My wife is a gorgeous young actress
-who considers my two mistresses to be her best friends."
- The psychiatrist looked at the patient, confused. "Did I miss
-something? It sounds to me like you have no problems at all."
- "But, Doctor, I only make $175 a week."
-%
- A man walks into a bar and orders 3 shots and 3 beers. The
-bartender, seeing that the man is distraught, asks what the problem is.
- "I just found out that my brother is gay", he replies.
- About a week later, the same man walks in and orders 6 shots and
-6 chasers. So the bartender inquires, "What's wrong this time?"
- To which the man says, "I just found out that two of my brothers
-are lovers."
- Another week goes by and the man comes back to the bar and orders
-NINE shots and NINE beers. The bartenders says "Damn, boy, doesn't anyone
-in your family like pussy?"
- "Yeah. Me and my sister."
-%
- A man walks into a bar and says: "I'd like a shot of twelve-year-old
-Scotch". The bartender, who figures the guy is just being obnoxious, reaches
-down under the bar and pours him a shot of bar Scotch. The man takes one sip
-and says: "Hey, bartender, I asked you for some twelve-year-old Scotch -- this
-is eight-year-old Scotch."
- The bartender reaches behind the bar for the twelve-year-old Scotch,
-pours a shot, hands it to the man and says "I've got to hand it to you --
-most guys who come in here asking for twelve-year-old Scotch have never even
-had it -- they're just being pricks. But you really know your Scotch -- this
-is on the house."
- A drunk has been sitting at the other end of the bar watching this
-conversation. He walks up to the man, hands him a glass and says "Taste this."
-The man does -- and spits it out yelling, "This tastes like piss!" To which
-the drunk replies, "It is -- but how old am I?"
-%
- A man walks into a bar with a Leprechaun on his shoulder. He walks
-up to the bar and sits down, ordering a beer for himself and one for the
-little Leprechaun.
- After a few beers, the Leprechaun jumps down off the guy's shoulder,
-struts down the bar and comes to a stop in front of a rather large construction
-worker. Looking the guy right in the eye, he gives him a rather large, damp,
-Bronx cheer. And trots back to sit on his buddy's shoulder. The worker is
-pretty upset, but decides to shine on this rather offensive breach of manners.
- After another beer and a half though, the Leprechaun hops down and
-walks over to his previous victim and goes "PPPPHHHHHHHBBBBTTTTTT" again.
-Well, that's too much, and the victim knocks the Leprechaun off the bar and,
-after walking over to stand very close to the Leprechaun's escort, tells him
-in a rather overloud voice, that if it happens again, he's going to "cut off
-his little dick!"
- Replies the escort, "Leprechauns don't have dicks."
- "Yeah? Well, then," asks the big man, how does he take a piss?"
- "PPPPHHHHHHHBBBBTTTTTT!!!!"
-%
- A man was just settling down into his seat for a cross-country
-flight when he noticed a beautiful woman sitting next to him, wearing a
-large button with the letters "NAA" on it.
- "What's that?" he asked, pointing to her button.
- "Nymphomaniacs Association of America" she replied.
- After a moments thought he said, "Well, if you wouldn't mind my
-asking, but I've always wanted to know, who are the best, ummm, `endowed'
-men?"
- "Well, it's not what you think. Native Americans. They're better
-hung than *anybody*."
- "And is it true that the French are the best lovers?"
- "No, Jewish men. Once you finally get them going they can last
-all night. By the way, my name is Sue. What's yours?"
- "Running Bear Sheldon."
-%
- A man was traveling cross-country one summer from New York to LA.
-He arrived in Needles, CA late one night and pulled into an Exxon for some
-gas. When he pulled up to the gas pumps, he noticed that all of the lights
-were off. Suddenly, he heard a faint sound from outside. He wasn't sure
-what he'd heard, so he rolled down his window and heard a faint cry,
-"Help... help... help". He got out of his car, and sure enough there was
-a guy stooped down in the corner, stark naked with his wrists tied to his
-ankles. He walked up to the guy and said, "Hey, man, what happened to you?"
- "These guys pulled me out of my car, took my money, my wallet, my
-clothes, tied my wrists to my ankles, and then stole my car!!"
- "Damn!", replied the first man as he unzipped his pants. "This just
-hasn't been your day, has it?"
-%
- A man went to a doctor to have his penis enlarged. Well, this
-particular procedure involved splicing a baby elephant's trunk onto the
-man's penis. Overjoyed, the man went out with his best girl to a very
-fancy restaurant. After cocktails, the man's penis crept out of his pants,
-felt around the table, grabbed a hard roll and quickly disappeared under
-the tablecloth. The girl was startled and exclaimed, "What was that?"
- Suddenly the penis came back, took another hard roll and just as
-quickly disappeared. The girl was silent for a moment, then finally said,
-"I don't believe I saw what I think I just saw... can you do that again?"
- With a bit of an uncomfortable smile the man replied, "Honey, I'd
-like to, but I don't think my ass can take another hard roll!"
-%
- A Mexican and a Texan worked together for a construction firm, and,
-while they were good friends, they had a friendly rivalry over whose wife
-was the better cook. One weekend, as the Texan's wife was out of town, the
-Mexican invited the Texan to have supper with his family.
- The Texan accepted, and that evening sat down to some the best stew
-that he had ever eaten.
- "Damn! That stew is fantastic!" he exclaimed to his host. "What
-kind of meat is it?"
- "Rabbeet stew," replied the Mexican.
- "Rabbit?" replied the Texan. "There aren't any rabbits around here."
- "Si, my freend, the rabbeets make the beeg noise, and I shoot theem."
- "Rabbits don't make any noise..."
- "Si, my freend, they say meeyow, meeyow!"
-%
- A mother and her daughter came to the doctor's office. The mother
-asked the doctor to examine her daughter. "She has been having some strange
-symptoms and I'm worried about her," the mother said.
- The doctor examined the daughter carefully. Then he announced,
-"Madam, I believe your daughter is pregnant."
- The mother gasped. "That's nonsense!" she said. "Why, my little
-girl has never even been out with a man, let alone... let alone..." She
-turns to the girl and said, "Tell the doctor, Susie!"
- "Yes, Mumsy," said the girl. "Doctor, I have never so much as
-kissed a man!"
- The doctor looked from the mother to daughter, and back again. Then,
-silently he stood up and walked to the window. He stared out. He continued
-staring until the mother felt compelled to ask, "Doctor, is there something
-wrong out there?"
- "No, Madam," said the doctor. "It's just that the last time anything
-like this happened, a star appeared in the East and I was looking to see if
-another one was going to show up."
-%
- A priest was walking along the cliffs at Dover when he came upon
-two locals pulling another man ashore on the end of a rope. "That's what
-I like to see", said the priest, "A man helping his fellow man".
- As he was walking away, one local remarked to the other, "Well,
-he sure doesn't know the first thing about shark fishing."
-%
- A proper elderly English couple visiting Australia decided to hire a
-car to take a look at the outback. "We know it's rough country, but it's safe
-and decent, isn't it?" the husband inquired of the rental-agency manager.
-Upon being assured that it was, the couple drove off.
- Later that day, they returned, upset and angry. "You said it was
-decent country," the Englishwoman upbraided the rental agent, "but we hadn't
-driven too far when we saw a man in a field copulating with a kangaroo!"
- "And not too long after that," complained her husband, "a one-legged
-aborigine leaning against a tree by the side of the road grinningly waved
-at us with one hand while he brazenly masturbated himself with the other!"
- "Guv'nor," responded the Aussie, "yer wouldn't expect a poor bugger
-like that, with only one leg, to catch a 'roo, would you?"
-%
- A secretary entered her boss's office with the announcement: "I have
-some good news and some bad news."
- He muttered, "It's quarterly report day, Sally -- just the good news."
- She replied, "You're not sterile."
-%
- A sociologist, a psychologist, and an engineer were discussing the
-consequences and implications of a married man's having a mistress. The
-sociologist's opinion was that it is absolutely and categorically unforgivable
-for a married man to forfeit the bond of matrimony, and engage in such lowly
-and lustful pursuits.
- The psychologist's opinion was that although morally reprehensible,
-if a man MUST have a mistress to achieve his full potential as a human being,
-then -- well -- he may go ahead and choose to have a mistress, as long as he
-is considerate enough to keep this secret from his wife.
- The engineer then interjected: "I also believe that, if necessary,
-a married man is entitled to a mistress. However, I do not see why the
-affair should be concealed from the wife. On the contrary, if the affair
-is out in the open, then on Friday evenings he may tell his wife that he
-is going to see his mistress, tell his mistress that he is going to be with
-his wife, then go to his office and get some work done!"
-%
- A strange looking white man came to the Indian reservation looking
-for a job. He asked to talk to the Chief of the tribe, so he might give his
-qualifications. The Chief strode forward from the group surrounding the
-white man and said: "You leave! No job!"
- The man explained that this was no ordinary job he was seeking, but
-that of tribe Medicine-Man. He would convince him if the Chief would allow
-him to demonstrate his magic. "No magic!" said the disbelieving Chief.
- "Oh, yeah?", said the stranger. "I'll prove it to you by making
-your dog, here, talk!"
- "Dog, no talk!" responded the Chief, but before he could finish, he
-heard a voice coming out of the mouth of the dog saying, "The Chief treats me
-good. He feeds me, and keeps me in teepee when it snows!"
- "If you still have doubts as to my magic," continued the stranger,
-"the next voice you'll hear will be that of your horse!"
- "Horse, no talk!" argued the still-sceptical Chief, but again he
-heard a voice that said: "I am the Chief's favorite horse. He takes me up to
-the green pasture to eat and brushes my coat when I get dirty."
- The stranger, still seeing some disbelieving faces, claimed for his
-final trick he would make the Chief's sheep talk.
- "NO!" cried the Chief, "SHEEP LIE!"
-%
- A ten-year-old kid came home from school one day, and when his mom
-asked how was school he says: "Gee, great, mom. I got laid!"
- She's shocked and sends him upstairs, where his dad finds him after
-work. "Mommy told me about your day at school, Billy, and I think we men
-should keep it a secret. Women just don't understand these things."
- So every night Dad goes up to Billy's room after Mom tucks him in:
-"You get laid today, Billy?"
- "Yeah, Dad."
- "How was it?"
- "Real neat, Dad, I liked it a lot."
- "Good Boy!".
- A month later: "You get laid today?"
- "No, Dad."
- "No? How come?"
- "Gee, Dad, my ass is getting really sore."
-%
- A white man was traveling with Indian (American) out West. The
-Indian stops, puts his ear to the ground, and says, "Buffalo come."
- The white man looks around in all directions, sees nothing for
-miles and asks the Indian how the hell he knows that.
- Replies the Indian, "Ear wet."
- -- Lily Tomlin, "The Search for Signs of Intelligent
- Life in the Universe"
-%
- A woman was married to a golfer. One day she asked, "If I were
-to die, would you remarry?"
- After some thought, the man replied, "Yes, I've been very happy in
-this marriage and I would want to be this happy again."
- The wife asked, "Would you give your new wife my car?"
- "Yes," he replied. "That's a good car and it runs well."
- "Well, would you live in this house?"
- "Yes, it is a lovely house and you have decorated it beautifully.
-I've always loved it here."
- "Well, would you give her my golf clubs?"
- "No."
- "Why not?"
- "She's left handed."
-%
- A young couple jumped out of their car and dashed into the park.
-They hurriedly found a secluded spot and began to make frenzied, passionate
-love. Shortly thereafter, as they were driving away, the young man turned
-to her and said, "If I had known you were a virgin, I'd have taken more time."
- She replied, "If I had known you had more time, I'd have taken off
-my pantyhose."
-%
- A young man asked his father to lend him $50 for a blowjob,
-whereupon his father solemnly replied, "When I was young we used to
-settle for a kiss."
- The son retorted, "OK, how about $50 for a long low kiss?"
-%
- After watching an extremely attractive maternity-ward patient
-earnestly thumbing her way through a telephone directory for several
-minutes, a hospital orderly finally asked if he could be of some help.
- "No, thanks," smiled the young mother, "I'm just looking for a
-name for my baby."
- "But the hospital supplies a special booklet that lists hundreds
-of first names and their meanings," said the orderly.
- "That won't help," said the woman, "my baby already has a first
-name."
-%
- All he did was take the ball and run every time they called his
-number -- which came to be more and more often, and in the Super Bowl Thomas
-was the whole show. But the season is now over; the purse is safe in the
-vault; and Duane Thomas is facing two to twenty for possession. Nobody really
-expects him to serve time, but nobody seems to think he'll be playing for
-Dallas next year either, and a few sporting people who claim to know how the
-NFL works say he won't be playing for ANYBODY next year; that the Commissioner
-is outraged at this mockery of all those Government-sponsored "Beware of Dope"
-TV shots that dressed up the screen last autumn.
- We all enjoyed those spots, but not everyone found them convincing.
-Here was a White House directive saying several million dollars would be spent
-to drill dozens of Name Players to stare at the camera and try to stop grinding
-their teeth long enough to say they hate drugs of any kind... and then the best
-running back in the world turns out to be a goddamn uncontrollable drugsucker.
- But not for long. There is not much room for freaks in the National
-Football League. Joe Namath was saved by the simple blind luck of getting
-drafted by a team in New York City, a place where social outlaws are not
-always viewed as criminals. But Namath would have had a very different trip
-if he'd been drafted by the St. Louis Cardinals.
- -- Hunter S. Thompson
-%
- An Aggie was appointed ambassador to Japan. Two weeks before
-officially reporting to the embassy, he went from geisha house to geisha
-house. While making love to a geisha girl, he heard her repeat, "Yaki-san,
-yaki-san."
- Right away the Aggie thought to himself, "I've learned my first
-Japanese word. It must be an expression of joy."
- When he reported to the embassy, he received his first assignment,
-which was to escort the prime minister of Japan around the golf course.
-After having played a couple of holes, the prime minister teed-off and made
-a hole-in-one. The prime minister jumped up and down shouting, "Bonsai!
-Bonsai!"
- Quickly, thinking that this was the perfect chance to show off the
-new Japanese word that he'd learned, the Aggie exclaimed, "Yaki-san,
-yaki-san!"
- The prime minister turned to the Aggie in surprise and exclaimed,
-"What do you mean, wrong hole?"
-%
- An American tourist went into a restaurant in a Spanish provincial
-city and asked to be served the specialty of the house. When the dish
-arrived he asked what kind of meat it contained. "These, senor," explained
-the waiter in halting English, "are the cojones -- the, what you say, the
-testicles -- of the bull killed in the ring today.
- The tourist gulped but tasted the dish and found it delicious.
-Returning the following evening, he asked for the same dish. When it was
-served, he commented to the waiter, "But these -- these cojones -- are
-much smaller than the ones I had yesterday."
- "True, senor, but the bull -- he does not ALWAYS lose."
-%
- An eighty-year-old woman is rocking away the afternoon on her
-porch when she sees an old, tarnished lamp sitting near the steps. She
-picks it up, rubs it gently, and lo and behold a genie appears! The genie
-tells the woman the he will grant her any three wishes her heart desires.
- After a bit of thought, she says, "I wish I were young and
-beautiful!" And POOF! In a cloud of smoke she becomes a young, beautiful,
-voluptuous woman.
- After a little more thought, she says, "I would like to be rich
-for the rest of my life." And POOF! When the smoke clears, there are
-stacks and stacks of money lying on the porch.
- The genie then says, "Now, madam, what is your final wish?"
- "Well," says the woman, "I would like for you to transform my
-faithful old cat, whom I have loved dearly for fifteen years, into a young
-handsome prince!"
- And with another billow of smoke the cat is changed into a tall,
-handsome, young man, with dark hair, dressed in a dashing uniform.
- As they gaze at each other in adoration, the prince leans over to
-the woman and whispers into her ear, "Now, aren't you sorry you had me
-fixed?"
-%
- An Israeli soldier was checking travelers' papers on a road, when a
-man and a heavily pregnant woman on a donkey came by. "Your names please?"
-said the soldier.
- "My name is Mary," said the woman.
- "And mine is Joseph," said the man.
- "Oh," said the soldier, a little taken aback, "And where are you
-going?"
- "To Bethlehem."
- "Your reason for going there?"
- "To pay our taxes to the government."
- "Tell me," said the soldier, "are you going to name the baby Jesus?"
- "Of course not," said the woman, "What do you think we are, Puerto
-Ricans?"
-%
- An old maid wanted to travel by bus to the pet cemetery with the
-remains of her cat. As she boarded the bus, she whispered to the driver,
-"I have a dead pussy."
- The driver pointed to the woman in the seat behind him and said,
-"Sit with my wife. You two have a lot in common."
-%
- And Jesus said unto them, "And whom do you say that I am?"
- They replied, "You are the eschatological manifestation of the
-ground of our being, the ontological foundation of the context of our
-very selfhood revealed."
- And Jesus replied, "What?"
-%
- "And what do you two think you are doing?!" roared the husband,
-as he came upon his wife in bed with another man. The wife turned and
-smiled at her companion.
- "See?" she said. "I told you he was stupid!"
-%
- "Anything else, sir?" asked the attentive bellhop, trying his best
-to make the lady and gentleman comfortable in their penthouse suite in the
-posh hotel.
- "No. No, thank you," replied the gentleman.
- "Anything for your wife, sir?" the bellhop asked.
- "Why, yes, young man," said the gentleman. "Would you bring me
-a postcard?"
-%
- "Are pirates an ethnic group? Or are they just people who burn
-illegal cds?"
- "Arrrr! We prefer to be called Buccaneer-Americans."
-%
- Are you a Young Urban Professional Woman? If so, you know how
-Yuppie women are; cold, ruthless bitches with no time for love, and only
-an occasional weekend for sex. Your one "hot date" with Joe Fastrack,
-rising corporate star, ended in disaster. Yesterday you heard him telling
-a friend over lunch, "The woman must masturbate with popsicles!" Well,
-all is not lost! SofSqueeze can change your nickname to Electrolux in just
-15 minutes a day!
- SofSqueeze is a pressure sensitive device (divided into appropriate
-sections) that plugs into the serial port of most home computers. Through
-the magic of biofeedback, SofSqueeze teaches you control over your vaginal
-muscles. With our exciting, easy-to-follow software you'll master the
-"Cincinnati Squeeze", the "Irresistible", the "California Crusher", and,
-of course, the perennial favorite, "Milking Time Down on the Farm". Or,
-using our exclusive Interactive Mode, invent your own!
- SofSqueeze is made of sturdy ABS plastic, and is completely
-immersible for easy cleaning. SofSqueeze's flesh-toned exterior is finely
-textured for a realistic effect. Requires 4K RAM, a DB25 serial port and
-limited graphics capability. Comes fully assembled, with 4 AA batteries.
-%
- As we know, there are known knowns. There are things we know we
-know. We also know there are known unknowns. That is to say, we know
-there are some things we do not know. But there are also unknown
-unknowns; the ones we don't know we don't know.
- -- United States Secretary of Defense Donald Rumsfeld
- 12 February 2002, Regarding the US invasion of Iraq
-%
- At an elegant dinner party, Lady Astor once leaned across the table
-to remark, "If you were my husband, Winston, I'd poison your coffee." "And
-if you were my wife, I'd beat the shit out of you," came Churchill's
-unhesitating retort.
- -- "The Churchill Wit", National Lampoon
-%
- At his sentencing, Herbie Sperling proved that he was the all-time
-stand-up guy.
- Sperling's lawyer made a lengthy, impassioned plea for his client.
-He talked of mercy, justice, humanity to fellow men who have chosen the wrong
-path. Yes, the crimes were serious, yes, Mr. Sperling deserves a prison
-sentence, but the maximum sentence was not warranted.
- Then the judge turned to Sperling. "Mr. Sperling, is there anything
-you wish to say?"
- "Yes, Your Honor. If you think I'm going to beg for mercy, you've
-got another think coming. You're all a bunch of fucking fascist cocksuckers,
-you can all go to hell, fuck you, fuck you, fuck you..."
- -- Gregory Wallace, "Papa's Game"
-%
- Attracted by repeated newspaper advertisements, and realizing that
-his waist had gone both East and West despite his daily racquetball, a young
-executive appeared at a local health resort. Looking over the several weight
-loss plans offered, he selected one guaranteed to reduce his weight by two
-pounds per day. After a light breakfast, and an almost non-existent lunch, he
-was escorted to a large room, where a young, attractive woman told him that
-"if he caught her, he could have her". After an hour of hard running, he
-finally gave up; and weighing himself, was comforted to realize that he had
-lost just under three pounds. Returning the next week, he chose the plan that
-was to reduce his weight by four pounds per session. After following the same
-regimen, he was again escorted to a large room, but after two hours of running,
-he caught the young woman. Weight loss, just over four pounds. Returning the
-following week, he chose to lose eight pounds in a single day. He was shown
-to the largest room he'd seen, by far, where he was confronted by an extremely
-muscular, burly man, who looked him square in the eye, flung his towel into
-a corner, and snarled, "You know the rules. Start running!"
-%
- Barbra Walters was doing a documentary on the customs of American
-Indians. After a tour of a reservation they were on, she was curious as to
-the number of feathers in the headdresses. She asked a brave who had only
-one feather in his headdress. His reply was, "Me have only one squaw, me
-have only one feather." She asked another brave, feeling the first fellow
-was only joking. This brave had four feathers in his headdress. He replied,
-"Me have four feathers, because me sleep with four squaws."
- Still not convinced the number of feathers indicated the number of
-squaws involved, she decided to interview the Chief. Now the Chief had a
-headdress full of feathers which, needless to say, amused Ms. Walters.
-Ms. W: "Why do you have so many feathers in your headdress?"
-Chief: "Me Chief, me fuck-em all, big, small, fat, tall,
- me fuck-em all."
-Ms. W: "You ought to be hung!"
-Chief: "You damned right, me hung. Big like buffalo, long like snake."
-Ms. W: "You don't have to be so hostile!"
-Chief: "Hoss-style, dog-style, wolf-style, any-style, me fuck-em all."
-Ms. W: "Oh, dear!"
-Chief: "No deer, me no fuck deer. Asshole too high and fuckers run
- too fast."
-%
- Before he went off to the wars, King Arthur locked his lovely wife,
-Guinevere, into her chastity belt. Then he summoned his loyal friend and
-subject Sir Lancelot. "Lancelot, noble knight," said Arthur, "within this
-sturdy belt is imprisoned the virtue of my wife. The key to this chaste
-treasure I will entrust to only one man in the world. To you."
- Humbled before this great honor, Lancelot knelt, received his king's
-blessing and took charge of the key. Arthur mounted his steed and rode off.
-Not half a mile from his castle, he heard hoofbeats behind him and turned to
-see Sir Lancelot riding hard to catch up with him.
- "What is amiss, my friend?" asked the king.
- "My lord," gasped Lancelot, "you have given me the wrong key!"
-%
- "Before we get married," said the young woman to her fiance,
-"I want to confess some affairs that I've had in the past."
- "But you told me all about those a few weeks ago," her young man
-replied.
- "Yes, darling," she explained, "but that was a few weeks ago."
-%
- Bill had just returned from a week of honeymooning, and his best
-friend asked him how it went.
- "The first night we did it nine times," Bill said. "The second
-night, eight times. The third night, seven times. The fourth night, six
-times. The fifth night, five times. The sixth night, four times, and the
-last night, nothing!"
- "Nothing?" his pal asked. "How come?"
- "Hey, you ever tried putting a marshmallow in a parking meter?"
-%
- "Can you hammer a 6-inch spike into a wooden plank with your
-penis?"
- "Uh, not right now."
- "Tsk. A girl has to have some standards."
- -- "Real Genius"
-%
- Churchill was given to reading in the bathtub and, while staying at
-the White House, he once became so engrossed in an account of the Battle of
-Fonteney that he forgot President Roosevelt was due to drop by to discuss the
-upcoming conference in Yalta. At the appointed hour, the President was
-wheeled into Churchill's quarters only to be informed that the Prime Minister
-had not finished bathing. Roosevelt was about to apologize for the intrusion
-and depart when Churchill, puffing his customary cigar, strode into the room
-stark naked and greeted the nonplussed world leader with a terse, "What are
-you staring at, homo?"
- -- "The Churchill Wit", National Lampoon
-%
- Churchill was known to drain a glass or two and, after one
-particularly convivial evening, he chanced to encounter Miss Bessie Braddock,
-a Socialist member of the House of Commons, who, upon seeing his condition,
-said, "Winston, you're drunk." Mustering all his dignity, Churchill drew
-himself up to his full height, cocked an eyebrow and rejoined, "Shove it up
-your ass, you ugly cunt."
- -- "The Churchill Wit", National Lampoon
-%
- "Dad," the 13-year-old boy asked, looking up from his social-
-studies text, "what did you do during the sexual revolution?"
- "Well, son," his father confided, "I guess you could say I was
-captured early and spent the duration doing the dishes."
-%
- "Daddy?"
- "Yes son."
- "Wha-wha-wha-what does regret mean?"
- "Well, son, a funny thing about regret is that it's better to regret
-something you have done, than to regret something you haven't done. And by
-the way, if you see your Mom this weekend, would you be sure and tell her,
-`SATAN, SATAN, SATAN!!!'"
- -- Butthole Surfers, "Sweat Loaf"
-%
- "Darling," he breathed, "after making love I doubt if I'll
-be able to get over you -- so would you mind answering the phone?"
-%
- "Darling", said the young bride, "tell me what's bothering you.
-We promised to share all our joys and sorrows, remember?"
- "But this is different," protested her husband.
- "Together, darling," she insisted, "we will bear the burden.
-Now tell me what our problem is."
- "Well," said the husband, "we've just become the father of a
-bastard child."
-%
- "Darling," she whispered, "will you still love me after we are
-married?"
- He considered this for a moment and then replied, "I think so.
-I've always been especially fond of married women."
-%
- Desperate about the state of her social life, a young woman resorted
-to the Personal Ads in the back of her local paper. In the ad she made it
-quite clear that what she was advertising for was an expert lover; she already
-had plenty of sensitive friends and meaningful relationships and what she
-now wanted was to get laid, to put it bluntly. Phone calls started coming
-in, with each caller testifying to his sexual prowess, but none quite struck
-the young woman's fancy. Until one night her doorbell rang. Opening the door
-she found a man with no arms or legs, who informed her that he was there in
-response to her advertisement. "I'm terribly sorry," she stammered, "but my
-ad was quite explicit. I'm really looking for something of a sexual expert,
-and you... uh... don't have all the..."
- "Listen," the man interrupted her, "I rang the doorbell, didn't I?"
-%
- "Do you cheat on your wife?" asked the psychiatrist.
- "Who else?" answered the patient.
-%
- Driving through a Swiss city one day, Alfred Hitchcock suddenly
-pointed out of the car window and said, "That is the most frightening
-sight I have ever seen." His companion was surprised to see nothing
-more alarming than a priest in conversation with a little boy, his hand
-on the child's shoulder. "Run, little boy," cried Hitchcock, leaning
-out of the car. "Run for your life!"
-%
- During a grouse hunt in North Carolina two intrepid sportsmen were
-blasting away at a clump of trees near a stone wall. Suddenly a red-face
-country squire popped his head over the wall and shouted, "Hey, you almost
-hit my wife."
- "Did I?" cried one hunter, aghast. "Terribly sorry. Have a shot
-at mine, over there."
-%
- During a session with a marriage counselor, the wife snapped at her
-husband: "That's not true, I do enjoy sex!" Then, turning to the counselor,
-she added: "But this fiend expects it three or four times a year!"
-%
- Ed, a traveling salesman, had his car break down in the middle of a
-blizzard. He trudged to a nearby farmhouse where the farmer told him that,
-while they were short of beds, he could sleep with his daughter. She proved
-to be eighteen and beautiful. So they went to bed, and shortly, Ed made a
-pass at the daughter. "Stop that!" she said. "I'll call my father."
- He desisted. But half an hour later he made another attempt. "Uh,
-stop ... that," she said. "I'll call my father."
- But she moved closer to him, so he made a third try. This time, no
-protest, no threat. Just as Ed, satisfied, was about to drowse off, she
-tugged at his pajama sleeve. "Could we do that again?" she asked.
- Ed obliged, and this time fell asleep only to be awakened by the
-tug at his sleeve. "Again?"
- And again Ed obliged. But when his sleep was once more interrupted
-by the tugging at his pajama sleeve, Ed indignantly pulled it away from her
-and mumbled, "Stop that! Or I'll call your father."
-%
- Elroy stared at Barb and then leaned quietly over to Shake Tiller
-and stuck out his hand. "Son," he said. "Tell the truth. It ain't better
-than fried chicken, is it?"
- Shake looked solemnly at Elroy, clasping his hand, and said:
- "I got to be dead honest, Roy."
- And Elroy said yeah, lay it on him.
- Shake said slowly, "For a Lesbian who gave up the only real love she
-ever knew -- Sister Francis at Our Lady of Victory -- and for a person who
-can't make it any more with nothing but an electric toothbrush, she's the
-finest I've ever had."
- -- Dan Jenkins, "Semi-Tough"
-%
- Ever thought of putting a ferret down your pants? Yes, ferrets,
-those weasel-like animals originally trained to hunt rats and possessing
-needle sharp claws and razor sharp teeth. The English do it for sport.
- Ferret Legging involves the tying of a competitor's trousers at
-the ankles and then dropping into the trousers a couple of vicious ferrets.
-No jockstraps or underwear allowed -- nothing but the bodies' own. The
-ferrets must be young and in good condition. Neither the ferret or the
-contestant may be drugged or drunk -- cold eyed sober only. The trousers
-should be loose fitting, to allow the ferret to scramble from one leg to
-the other, and are traditionally white, so that the blood shows better.
- Normal contestants are able to keep them down for up to 40 seconds.
-The champion ferret legger, Reg Mellor, of Yorkshire, holds the world record
-of 5 hours and 26 minutes. Mr. Mellor's claims that being the champion is
-not so much heroism but, "You just got to be able to have your tool bitten
-and not care."
-%
- Every morning, the crowd on Coney Island beach was startled to see
-a jogger with the build of a pro football player but a head the size of a
-baseball. Finally, some brave young man got up the nerve to stop him and
-ask, "What happened to give you such a small head?"
- The jogger sadly told the story of finding a magic lamp on the beach,
-which produced a beautiful genie when rubbed. The genie said, "I now give
-you one wish. Do you want a quick fuck or a little head?"
-%
- Everyone in the smart nightclub was amazed by the old gentleman,
-obviously pushing 70, tossing off manhattans and cavorting around the dance
-floor like a 20-year old. Finally curiosity got the best of the cigarette
-girl. "I beg your pardon, sir," she said, "but I'm amazed to see a gentleman
-of your age living it up like a youngster. Tell me, are all of your faculties
-unimpaired?"
- The old fellow looked up at the girl sadly and shook his head. "Not
-all, I'm afraid." he said. "Just last evening I went nightclubbing with a
-girlfriend -- we drank and danced all night and finally rolled into her place
-about two A.M. We went to bed immediately, and I was asleep almost as soon
-as my head hit the pillow. I woke around three-thirty and nudged my girl."
- "Why, George," she said in surprise, "we did that fifteen minutes ago."
- "So you see," the old boy said sadly, "my memory is beginning to
-fail me."
-%
- Farmer Johnson was drunk again.
- "You know, Anna," he said to his long-suffering wife, "if you could
-only lay eggs we could get rid of all those damn chickens."
- Anna said nothing. Farmer Johnson tried again. "You know, Anna, if
-only you could give milk we could get rid of that expensive herd of cows."
- Anna looked at him coolly. "You know, Jack," she said, "if only you
-could get it up once in a while we could get rid of your brother Bob."
-%
- "First, I'm going to buy you a few drinks and get you a little tight,"
-said the guy aggressively.
- "Oh, no, you're not," said the girl.
- "Then I'll take you to dinner at the most exclusive restaurant in
-town."
- "Oh, no, you won't."
- "Then I'll take you to my apartment and mix up a pitcher of daiquiris."
- "Oh, no, you won't."
- "Then I'm going to make violent, mad, passionate love to you."
- "Oh, no, you're not."
- "And I'm not going to take any precautions either!" said the guy.
- "Oh, yes, you are!!" said the girl.
-%
- For three years, the young attorney had been taking his brief
-vacations at this country inn. The last time he'd finally managed an
-affair with the innkeeper's daughter. Looking forward to an exciting
-few days, he dragged his suitcase up the stairs of the inn, then stopped
-short. There sat his lover with an infant on her lap!
- "Helen, why didn't you write when you learned you were pregnant?"
-he cried. "I would have rushed up here, we could have gotten married,
-and the baby would have my name!"
- "Well," she said, "when my folks found out about my condition,
-we sat up all night talkin' and talkin' and finally decided it would be
-better to have a bastard in the family than a lawyer."
-%
- Four Oxford dons were taking their evening walk together and as
-usual, were engaged in casual but learned conversation. On this particular
-evening, their conversation was about the names given to groups of animals,
-such as a "pride of lions" or a "gaggle of geese."
- One of the professors noticed a group of prostitutes down the block,
-and posed the question, "What name would be given to that group?" The four
-fell into silence for a moment, as they pondered the possibilities...
- At last, one spoke: "How about 'a Jam of Tarts'?" The others nodded
-in acknowledgment as they continued to consider the problem. A second
-professor spoke: "I'd suggest 'an Essay of Trollops.'" Again, the others
-nodded. A third spoke: "I propose 'a Flourish of Strumpets.'"
- They continued their walk in silence, until the first professor
-remarked to the remaining professor, who was the most senior and learned of
-the four, "You haven't suggested a name for our ladies. What are your
-thoughts?"
- Replied the fourth professor, "'An Anthology of Prose.'"
-%
- Friends were surprised, indeed, when Frank and Jennifer broke their
-engagement, but Frank had a ready explanation: "Would you marry someone who
-was habitually unfaithful, who lied at every turn, who was selfish and lazy
-and sarcastic?"
- "Of course not," said a sympathetic friend.
- "Well," retorted Frank, "neither would Jennifer."
-%
- "Gentlemen of the jury," said the defense attorney, now beginning
-to warm to his summation, "the real question here before you is, shall this
-beautiful young woman be forced to languish away her loveliest years in a
-dark prison cell? Or shall she be set free to return to her cozy little
-apartment at 4134 Mountain Ave. -- there to spend her lonely, loveless hours
-in her boudoir, lying beside her little Princess phone, 962-7873?"
-%
- "God built a compelling sex drive into every creature, no
-matter what style of fucking it practiced. He made sex irresistibly
-pleasurable, wildly joyous, free from fears. He made it innocent
-merriment.
- "Needless to say, fucking was an immediate smash hit. Everyone
-agreed, from aardvarks to zebras. All the jolly animals -- lions and
-lambs, rhinoceroses and gazelles, skylarks and lobsters, even insects,
-though most of them fuck only once in a lifetime -- fucked along
-innocently and merrily for hundreds of millions of years. Maybe they
-were dumb animals, but they knew a good thing when they had one."
- -- Alan Sherman, "The Rape of the A*P*E*"
-%
- God decided to take the devil to court and settle their
-differences once and for all.
- When Satan heard of this, he grinned and said, "And just
-where do you think you're going to find a lawyer?"
-%
- Grover Cleveland, though constantly at loggerheads with the
-Senate, got on better with the House of Representatives. A popular
-story circulating during his presidency concerned the night he was
-roused by his wife crying, "Wake up! I think there are burglars in the
-house."
- "No, no, my dear," said the president sleepily, "in the Senate
-maybe, but not in the House."
-%
- Harry, a golfing enthusiast if there ever was one, arrived home
-from the club to an irate, ranting wife.
- "I'm leaving you, Harry," his wife announced bitterly. "You
-promised me faithfully that you'd be back before six and here it is almost
-nine. It just can't take that long to play 18 holes of golf."
- "Honey, wait," said Harry. "Let me explain. I know what I promised
-you, but I have a very good reason for being late. Fred and I tee'd off
-right on time and everything was fine for the first three holes. Then, on
-the fourth tee Fred had a stroke. I ran back to the clubhouse but couldn't
-find a doctor. And, by the time I got back to Fred, he was dead. So, for
-the next 15 holes, it was hit the ball, drag Fred, hit the ball, drag Fred...
-%
- Harry constantly irritated his friends with his eternal optimism.
-No matter how bad the situation, he would always say, "Well, it could have
-been worse."
- To cure him of his annoying habit, his friends decided to invent a
-situation so completely black, so dreadful, that even Harry could find no
-hope in it. Approaching him at the club bar one day, one of them said,
-"Harry! Did you hear what happened to George? He came home last night,
-found his wife in bed with another man, shot them both, and then turned
-the gun on himself!"
- "Terrible," said Harry. "But it could have been worse."
- "How in hell," demanded his dumbfounded friend, "could it possibly
-have been worse?"
- "Well," said Harry, "if it had happened the night before, I'd be
-dead right now."
-%
- Harry was delighted when he found a young woman who accepted his
-proposal of marriage as he was pretty sensitive about his artificial leg
-and afraid that no one would have him. In fact, he couldn't bring himself
-to tell his fiancee about his leg when he slipped the ring on her finger,
-nor when she bought the dress, nor when they picked the time and place.
-All he kept saying was, "Darling, I've got a big surprise for you," at which
-she blushed and smiled bewitchingly.
- The wedding came and went, and the young couple were at last alone
-in their honeymoon suite. "Now don't forget, Harry, you promised me a big
-surprise," smiled the bride.
- Unable to say a word, Harry turned out the lights, unstrapped his
-leg, slipped into bed, and placed his wife's hand on the stump.
- "Hmmmmm," she said softly, "that IS a surprise. But pass me the
-Vaseline and I'll see what I can do!"
-%
- "Heard you were moving your piano, so I came over to help."
- "Thanks. Got it upstairs already."
- "Do it alone?"
- "Nope. Hitched the cat to it."
- "How would that help?"
- "Used a whip."
-%
- "Hello, Mrs. Premise!"
- "Oh, hello, Mrs. Conclusion! Busy day?"
- "Busy? I just spent four hours burying the cat."
- "Four hours to bury a cat!?"
- "Yes, he wouldn't keep still: wrigglin' about, 'owlin'..."
- "Oh, it's not dead then."
- "Oh no, no, but it's not at all a well cat, and as we're
-goin' away for a fortnight I thought I'd better bury it just to be
-on the safe side."
- "Quite right. You don't want to come back from Sorrento
-to a dead cat, do you?"
- -- Monty Python
-%
- "Hello, Police Department."
- "This is Thomas Parrish, 903 Sylvester Court. I've just been sexually
-molested by a pervert, right here in my own home. It was horrifying!"
- "Just remain calm, sir, and tell me about it."
- "Well, the man came in the window wearing a ski mask. I was napping
-on the bed, in just my pajamas, and the TV set was on so I didn't hear anything.
-Suddenly he had his great big old calloused hand over my mouth, holding me down.
-I tried to scream... he was pulling my pants off. I was so frightened! He
-held a knife to my throat and undressed so quickly. What could I do? I
-couldn't stop him. He was huge. A great, hairy, beefy man, more than fifty
-pounds heavier than I am, and hung like... Oh! it was terrible. He had an
-erection, and he knelt on my shoulders and forced the awful thing down my
-throat; forced me to suck it. Yes, officer! There was no escaping this man.
-Finally, when I thought I would faint, he got off me and turned me over on
-my tummy, forcing my legs apart with his knees, and oh! I'm so embarrassed to
-say it, he put that huge thing... It must have been a foot long, and I don't
-know how thick... into my... Just a minute."
- "What's the matter, mister?"
- "Listen, I have to hang up now, he's getting out of the shower."
-%
- "How'd you get that flat?"
- "Ran over a bottle."
- "Didn't you see it?"
- "Damn kid had it under his coat."
-%
- "I believe you have the wrong number," said the old gentleman into
-the phone. "You'll have to call the weather bureau for that information."
- "Who was that?" his young wife asked.
- "Some guy wanting to know if the coast was clear."
-%
- "I know a life of crime led me to this sorry state. I blame
-society. Society made me what I am today!"
- "That's bullshit Archie. You're just a young suburban punk
-like me."
- "It still... hurts... auugghh!"
- "You're going to be okay..."
- "...gurgle..."
- "... maybe not."
- -- Repo Man
-%
- "I need a camel that can go without water for at least three weeks,"
-the American said to an Algerian camel merchant. "Is it possible?"
- "All things are possible," replied the merchant. He proceeded to
-take a camel out of his barn and lead him to a tank of water. After the
-camel had drunk its fill and was about to lift its head out of the tank,
-the merchant picked up two nearby bricks, one in each hand, stepped behind
-the camel, and smacked his testicles with the bricks.
- The camel let out a gigantic "Whhoooosh!" and sucked up what seemed
-like twenty more gallons of water.
- The American stared incredulously at the camel merchant. "My God,
-man!" he exclaimed, "doesn't that hurt?!"
- The merchant shrugged. "Only if you get your thumbs in between the
-bricks."
-%
- "I think my wife may be getting somewhat overweight.
- "Oh, how can you tell?"
- "Well, last night when she sat on my face, I couldn't
-hear the stereo."
-%
- "I was plodding through the woods when suddenly a giant brown
-bear grabbed me from behind and made me drop my gun. He picked it up
-and stuck it in my back."
- "What did you do?"
- "What *could* I do? I married his daughter."
-%
- I went into a bar feeling a little depressed, the bartender said,
-"What'll you have, Bud"?
- I said," I don't know, surprise me".
- So he showed me a nude picture of my wife.
- -- Rodney Dangerfield
-%
- "I will profane your fucking remains, E. B."
- "Not my remains, Al!"
- "Gabriel's trumpet will produce you from the ass of a pig."
- -- Al Swearingen, E. B. Farnum, _Deadwood_
-%
- I'd say that VCS is more like the anal sex of the software
-world: Everybody talks about it, some people do it, some people enjoy
-it, but typically only vague implications about the best techniques
-are ever voiced in public.
- -- Warner Losh, on Version Control Systems
-%
- "I'll tell ya, Jeb," Wilbur said to his friend, "the tractor
-business ain't doin' too well. I ain't sold one all month.
- "You think you've got problems?" Jeb replied. "The other day, I went
-out to milk Daisy, when she swatted me in the face with her tail, like she
-always does. So I took some twine and tied it to the rafters. When I sat
-down again, she kicked me like she always does. So I tied her leg to the
-side of the stall. When I started to sit down again, I could see her taking
-aim with her other leg, so I tied it to the other side of the stall. And I'll
-tell you what," he continued with a sigh, "if you can convince my wife I was
-gonna *milk* that cow, I'll buy a tractor from you!"
-%
- "I'm looking for adventure, excitement, beautiful women," cried the
-young man to his father as he prepared to leave home. "Don't try to stop me.
-I'm on my way."
- "Who's trying to stop you?" shouted the father. "Take me along!"
-%
- In the beginning, God created the Earth and he said, "Let there be
-mud."
- And there was mud.
- And God said, "Let Us make living creatures out of mud, so the mud
-can see what we have done."
- And God created every living creature that now moveth, and one was
-man. Mud-as-man alone could speak.
- "What is the purpose of all this?" man asked politely.
- "Everything must have a purpose?" asked God.
- "Certainly," said man.
- "Then I leave it to you to think of one for all of this," said God.
- And He went away.
- -- Kurt Vonnegut, Jr., "Between Time and Timbuktu"
-%
- In the beginning was the DEMO Project. And the Project was
-without form. And darkness was upon the staff members thereof. So
-they spake unto their Division Head, saying, "It is a crock of shit,
-and it stinks."
-
- And the Division Head spake unto his Department Head, saying,
-"It is a crock of excrement and none may abide the odor thereof." Now,
-the Department Head spake unto his Directorate Head, saying, "It is a
-container of excrement, and is very strong, such that none may abide
-before it." And it came to pass that the Directorate Head spake unto
-the Assistant Technical Director, saying, "It is a vessel of fertilizer
-and none may abide by its strength."
-
- And the assistant Technical Director spake thus unto the
-Technical Director, saying, "It containeth that which aids growth and
-it is very strong." And, Lo, the Technical Director spake then unto
-the Captain, saying, "The powerful new Project will help promote the
-growth of the Laboratories."
-
- And the Captain looked down upon the Project, and He saw that
-it was Good!
-%
- In the morning, laughing, happy fish heads
- In the evening, floating in the soup.
-(chorus):
-Fish heads, fish heads, roly-poly fish heads;
-Fish heads, fish heads, eat them up. Yum!
- You can ask them anything you want to.
- They won't answer; they can't talk.
-(chorus):
- I took a fish head out to see a movie,
- Didn't have to pay to get it in.
-(chorus):
- They can't play baseball; they don't wear sweaters;
- They aren't good dancers; they can't play drums.
-(chorus):
- Roly-poly fish heads are NEVER seen drinking cappucino in
- Italian restaurants with Oriental women.
-(chorus):
- Fishy!
-(chorus):
- -- Fish Heads
-%
- In what can only be described as a surprise move, God has officially
-announced His candidacy for the U.S. presidency. During His press conference
-today, the first in over 4000 years, He is quoted as saying, "I think I have
-a chance for the White House if I can just get my campaign pulled together
-in time. I'd like to get this country turned around; I mean REALLY turned
-around! Let's put Florida up north for awhile, and let's get rid of all
-those annoying mountains and rivers. I never could stand them!"
- There apparently is still some controversy over the Almighty's
-citizenship and other qualifications for the Presidency. God replied to
-these charges by saying, "Come on, would the United States have anyone other
-than a citizen bless their country?"
-%
- It seems there were two young Marines walking down the street, and
-they chanced upon a lady who was both very proper and very well endowed.
-One of them said, "Wow! What tits! Hey lady, would I love to snuggle up with
-them for awhile. What are you doing this afternoon?"
- Well, the other Marine thought that was just about the most shameful
-thing he had ever witnessed, and felt that he had to restore the honor of the
-Corps. "Pardon my friend, Ma'am," he apologized, "He's not been very well
-brought up and don't know how to talk to cunt."
-%
- It was April the 41st, being a quadruple leap year. I was driving
-in downtown Atlantis. My Barracuda was in the shop, so I was in a rented
-Stingray, and it was overheating. So I pulled into a Shell station. They
-said I'd blown a seal. I said, "Fix the damn thing and leave my private
-life out of it, okay, pal?" While they were doing that, I walked over to the
-Oyster Bar. A real dive. But I knew the owner. He used to play for the
-Dolphins. I said "Hi, Gil!" You have to yell -- he's hard of herring.
- -- Kip Addotta, "Wet Dream"
-%
- It was her wedding night, and the sweet young thing was in a
-romantic haze. "Oh, darling," she sighed, "We're married at last.
-It's all like a wonderful dream!"
- Her husband didn't answer. A few moments passed. She sighed again
-and said, "I'm afraid I'll awake in a moment and find it isn't true."
- Still no response from her spouse. Another pause and another
-sensuous sigh, then, softly, "I just can't believe that I'm really your
-wife."
- "Damn it," growled her mate, "as soon as I get this shoelace untied,
-you will!"
-%
- It was in a bar in midtown Manhattan and the Frenchman and the
-American were talking about love over some dry Martinis. "Deed you know,
-sir," the Frenchman said, "that een my country thair are 79 different
-ways how to make the REAL, passionate luff?"
- "Do tell?" said the American. "Well, that's amazing. In this
-country there's only one."
- "Just one?" the Frenchman said, condescendingly. "And what eez
-that?"
- "Well, there's a man and a woman, and --"
- "Sacre bleu!!" exclaimed the Frenchman. "Numbair 80!"
-%
- "Jean, what is this attraction between Catholic girls and
-Jewish men?"
- "You really want to know?"
- "Yeah."
- "Well, Carol, Jewish men are great in bed... right, Bob? And
-Catholic girls fuck like bunnies."
-%
- Joan, the rather well-proportioned secretary, spent almost all of
-her vacation sunbathing on the roof of her hotel. She wore a bathing suit
-the first day, but on the second, she decided that no one could see her
-way up there, and she slipped out of it for an overall tan. She'd hardly
-begun when she heard someone running up the stairs; she was lying on her
-stomach, so she just pulled a towel over her rear.
- "Excuse me, miss," said the flustered little assistant manager of
-the hotel, out of breath from running up the stairs. "The Hilton doesn't
-mind your sunbathing on the roof, but we would very much appreciate your
-wearing a bathing suit as you did yesterday."
- "What difference does it make," Joan asked rather calmly. "No one
-can see me up here, and besides, I'm covered with a towel."
- "Not exactly," said the embarrassed little man. "You're lying on
-the dining room skylight."
-%
- Many lower life forms demonstrate qualities that, at first, just don't
-seem survival oriented. For instance, the female praying mantis, after mating
-with, well, her mate, will devour him. For the male praying mantis, however,
-it's a catch-22. If he mates, he gets screwed out of an opportunity to mate
-again. If he doesn't mate, he doesn't reproduce, ending his family tree. This
-suicidal behavior is commonly called the Preying Mantis Syndrome -- and many
-life forms are periodically subject to its wrath. How did the preying mantis
-become stuck in such an awful, vicious cycle? This is probably what happened:
- The male mantis arrives at the residence of the female mantis. After
-some courtship exercises (dinner, a movie, inserting the diaphragm) they mate.
-The female mantis, her lust for... lust being satisfied, relaxes while the
-male raids the refrigerator and returns home. This behavior continues until
-the male and female (mantissas?) establish a permanent relationship. Then the
-male establishes a new pattern of behavior: Football on Mondays, baseball on
-Tuesdays, happy hour on Wednesdays, uh, well, uh, working-late-at-the-office
-on Thursdays, etc. etc. The female tolerates this for awhile, then files for
-a divorce. After a long court battle, she concludes one thing: It simplifies
-matters tremendously to just eat him when you're done with him.
- Well, through the centuries of evolution, the Preying Mantis Syndrome
-has been carried up to the highest life forms, as well as to humans. That is
-why, one week out of every month, the female of the species will feel compelled
-to bite the head off of the male. The Syndrome is inescapable, but when it
-occurs in the female of our species, it's best to just avoid them for a while.
-%
- Mr. Hersh came home to find his wife sitting naked in front of the
-mirror, admiring her breasts.
- "And what do you think you're doing?" he asked.
- "I went to the doctor today and he said I have the breasts of a
-twenty-five-year-old."
- "Oh yeah? And what did he have to say about your forty-year-old
-ass?"
- "Nothing," she replied. "Your name didn't come up at all."
-%
- "My husband commits an inconceivable act of perversion with a
-barnyard animal, and it's not central to my case?!"
- "Not in California."
-%
- "My mother," said the sweet young steno, "says there are some things
-a girl should not do before twenty."
- "Your mother is right," said the executive, "I don't like a large
-audience, either."
-%
- Never ask your lover if he'd dive in front of an oncoming train for
-you. He doesn't know. Never ask your lover if she'd dive in front of an
-oncoming band of Hell's Angels for you. She doesn't know. Never ask how many
-cigarettes your lover has smoked today. Cancer is a personal commitment.
- Never ask to see pictures of your lover's former lovers -- especially
-the ones who dived in front of trains. If you look like one of them, you are
-repeating history's mistakes. If you don't, you'll wonder what he or she saw
-in the others.
- While we are on the subject of pictures: You may admire the picture
-of your lover cavorting naked in a tidal pool on Maui. Don't ask who took
-it. The answer is obvious. A Japanese tourist took the picture.
- Never ask if your lover has had therapy. Only people who have had
-therapy ask if people have had therapy.
- Don't ask about plaster casts of male sex organs marked JIMI, JIM, etc.
-Assume that she bought them at a flea market.
- -- James Peterson and Kate Nolan
-%
- "Never send a MAN to do a WOMAN'S work!"
- "Why do you think I CAME here?"
- "Not for the good of my ego, that was for damn sure."
-%
- Never take a resume seriously. Resumes only make money for the
-people who write the resumes. No resume ever tells an employer how many
-times a job applicant has had the clap.
- Why, indeed, would anyone hire a person based on a resume written
-by a professional liar?
- If the applicant is a man, the employer must ask only one question:
-did the applicant go to TCU?
- If the applicant is a woman, the employer may simply ask: does she
-have a tongue that can lick the paint off a dormitory wall?
- -- Dan Jenkins, "Baja Oklahoma"
-%
- On the occasion of Nero's 25th birthday, he arrived at the Colosseum
-to find that the Praetorian Guard had prepared a treat for him in the arena.
-There stood 25 naked virgins, like candles on a cake, tied to poles, burning
-alive. "Wonderful!" exclaimed the deranged emperor, "but one of them isn't
-dead yet. I can see her lips moving. Go quickly and find out what she is
-saying."
- The centurion saluted, and hurried out to the virgin, getting as near
-the flames as he dared, and listened intently. Then he turned and ran back
-to the imperial box. "She is not talking," he reported to Nero, "she is
-singing."
- "Singing?" said the astounded emperor. "Singing what?"
- "Happy birthday to you, happy birthday to you..."
-%
- Once in a medieval times...there was a King who was getting sort of
-bored after dinner one night. He decided to hold a contest of who at the
-court had the mightiest "weapon". The first knight stood up and proclaimed
-that he had the mightiest weapon... he pulled down his pants and tied a 5
-pound weight around it. The weapon doth rose. The crowds cheered... the
-women swooned... the children waved multi-colored banners... and the band
-played appropriate music.
- Another knight stood up and claimed that he had the mightiest weapon.
-He dropped his pants and tied a 10 pound weight to himself. The weapon doth
-rose. The crowds cheered... the women swooned... the children waved
-multi-colored banners... and the band played appropriate music.
- After several more knights tried to prove their superiority... the
-King finally spoke out. "I have the mightiest weapon of them all!" He dropped
-his pants and tied, not a 10 pound, not a 20 pound, not ever a thirty pound,
-but a 40 pound weight, plus a coffee pot, to himself. The weapon doth rose.
-The crowds cheered... the women swooned... the children waved multi-colored
-banners... and the band played "God Save the Queen."
-%
- One day a mother and daughter are walking around a farming community
-and they see a stallion mounting a mare. The daughter takes in the scene and
-turns to her mother. "Mommy, what are those two horses doing?"
- Her mother hastily answered, "The horse on top hurt its hoof, and the
-one on the bottom is carrying him back to the stable."
- The daughter shook her head and sadly replied, "Isn't that just the
-way it goes? Try to help someone and you get fucked."
-%
- One night when his charge was pretty high, Micro-Farad decided to
-seek out a cute little coil to let him discharge. He picked up Milli-Amp
-and took her for a ride on his Megacycle. They rode across the Wheatstone
-bridge, around the sine waves, and stopped in the magnetic field by the
-flowing current. Micro-Farad, attracted by Milli-Amp's characteristic curves,
-soon had her fully charged and excited, her resistance to a minimum. He laid
-her on the ground potential, raised her frequency, and lowered her reluctance.
-He pulled out his high voltage probe and inserted it into her socket,
-connecting them in parallel and began short circuiting her resistance shunt.
-Fully excited, Milli-Amp mumbled: "OHM-OHM-OHM."
- With his tube operating at a maximum and her field vibrating with
-his current flow, it caused her shunt to overheat, and Micro-Farad was rapidly
-discharged and drained of every electron. They Fluxed all night trying
-various connections and sockets until his magnet had a soft core and lost
-all of its field strength.
- Afterwards, Milli-Amp tried self-induction and damaged her solenoids.
-With his battery fully discharged, Micro-Farad was unable to excite his field,
-so they spent the night reversing polarity and blowing each others fuses.
- -- Eddie Currents, "The Sex Life of an Electron"
-%
- One of my favorite Zoo jokes has to do with a woman who, while
-visiting the zoo, decided to have a little fun with the Gorilla. She walks
-up to his cage, reaches in, and begins to fondle the beast. Needless to
-say, the animal becomes quite excited, and as he tries to reciprocate in
-kind, the woman steps back and gives him a raspberry...!
- The gorilla becomes enraged. He rips the bars from his cage, grabs
-the woman, drags her back into the cage, and ravishes her. While doing so,
-he inflicts a great deal of harm upon her person.
- Later, at the hospital, a neighbor of the woman visits and exclaims,
-"Oh, you poor dear...! Are you hurt?"
- "Hurt!", "Hurt!?" the injured lady sobs, "He doesn't phone. He
-never writes..."
-%
- One PAYDAY, MR. GOODBAR wanted a BIT O' HONEY. So he took his Miss
-HERSHEY behind the POWERHOUSE on the corner of 5th AVENUE and CLARK where he
-there began to feel her MOUNDS. And that was an ALMOND JOY which definitely
-made his TOOTSIE ROLL.
- He let out a SNICKER as he slipped his BUTTERFINGER up her KIT KAT
-which of course caused the MILKY WAY. She screamed "OH, HENRY!" as she
-squeezed his PETER, PAUL and ZAGNUTS and said "you're better then the 3
-MUSKETEERS."
- -- John Volby (Dr. Dirty), "The Candy Bar Poem"
-%
- One spring evening, after a hard rain, grandpa and grandson were
-sitting out on the porch, talking. Grandpa spied a worm crawling up out
-of its hole and said to his grandson, "Sonny, if you can get that there
-worm back down its hole, I'll give you five dollars."
- "Sure!", says sonny, and runs in the house. Out he runs an
-instant later with a can of hairspray, grabs the worm, and sprays it with
-the hairspray as it dangles earthward. He then slips the stiff worm back
-into its hole and turns to his grandpa with a huge smile on his face.
- "Well, I'll be. That was pretty smart there, boy.", he says.
-"Here's your fiver.", he adds as he fishes out a bill. By then it's almost
-dark, and they say their goodnights and part.
- The next day sonny's playing out on the porch, and grandpa comes
-out of the house and gives him a five. "But you gave me my five yesterday,
-grandpa.", he remarks.
- "Yep, I know. This is from your Grandma."
-%
- "Our school, madame, postulates, first of all, that since the
-science of mathematics is an abstract science, it is best inculcated by
-some concrete example."
- Said the Queen, "But that sounds rather complicated."
- "It occasionally leads to complications," Jurgen admitted, "through
-a choice of the wrong example. But the axiom is no less true."
- "Come, then, and sit next to me on this couch if you can find it in
-the dark; and do you explain to me what you mean."
- "Why, madame, by a concrete example I mean one that is perceptible
-to any of the senses -- as to sight or hearing, or touch --"
- "Oh, oh!" said the Queen, "now I perceive what you mean by a concrete
-example. And grasping this, I can understand that complications must of
-course arise from a choice of the wrong example."
- -- James Branch Cabell, "Jurgen"
-%
- Out on the great American desert one day, a bald eagle reached a
-state of great libidal distress. Pickings were slim, but in time, he saw a
-dove flying by. "Better than nothin'", he muttered (birds in jokes can mutter)
-and swooped down, grabbed the dove and flew to his nest. Feathers flew, and
-eventually the dove tottered to the edge of the cliff and shouted (yes, they
-shout, too):
- "I'm a dove! I've been loved! And I LIKE it!"
- Well, this took care of the old boy for a while but soon enough he
-was at it again. All he could find was a lark, so away he went, and feathers
-flew and soon the lark tottered to the edge of the cliff and shouted:
- "I'm a lark! I've been sparked! And I LIKE it!"
- As you can guess, some time later our friend was again in need of
-amor... lib... you know! This time, all that happened by was... a duck!
-So down he swooped, and feathers flew, and the next thing seen is the duck
-tottering to the cliffside and shouting:
- "I'M A DRAKE! THERE'S BEEN A MISTAKE! AND I DON'T LIKE IT!!!
-%
- Overheard in a bar:
-Man: "Hey, Baby, I'd sure like to get in your pants!"
-Woman: "No, thanks, I've already got one ass-hole in there now."
-%
- People who claim to know jackrabbits will tell you they are primarily
-motivated by Fear, Stupidity and Craziness. But I have spent enough time in
-jackrabbit country to know that most of them lead pretty dull lives; they are
-bored with their daily routines: eat, fuck, sleep, hop around a bush now and
-then... No wonder some of them drift over the line into cheap thrills once in
-a while; there has to be a powerful adrenaline rush in crouching by the side of
-a road, waiting for the next set of headlights to come along, then streaking
-out of the bushes with split-second timing and making it across to the other
-side just inches in front of the speeding front wheels.
- Why not? Anything that gets the adrenaline moving like a 440 volt
-blast in a copper bathtub is good for the reflexes and keeps the veins free
-of cholesterol ... but too many adrenaline rushes in any given time-span has
-the same bad effect on the nervous system as too many electro-shock treatments
-are said to have on the brain: after a while you start burning out the
-circuits.
- When a jackrabbit gets addicted to road running, it is only a matter
-of time before he gets smashed -- and when a journalist turns into a politics
-junkie he will sooner or later start raving and babbling in print about things
-that only a person who has Been There can possibly understand.
- -- Hunter S. Thompson, "Fear and Loathing:
- On the Campaign Trail"
-%
- People who write position papers often find themselves in an
-enviable position. They are hired to write papers for both sides of the
-position.
- A good position paper will have many words in it like
-"superincumbence," "egress," and "plurification."
- You will not often find the phrase "lightweight dropcase
-limp-wristed motherfucker" in a serious position paper.
- Charts and multiplication tables should always be included in
-position papers. They should look complicated enough to make Albert
-Einstein stagger across the room for a Tylenol.
- A good position paper will never underestimate the value of a
-semicolon.
- -- Dan Jenkins, "Baja Oklahoma"
-%
- Rosenberg wanted to leave the country. "And what is *your*
-reason?" asks the official at the Passport Office.
- "I am told a pogrom is being prepared. Against the Jews and
-the barbers," replies Rosenberg.
- "Why the barbers?"
- "Everybody asks that question. That's why I want to leave."
-%
- Santa Claus comes down the chimney and the nubile sixteen-year-old
-has been waiting for him. Santa sees her, and in typically unflappable
-Santa-style says, "And what do you want for Christmas, little girl?"
- The girl, and she's not so little, tells him. Well, Santa is
-definitely flapped by this, but he manages to come out with, "Ho ho ho,
-gotta go, gotta get the children their toys, you know."
- The girl, not to be daunted, takes off her robe. "Aw, please stay
-Santa," she begs.
- He replies, "Ho ho ho, gotta go, gotta get the children their toys,
-you know."
- She then takes off her pajama top, her firm pouting breasts pointing
-at Santa like an accusation. "Aw, please stay Santa," she pleads.
- "Ho ho ho, gotta go, gotta get the children their toys, you know."
- Finally, she takes off her pajama bottoms, revealing to Santa her
-warm mound of delight. "Aw, please stay, Santa," she begs.
- Being only mortal, Santa finally gives in, sighing, "Hey hey hey,
-gotta stay, can't get up the chimney with my dick this way."
-%
- Sentenced to two years hard labor (for sodomy), Oscar Wilde
-stood handcuffed in driving rain waiting for transport to prison. "If
-this is the way Queen Victoria treats her prisoners," he remarked, "she
-doesn't deserve to have any."
-%
- Shortly after arriving at their honeymoon destination, the
-still-nervous groom became worried about the state of his bride's innocence.
-Deciding on a direct confrontation, he quickly undressed, pointed at his
-exposed manhood and asked his mate, "Do you know what this is?"
- Without hesitation, she blushingly answered, "That's a wee-wee."
- Delighted at the idea of instructing his naive wife in the ways of
-love, the husband whispered, "From now on, dearest, this will be called a
-prick."
- "Oh, come now," the girl chided. "I've seen lots of pricks and I
-assure you, that's a wee-wee."
-%
- Shortly after Churchill had grown a moustache, he was accosted by a
-certain young lady whose political views were in direct opposition to his
-own. Fancying herself something of a wag, she exclaimed, "Mr. Churchill, I
-care for neither your politics nor your moustache." Unabashed, the young
-statesman regarded her quietly for a moment, then wryly commented, "Suck my
-dick."
- -- "The Churchill Wit", National Lampoon
-%
- "Sir", said the beggar, "can you spare fifty dollars for a cup of
-coffee?"
- "Fifty dollars for a cup of coffee, one should be sufficient!",
-answered the gentleman, rather shortly.
- "I know", replied the beggar, "but coffee always makes me horny."
-%
- So this traveling salesman got an audience with the Pope.
-"Hey, father," he said, "have you heard the joke about the two Polacks
-who --"
- "My son," the Pope reminded him, "I'm Polish."
- The salesman thought for a moment. "That's okay, Father," he
-said. "I'll tell it very slowly."
-%
- "That wife of mine is a liar," said the angry husband to a
-sympathetic pal seated next to him in a bar.
- "How do you know?" the friend asked.
- "She didn't come home last night, and when I asked her where
-she'd been she said she'd spent the night with her sister Shirley."
- "So?"
- "So, she's a liar. I spent the night with her sister Shirley."
-%
- The big problem with pornography is defining it. You can't
-just say it's pictures of people naked. For example, you have these
-primitive African tribes that exist by chasing the wildebeest on foot,
-and they have to go around largely naked, because, as the old tribal
-saying goes: "N'wam k'honi soit qui mali," which means, "If you think
-you can catch a wildebeest in this climate and wear clothes at the same
-time, then I have some beach front property in the desert region of
-Northern Mali that you may be interested in."
- So it's not considered pornographic when National Geographic
-publishes color photographs of these people hunting the wildebeest
-naked, or pounding one rock onto another rock for some primitive reason
-naked, or whatever. But if National Geographic were to publish an
-article entitled "The Girls of the California Junior College System
-Hunt the Wildebeest Naked," some people would call it pornography. But
-others would not. And still others, such as the Spectacularly Rev.
-Jerry Falwell, would get upset about seeing the wildebeest naked.
- -- Dave Barry, "Pornography"
-%
- The defense attorney was hammering away at the plaintiff: "You
-claim," he jeered, "that my client came at you with a broken bottle in
-his hand. But is it not true, that you had something in YOUR hand?"
-
- "Yes," he admitted, "his wife. Very charming, of course, but
-not much good in a fight."
-%
- The devout Jew was beside himself because his son had been dating
-a shiksa, so he went to visit his rabbi. The rabbi listened solemnly to
-his problem, took his hand, and said, "Pray to God."
- So the Jew went to the synagogue, bowed his head, and prayed, "God,
-please help me. My son, my favorite son, he's going to marry a shiksa, he
-sees nothing but goyim..."
- "Your son," boomed down this voice from the heavens, "you think
-you got problems. What about my son?"
-%
- The doctor had just finished giving the young man a thorough
-physical examination. "The best thing for you to do," the M.D. said,
-"is give up drinking, give up smoking, get to bed early and stay away
-from women."
- "Doc, I don't deserve the best," pleaded his patient. "What's
-second best?"
-%
- The famous Nell Gwynn, stepping one day from a house where she had
-made a short visit into her coach, saw a great crowd assembled, and her
-footman all bloody and dirty; the fellow being asked by his mistress, the
-reason for his being in that condition, answered, "I have been fighting,
-madam, with an impudent rascal who called your ladyship a whore."
- "You blockhead," replied Mrs. Gwynn, "at this rate you must fight
-every day of your life; why, you fool, all the world knows it."
- "Do they?" cries the fellow, in a muttering voice, after he had shut
-the coach door, "they shan't call me a whore's footman for all that."
- -- Henry Fielding, "Tom Jones"
-%
- The foreman of a lumber camp put a new workman on the circular saw.
-As he turned away, he heard the man say, "Ouch!".
- "What happened?"
- "Dunno," replied the man. "I just stuck out my hand like this, and
--- well, I'll be damned. There goes another one!"
-%
- The Gray-haired Woman's Complaint
-
-My back aches, my pussy is sore;
-I simply can't fuck any more;
- I'm covered with sweat,
- And you haven't come yet,
-And my God, it's a quarter to four!
-%
- The honeymooning couple agreed it was a fine day for horseback riding.
-After a mile or so, the bride's mount cantered under a low tree and a
-branch scraped her forehead lightly. The groom dismounted, glared at his
-wife's horse, and said, "That's number one."
- The ride then proceeded. After another mile or so, the bride's
-horse stumbled over a pebble and the lady suffered a slight jostling.
-Again, her man leapt from his saddle and strode over to the nervous animal.
-"That's two," he said.
- Five miles later, the bride's horse became frightened when a rabbit
-crossed its path, reared up and threw the girl. Immediately, the groom was
-off his horse. "That's three!", he shouted, and, pulling out a pistol, he
-shot the horse between the eyes.
- "You brute!" shrieked his bride. "Now I see the kind of man I
-married! You're a sadist, that's what!"
- The groom turned to her coolly. "That's one," he said.
-%
- The man standing at the bar (in court, unfortunately) was well-
-dressed, alert and obviously intelligent. The judge asked him how he
-pleaded to the charge of rape and, much to the magistrate's surprise, he
-replied, "Not guilty by reason of insanity, your Honor."
- "Insanity?" exclaimed the judge.
- "Yes, sir," said the defendant. "I'm just crazy about it."
-%
- The new patron was amazed by the cleanliness of the restaurant. A
-waiter approached the table. "Good afternoon, sir. What may I serve you?"
- "I'll have the steak dinner," the man answered.
- As the waiter headed for the kitchen, the diner noticed that he
-wore a spotless white apron and clean white gloves. Soon the waiter
-returned, bearing a casserole dish on a cart which he uncovered to reveal
-two tempting filet mignons. From a covered pocket in his apron he produced
-a small pair of shining silver tongs and with them he transferred the meat
-from the steaming casserole to the diner's plate. "We never touch anything
-with our hands," he explained.
- The waiter continued serving. "Confidentially," he said, "we even
-have a special set of rules about visiting the lavatory. Do you see this
-little piece of string attached to my apron?"
- "Yes," the diner replied. "I noticed that all the aprons had one."
- The waiter put a large browned potato on the plate with his tongs.
-"Well," he began, "if I should have to go to the bathroom, that string
-comes in very handily. I simply unzip my pants and take it out with that
-piece of string. That way everything stays sanitary."
- "But how do you put it back?"
- "Well, I don't know about the other guys," the waiter confided, "but
-I use the tongs."
-%
- The old mailman is making his last rounds; he retires at the end of
-the week. As he approaches the Jones' house, Mrs. Jones greets him warmly at
-the door. "Please come in! We're very grateful for your years of service to
-us and our neighborhood. I've prepared something special for you."
- In walks the mailman, to a graciously appointed dining room, where
-Mrs. Jones has prepared a sumptuous lunch. After dumping his letter satchel
-on the couch, he and Mrs. Jones have a charming meal. As the mailman finished
-his last glass of wine, thanking his hostess profusely, she stops him from
-leaving and disappears upstairs. She returns in a moment, in a daring
-negligee, and takes the astonished postman to the bedroom, where the elaborate
-farewell is consummated between the sheets.
- As he's putting his pants on, Mrs. Jones reaches into her nightstand,
-pulls out a dollar bill, and hands it to him. Reacting to his astonished
-look, she says, "Well, I told my husband that you were retiring and that
-we should do something for you. He said 'Fuck him. Give him a dollar!'"
-She pauses and smiles proudly. "The lunch was MY idea."
-%
- The other day my girlfriend and I were going to a party and on the
-way there, we got a flat tire. We got out of the car and I pumped, she
-jacked I pumped, she jacked, I pumped, she jacked and then we changed the
-tire. Eventually we arrived at the party and when we walked in, everyone was
-jumping for joy. What a sight seeing her hanging nude from the chandelier!
-Well the party was OK, I guess, we just sat around drinking sherry and eating
-candy. Everybody else started feeling merry. Those have got to be the three
-wildest girls I know.
-%
- The people of Halifax invented the trampoline. During the Victorian
-period the tripe-dressers of Halifax stretched tripe across a large wooden
-frame and jumped up and down on it to `tender and dress' it. The tripoline,
-as they called it, degenerated into becoming the apparatus for a spectator
-sport.
- The people of Halifax also invented the harmonium, a device for
-castrating pigs during Sunday service.
- -- Mike Harding, "The Armchair Anarchist's Almanac"
-%
- The radio was screaming: "Power to the People -- Right On!" John
-Lennon's political song, ten years too late. "That poor fool should have
-stayed where he was," said my attorney. "Punks like him only get in the
-way when they try to be serious."
- "Speaking of serious," I said. "I think it's about time to get
-into the ether and the cocaine."
- "Forget ether," he said. "Let's save it for soaking down the rug
-in the suite. But here's this. Your half of the sunshine blotter. Just
-chew it up like baseball gum."
- I took the blotter and ate it. My attorney was now fumbling with
-the salt shaker containing the cocaine. Opening it. Spilling it. Then
-screaming and grabbing at the air, as our fine white dust blew up and out
-across the desert highway. A very expensive little twister rising up from
-the Great Red Shark. "Oh, Jesus!" he moaned. "Did you see what God just
-did to us?"
- -- Raoul Duke, "Rolling Stone", issue 95, Nov. 11, 1971
-%
- The Split-Atom Blues
-
-Gimme Twinkies, gimme wine,
- Gimme jeans by Calvin Klein ...
-But if you split those atoms fine,
- Mama keep 'em off those genes of mine!
-
-Gimme zits, take my dough,
- Gimme arsenic in my jelly roll ...
-Call the devil and sell my soul,
- But Mama keep dem atoms whole!
- -- Milo Bloom, "Bloom County"
-%
- THE TEN STAGES OF INTOXICATION
-
- 1. WITTY AND CHARMING: This is after one or two drinks. The tongue is
- loosened and can yet remain in step with the brain. In the "witty
- and charming" state, one is likely to use foreign idioms and
- phrases such as "au contraire" in place of "No way, Jose" or
- "Bullsheyet".
- 2. RICH AND POWERFUL: By the third drink, you begin mentioning the little
- 380 SL you've had your eye on down at the Mercedes place.
- 3. BENEVOLENT: You'll buy her a Mercedes, too. It's only money.
- 4. JUST ONE MORE AND THEN WE'LL EAT: Stall tactic.
- 5. TO HELL WITH DINNER: Just one more and then we'll eat.
- 6. PATRIOTIC: The war stories begin.
- 7. CRANK UP THE "ENOLA GAY": "We could have won in Nam, but..."
- 8. INVISIBLE: So this is what the Ladies' Room looks like.
- 9. WITTY AND CHARMING PART II: You know, you don't sweat much for a fat girl.
-10. BULLETPROOF: Bull-sheyet, gimme them keys, I can drive.
- -- Lewis Grizzard, "My Daddy Was a Pistol and I'm a Son
- of a Gun".
-%
- The young male race horse came from a long line of winners, and did
-wonderfully in time trials. However, in actual races he proved a little too
-romantic, and could never quite bring himself to pass a mare.
- So one day the trainer went to him and told him he'd have to be
-castrated. The young horse, knowing that it was either this or the glue
-factory, took it philosophically. After all, having the operation was
-almost a certain guarantee of a long and illustrious racing career.
- After a short recovery period, the horse was again run in time
-trials, and found to do as well as ever. But the first time he actually
-ran in a race, he only went about ten paces, before getting a dejected look
-on his face, turning around, and ambling back to the starting gates.
- "What's the matter?" asked the trainer, "you were doing great!"
- "Yeah, well how would you feel" replied the horse, "if five thousand
-people took one look at you and shouted `they're off!'?"
-%
- The young man took a blind date to the amusement park. They went
-for a ride on the Ferris wheel. The ride completed, she seemed rather bored.
-"What would you like to do next?" he asked.
- "I wanna get weighed," she said. So he took her over to the weight
-guesser. Next they rode the roller coaster. After that he bought her some
-popcorn and cotton candy, then he asked what else she would like to do.
- "I wanna get weighed," she said, bluntly.
- I really latched onto a square one tonight, thought the boy, and
-using the excuse that he had developed a headache, he took the girl home.
-The girl's mother was surprised to see her home so early, and asked, "What's
-wrong, dear, didn't you have a nice time tonight?"
- "Wousy," said the girl.
-%
- Them Toad Suckers
-
-How 'bout them toad suckers, ain't they clods?
-Sittin' there suckin' them green toady frogs!
-
-Suckin' them hop toads, suckin' them chunkers,
-Suckin' them a leapy type, suckin' them flunkers.
-
-Look at them toad suckers, ain't they snappy?
-Suckin' them bog frogs sure make's 'em happy!
-
-Them hugger mugger toad suckers, way down south,
-Stickin' them sucky toads in they mouth!
-
-How to be a toad sucker, no way to duck it,
-Get yourself a toad, rear back, and suck it!
- -- Mason Williams
-%
- There are two couples that want to convert to Catholicism. They go
-and see a priest and he tells them that the first requirement is to abstain
-from sex for thirty days.
- Thirty days later, the couples come back to see the priest. He asks
-the first couple if they passed the test.
- "Father, we didn't so much as TOUCH one another during the last month.
- "Congratulations," the priest replies, "you are now qualified to enter
-the Church." Then, the priests asked the second couple how they did.
- "Well, Father," the husband says, "everything was going just fine
-until the 27th day. My wife bent over the freezer to get something out, and
-I just happened to notice that she didn't have any panties on. I couldn't
-stand it any more, so I walked over to her, dropped my pants, and slipped it
-to her right there."
- "That's DISGUSTING!", the priest bellows. "I can never let you into
-the Church after something like that."
- "I understand Father," the man replies sadly, "they won't let us
-into Safeway anymore either."
-%
- There was an Englishman, a Frenchman, and a Newfoundlander sitting in
-a bar having a few drinks together.
- The Englishman turns to the Frenchman, "So tell me, what do you do to
-drive your wife wild in bed?"
- "Well", replies the Frenchman, "After we make love, I go out to the
-garden and pick some roses. Then I take the petals off and put them all over
-her body. then I gently blow them off with a soft, even breath, and that drives
-her wild with desire."
- "Interesting," the Englishman replies. "After my wife and I make love
-I massage baby oil gently all over her body -- that works for me!"
-Then the pair turn to the Newfie and ask him what he does.
- "Well...", he says, "when me and the old lady are through, I jump
-out of bed and wipe my dick off on the curtain. And that REALLY drives
-her wild."
-%
- These two project managers were walking through a residential area
-one day, when they saw a dog (also male) sitting on a lawn, licking its
-cock. (Why do dogs do that? Because they can). Anyway, the first manager
-nudged the second and said, "Hey, look at that! That really looks like fun
--- I wish I could do that!"
- Whereupon the second manager replied, "Well, I don't know... I tried
-it once, and the damn dog bit me!"
-%
- "They spend years searching for their natural parents, convinced their
-parents will be happy to see them. I mean, really, can you imagine someone
-being happy to see an orphan? Nobody wants them... that's why they're orphans!"
- The speaker is Anne Baker, founder and guiding force behind
-Orphan-Off, an organization dedicated to keeping orphans confused about the
-whereabouts of their natural parents. She is a woman with a mission:
- "Basically, what we do is band together to exchange information
-about which orphans are looking for which parents in what part of the
-country. We're completely computerized.
- "The idea is to throw the orphans as many red herrings and false
-leads as possible. We'll tell some twenty-three-year-old loser that his
-real parents can be found at a certain address on the other side of the
-country. Well, by the time the kid shows up, the family is prepared. They
-look over the kid's photos and information and they say, 'Oh, the Emersons...
-yeah, they used to live here... I think they moved out about five years ago.
-I think they went to Iowa, or maybe Idaho.'
- "Bam, the door shuts in the kid's face and he's back to zero again.
-He's got nothing to go on but the orphan's pathetic determination to continue.
- "It's really amazing how much these kids will put up with. Last year
-we even sent one kid all the way to Australia. I mean, really. Besides, if
-your natural parents were Australian, would you want to meet them?"
- -- "National Lampoon", September, 1984
-%
- This 600-pound guy decides he can't go on living this way, so he seeks
-the help of a clinic and proceeds to go on a drastic diet. It works: four
-months later he's down to 160 pounds and feeling great, except for one problem.
-He's covered with great folds of flesh where the fat used to be. He calls
-up the clinic, and the doctor tells him not to worry. "There's a special
-surgical procedure to correct this condition," the doctor assures him. "Just
-come on over to the clinic."
- "But doctor," the man pleads, "you don't understand. I'm too
-embarrassed to be seen in public like this."
- "Don't give it another thought," says the doctor. "Simply pull up
-all the folds as high as they'll go, pile the flesh on top of your head, put
-on a top hat, and come on over."
- The guy follows the instructions and provokes no comments until he
-reaches the clinic and is standing in front of the admitting nurse's desk,
-dying of self-consciousness. "The doctor will be right with you," says the
-nurse. "Say, what's that hole in the middle of your forehead?"
- "My navel," blurts out the guy, "how d'ya like my tie?"
-%
- This guy is taking a leak in a public men's room when a man enters
-with his arms held out from his sides, bent at the elbows with his hands
-dangling awkwardly, and comes over to him.
- "Would you do me a favor and unzip my fly?" he asks.
- Figuring the man to be a poor cripple, perhaps an accident victim,
-the guy obliges, not without a flush of embarrassment when the man next
-requests that he take out his prick and hold it in the appropriate position.
- "Shake it off" is the next instruction, then "zip me up," and the
-guy follows orders, wincing at his own embarrassment and at the shame of
-being so helpless.
- "Say, thanks," says the man, flouncing to the door. "I can't do a
-*thing* 'til my nails dry!"
-%
- This guy is walking down the beach one fine sunny day, feeling
-good, when suddenly he sees this woman with no arms or legs in a wheelchair,
-sobbing like crazy. He decides to be gallant, "What's wrong, miss?"
- "I...<sob, sniffle>...I'm 21 and I <choke> I've never been kissed...
-<sniffle>"
- So this guy, he decides, what the hell, let's cheer up the poor lady.
-He leans over and gives her a long wonderful kiss. This does wonders, and
-the woman's face lights up and she grins from ear to ear, and the guy wanders
-away feeling wonderful.
- Well, next week, the same guy is walking along the same beach, and
-sees the same girl who is once again sobbing her eyes out. Gallant to the
-end, our hero says, "What's wrong, miss, can I help?"
- "I...I'm <sob, sniffle, sniffle> 21 and I've never been fucked..."
- The guy picks her up out of her chair, cuddles her close, and brings
-her over to the shore, and throws her into the water. "Now you're fucked!"
-%
- Three women and Feldstein were brought before the presiding judge.
-The women had been arrested for soliciting and he'd been was arrested for
-selling ties without a license. "What do you do for a living?" the judge
-asked, pointing at the first girl.
- "Your honor, I'm a model," she replied.
- "Thirty days," was the sentence. The judge turned to the second
-girl. "What do you do for a living?" he asked.
- "Your honor, I'm an actress."
- "Thirty days." Then he turned to the third girl. "And how about
-you?" he demanded.
- "Well, your honor, I'm a prostitute. I'm not proud of it, but it's
-the only way I can support my mother and my children since my husband's been
-laid off."
- "For telling the truth," he said, "I'm going to suspend sentence.
-Furthermore, here's $100 to help your family out." Now he turns to Feldstein,
-arrested for selling ties illegally. "And you," he said, "what do you do
-for a living?"
- "Your honor, I'm a prostitute. I'm not proud..."
-%
- Two buddies had been out drinking for hours when their money finally
-ran out. "I have an idea," croaked Al. "Lesh go over to my housh and borrow
-shum money from my wife."
- The two of them reeled into Al's living room, snapped on the light,
-and lo and behold, there was Al's wife making love on the sofa to another man.
-This state of affairs considerably unnerved Al's friend but didn't seem to
-affect the husband.
- "Shay, dear, you have any money for your ever-lovin' hushban?" he
-asked.
- "Yes, yes," she snapped. "Take my purse from the mantle, and for
-Pete's sake, turn off those lights."
- Outside they examined the purse, and Al proudly announced, "There's
-enough here for a pint for you and a pint for me. Pretty good, eh, old buddy?"
- "But, Al," protested his friend, somewhat sobered by the spectacle
-he'd just witnessed, "what about that fellow back there with your wife?"
- "The hell with him," replied Al. "Let him buy his own pint."
-%
- Two Englishmen struck up a conversation with an American in the club
-car of a train headed east out of Chicago.
- "I say," queried the younger Englishman, "have you ever been to
-London?"
- The American laughed. "It was my home for two years during the war,"
-he said. "Had some of the wildest times of my life in that old town."
- The older Englishman, a little hard of hearing, asked, "What did
-he say, Reggie?"
- "He said he's been to London, father," the younger Englishman
-replied.
- After a little lull in the conversation, the young man asked, "You
-didn't, by any chance, meet a Hazel Wimbleton in London, did you?"
- The American almost fell off his chair. "Hot Pants Hazel!" he
-exclaimed. "My God, I shacked up with that horny broad for three months
-just before I came back to the States!"
- "What did he say, Reggie?" the older Englishman wanted to know.
- "He says he knows Mother," the younger Englishman responded.
-%
- Two gay guys, Larry and Phil, were driving down the highway when they
-were rear-ended by a huge semi. Somewhat shaken, they maneuvered over to the
-side of the road, where Phil instructed Larry to get out and confront the truck
-driver. "Tell him we're going to sue, sue, sue!" he shrieked.
- Obligingly, Larry got out and went around to the cab of the truck to
-deliver this message to the huge, burly driver, whose response was to snarl,
-"Ah, why doncha suck my cock."
- "Phil," said Larry, coming back to their car, "I think we're going
-to be able to settle out of court."
-%
- Two little kids, aged six and eight, decide it's time to learn
-how to swear. So, the eight-year-old says to the six-year-old, "Okay,
-you say `ass' and I'll say `hell'".
- All excited about their plan, they troop downstairs, where
-their mother asks them what they'd like for breakfast.
- "Aw, hell," says the eight-year-old, "gimme some Cheerios."
-His mother backhands him off the stool, sending him bawling out of the
-room, and turns to the younger brother. "What'll you have?"
- "I dunno," quavers the six-year-old, "but you can bet your ass
-it ain't gonna be Cheerios."
-%
- Two longtime friends sipped Scotch in a local bar and talked about
-their troubles. "And on top of everything else," said the first, "my wife
-has cut me down to just once a week."
- "That's too bad," agreed his friend, "but it could be worse. I know
-two guys she's cut off altogether.
-%
- Two morticians alternated in sharing the responsibility of covering
-the night shift. One early morning about 3:00 am, a body was brought into the
-mortuary, and the mortician began work. When he had unclothed the corpse, he
-noticed a cork in the anus. Removing it, the strains of "Hello, Dolly, well,
-hello, Dolly...!" were plainly heard being sung. He put the cork back, and
-the singing stopped. Pulling it out again, the same song started, "You're
-lookin' swell, Dolly!". Amazed, he telephoned his partner, and insisted he
-come immediately to see something very unusual. Roused from sleep, the partner
-asked if it could wait until morning. It took great persistence, but finally
-the partner agreed to dress and come down to the shop. When he got there, he
-said, "Now what was it that was so important you had to get me out of bed at
-this ungodly hour?"
- The man said, "Come into the embalming room."
- They go into the embalming room, and the first partner says, "Now
-watch."
- He pulls out the cork, and the anus takes off singing again. The
-partner looks at him disgustedly and says: "You brought me down here at
-three in the morning just to hear some asshole sing Hello Dolly"?
-%
- Two women were walking down the street, when one nudges the other
-and says, "There's my husband coming out of the florist's with a dozen
-roses, damn it. That means I'll have to keep my legs up in the air for
-three days."
- Replies her friend, "Well, why don't you buy a vase?"
-
-%
- We were somewhere around Barstow on the edge of the desert when the
-drugs began to take hold. I remember saying something like "I feel a bit
-lightheaded; maybe you should drive ..." And suddenly there was a terrible
-roar all around us and the sky was full of what looked like huge bats, all
-swooping and screeching and diving around the car, which was going about a
-hundred miles an hour with the top down to Las Vegas. And a voice was
-screaming: "Holy Jesus! What are these goddamn animals?"
- Then it was quiet again. My attorney had taken his shirt off and
-was pouring beer on his chest, to facilitate the tanning process. "What the
-hell are you yelling about?" he muttered, staring up at the sun with his
-eyes closed and covered with wraparound Spanish sunglasses. "Never mind,"
-I said. "It's your turn to drive." I hit the brakes and aimed the Great
-Red Shark toward the shoulder of the highway. No point in mentioning the
-bats, I thought. The poor bastard will see them soon enough.
- -- Hunter S. Thompson, "Fear and Loathing in Las Vegas:
- A Savage Journey to the Heart of the American Dream"
-%
- Well, there was this tiger, who woke up one morning, and just
-felt great (yes, just like Tony the Tiger: GREAAAAAAT). Anyway,
-he just felt so good, he went out and cornered a small monkey and
-roared at him: "WHO IS THE MIGHTIEST OF ALL THE JUNGLE ANIMALS?"
- And this poor quaking little monkey replied: "You are of
-course, no one is mightier than you."
- A little while later this tiger confronts a deer, and just
-bellows out: "WHO IS THE GREATEST AND STRONGEST OF ALL THE JUNGLE
-ANIMALS?"
- The deer is shaking so hard it can barely speak, but manages
-to stammer: "Oh great tiger, you are by far the mightiest animal in the
-jungle."
- The tiger, being on a roll, swaggered, up to an elephant that
-was quietly munching on some weeds, and roared at the top of his voice:
-"WHO IS THE MIGHTIEST OF ALL THE ANIMALS IN THE JUNGLE?" Well, this
-elephant grabs the tiger with his trunk, picks him up, slams him down;
-picks him up again, and shakes him until the tiger is just a blur of
-orange and black; and finally throws him violently into a nearby tree.
-The tiger staggers to his feet and looks at the elephant and says:
-"Man, just because you don't know the answer, you don't have to get so
-pissed."
-%
- Well, this woman went to the butcher shop to get some ham for dinner.
-She asked the butcher what kind of ham he recommended, and the butcher said,
-"Well ma'am, we got some Damn ham here for $3.50 a pound..." Needless to
-say, she was surprised at the butcher's language! The butcher, who was
-reasonably astute, noticed the alarmed look on the woman's face, and quickly
-justified himself. "No, no, ma'am, I wasn't cursin', the NAME of this here
-ham is "Damn ham". Amused, the woman requested some "Damn ham."
- That night, before dinner, the woman took her husband aside and
-explained what had happened at the butcher shop. He also was amused, and
-suggested that they play a joke on their son. So, at dinner, after grace,
-the man turned to his wife and said, "Honey, pass the damn ham."
- Their son looked up, surprised. "WHOAH! Dad be gettin' hip!
-How 'bout them mother-fuckin' potatoes?"
-%
- "What the hell are you getting so upset about? I thought you
-didn't believe in God."
- "I don't," she sobbed, bursting violently into tears, "but the
-God I don't believe in is a good God, a just God, a merciful God. He's
-not the mean and stupid God you make Him out to be."
- -- Joseph Heller, "Catch-22"
-%
- When the noted playwright George Bernard Shaw sent him two tickets to
-the opening night of his new play with a note that read: "Bring a friend, if
-you have one," Churchill, not to be outdone, promptly wired back: "You and
-your play can go fuck yourselves."
- -- "The Churchill Wit", National Lampoon
-%
- When the surgeon came to see her on the morning after her
-operation, the young woman asked her somewhat hesitantly how long it
-would be before she could resume her sex life. "I really haven't
-thought about it," gulped the stunned surgeon. "You're the first
-patient who's asked me that after a tonsillectomy!"
-%
- "Where'd she get those crow's feet?"
- "You really want to know?"
- "Yeah."
- "From squinting and screaming, "Suck what!?"
-%
- While serving as a subaltern in the Boer War, the young Churchill was
-asked by a superior officer to give his opinion of the Boers as soldiers.
- "They're assholes, sir," he ventured, then paused briefly and added, with a
-whimsical smile, "They're assholes."
- -- "The Churchill Wit", National Lampoon
-%
- While visiting our country, a lovely French maiden found herself
-out of money just as her visa expired. Unable to pay her passage back to
-France, she was in despair until an enterprising sailor made her a sporting
-proposition. "My ship is sailing tonight," he said. "I'll smuggle you
-aboard, hide you down in the hold and provide you with a mattress, blankets
-and food. All it will cost you is a little love."
- The girl consented, and late that night the sailor sneaked her on
-board his vessel. Twice each day thereafter, the sailor smuggled a large
-tray of food below decks, took his pleasure with the little French stowaway
-and departed. The days turned into weeks, and the weeks might have turned
-into months if the captain hadn't noticed the sailor carrying food below one
-evening and followed him. After witnessing this unique bit of barter, he
-waited until the sailor had departed and then confronted the girl, demanding
-an explanation. She told him the whole story.
- "Hmmm," mused the captain. "A clever arrangement, and I must say I
-admire that young seaman's ingenuity. However, miss, I feel it is only fair
-to tell you that this is the Staten Island Ferry."
-%
- "Why did you spend so much time parked in that fellow's car last
-night?" demanded the irate mother.
-"I could hear the giggling and squealing for a good half hour."
- "But, Mom," answered her daughter, "if a fellow takes you to the
-movies you ought to at least kiss him good night."
- "I thought you went to the Stork Club?" countered the mother.
- "We did."
-%
- With deep concern, if not alarm, Dick noted that his friend
-Conrad was drunker than he'd ever seen him before. "What's the trouble,
-buddy?", he asked, sliding onto the stool next to his friend.
- "It's a woman, Dick," Conrad replied.
- "I guessed that much. Tell me about it."
- "I can't," Conrad said. But after a few more drinks his tongue
-and resolution both seemed to weaken and, turning to his buddy, he said,
-"Okay. It's your wife."
- "My wife!!"
- "Yeah."
- "What about her?"
- Conrad pondered the question heavily, and draped his arm around
-his pal. "Well, buddy-boy," he said, "I'm afraid she's cheating on us."
-%
- "Yes, sir, the bowling ball nipple rings in black. Will there
-be anything else?"
-%
- You see, this girl wakes up one morning, rolls over and sees an
-elephant in the bed with her. Almost in shock, she says, "Did I pick you
-up in the bar last night?"
- "Uh-huh," the elephant replies.
- "Did I bring you home?"
- "Uh-huh."
- "Did we, uh, fool around?"
- "Uh-huh."
- "Lord, I must have been tight!"
- "Not any more."
-%
-... and no philosophy, sadly, has all the answers. No matter how assured
-we may be about certain aspects of our belief, there are always painful
-inconsistencies, exceptions, and contradictions. This is true in religion
-as it is in politics, and is self-evident to all except fanatics and the
-naive. As for the fanatics, whose number is legion in our own time, we
-might be advised to leave them to heaven. They will not, unfortunately, do
-us the same courtesy. They attack us and each other, and whatever their
-protestations to peaceful intent, the bloody record of history makes clear
-that they are easily disposed to restore to the sword. My own belief in
-God, then, is just that -- a matter of belief, not knowledge. My respect
-for Jesus Christ arises from the fact that He seems to have been the most
-virtuous inhabitant of Planet Earth. But even well-educated Christians are
-frustrated in their thirst for certainty about the beloved figure of Jesus
-because of the undeniable ambiguity of the scriptural record. Such ambiguity
-is not apparent to children or fanatics, but every recognized Bible scholar
-is perfectly aware of it. Some Christians, alas, resort to formal lying to
-obscure such reality.
- -- Steve Allen
-%
-... And then there's the guy who bought 20,000 bras, cut them in half,
-and sold 40,000 yamalchas with chin straps ...
-%
-... But the reward of a successful collaboration is a thing that cannot
-be produced by either of the parties working alone. It is akin to the
-benefits of sex with a partner, as opposed to masturbation. The latter
-is fun, but you show me anyone who has gotten a baby from playing with
-him or herself, and I'll show you an ugly baby, with just a whole bunch
-of knuckles.
- -- Harlan Ellison
-%
-... Let me tell you who the actual "front-runners" are. On one side,
-you have George Bush, who is currently going through a sort of
-fraternity hazing wherein he has to perform a series of humiliating
-stunts to win the approval of the Republican Right. For example, they
-had him make a speech oozing praise all over William Loeb, deceased
-publisher of the Manchester (N.H.) Union Leader and Slime Journalist.
-Loeb had dumped viciously all over George in the 1980 New Hampshire
-primary. But when the Right held a big tribute for Loeb, George came
-back to the fold, like a man with a bungee cord wrapped around his
-neck.
- -- Dave Barry, "The Twinkie and the Squid"
-%
-... So this is a very confusing situation, and what makes it even worse
-is, our standards keep changing. Take Playboy magazine. Back in the
-1950s, when I started reading it strictly for the articles, Playboy was
-considered just about the raciest thing around, even though all it ever
-showed was women's breasts. Granted, any given one of these breasts
-would have provided adequate shelter for a family of four, but the
-overall effect was no more explicit than many publications we think
-nothing of today, such as Sports Illustrated's Annual Nipples Poking
-Through Swimsuits Issue.
- -- Dave Barry, "Pornography"
-%
-... which the Minstrel was supposed by some authorities to have composed
-beneath the gibbet at Elsdon on the occasion of his hanging, drawing and
-quartering for misguidedly climbing into bed with Sir Oswald Capheughton's
-wife, Lady Fleur, when that noble lord was not only in it, but in her at
-the same time. Minstrel Flawse's introduction of himself into Sir Oswald
-had met with that reaction known as dog-knotting on the part of all
-concerned...
-I gan noo wha ma organs gan
-When oft I lay abed I should ha' known 'twas never Fleur
-So rither hang me upside doon That smelt so mooch of sweat
-Than by ma empty head. For she was iver sweet and pure
- And iver her purse was wet.
-But old Sir Oswald allus stank
-Of horse and hound and dung So hang me noo fra' Elsdon tree
-And when I chose to breech his rank And draw ma innards out
-Was barrel to my bung. That all the wald around may see
- What I have done without.
-But ere ye come to draw ma heart
-Na do it all so quick So prick 'em wet or prick 'em dry
-But prise the arse of Oswald 'part 'Tis all the same to me
-And bring me back ma prick. I canna wait for him to die
- Afore I have a pee.
- -- Tom Sharpe, "The Ballad of Prick 'Em Dry"
-%
-1. The sport of choice for the low skill level employees is: BASKETBALL.
-2. The sport of choice for maintenance level employees is: BOWLING.
-3. The sport of choice for front-line workers is: FOOTBALL.
-4. The sport of choice for supervisors is: BASEBALL.
-5. The sport of choice for middle management is: TENNIS.
-6. The sport of choice for corporate officers is: GOLF.
-
-AMAZING CONCLUSION: The higher you are in the corporate structure, the smaller
-your balls.
-%
-10 Reasons Why a Beer is Better Than a Man:
-
- 1. A beer NEVER leaves the toilet seat up.
- 2. A beer lasts longer than seven seconds.
- 3. A beer doesn't want to watch pro wrestling.
- 4. A beer won't expect you to cook dinner when you're not hungry.
- 5. A beer will never leave dirty socks on the floor.
- 6. A beer doesn't mind when your mother visits.
- 7. A beer does as many chores as a man, with a LOT less complaining.
- 8. A beer won't leave you for a younger woman.
- 9. A beer won't leave you for a younger man either.
-10. A beer won't tease you because you once liked Barry Manilow.
-%
-10 Reasons Why a Beer is Better Than a Man:
-
- 1. A beer will never invite friends home for dinner without calling.
- 2. A beer won't think less of you if you can't name the Steelers'
- quarterback.
- 3. A beer won't even act amazed if you can.
- 4. You don't have to let a beer win.
- 5. Just because you have dinner with a beer doesn't mean you have to
- sleep with it, too.
- 6. A beer helps with the housework.
- 7. A beer will never fumble with your bra.
- 8. A beer will never take the newspaper apart before you've read it.
- 9. A beer doesn't want you to raise its children.
-10. A beer wouldn't mind if you wanted it to wear a condom.
-%
-10 Reasons Why a Beer is Better Than a Man:
-
- 1. Having a beer can't make you pregnant.
- 2. A beer wouldn't trade you in on a sports car.
- 3. If a beer did have a sports car, it wouldn't love it more than you.
- 4. A beer doesn't want to go out alone with the other beers.
- 5. A beer wouldn't waste its money on Playbeer magazine.
- 6. You don't have to worry about getting AIDS from a bisexual beer.
- 7. A beer won't switch the TV channel.
- 8. A beer doesn't snore.
- 9. A beer doesn't care that you can't find your car's carburator.
-10. A beer doesn't think black leather bikinis are neat.
-%
-10 Reasons Why a Beer is Better Than a Woman:
-
- 1. Beer understands the difference between shooting down an unidentified
- aircraft in a war zone and blowing a Korean airliner out of the sky.
- 2. A beer would never own a car with an automatic transmission.
- 3. A beer never fishes for compliments.
- 4. Beer tastes good.
- 5. A beer can enjoy an evening of watching "Johnny-the-Wadd-Holmes' Greatest
- Hits" as much as you do.
- 6. An ice-cold beer will nonetheless let you have your way with it.
- 7. A beer won't ask you to pick up some tampons when you go to the store.
- 8. Beer never asks you to change the station.
- 9. A beer won't fill up your 'Vette with 85-octane gas because it's twenty
- cents less expensive.
-10. A beer won't make you eat experimental vegetarian meals that taste
- like grass.
-%
-10 Reasons Why a Beer is Better Than a Woman:
-
- 1. You can enjoy a beer all month.
- 2. Beer stains wash out.
- 3. Beer doesn't go crazy once a month.
- 4. Beer never makes you wait.
- 5. A beer doesn't get jealous when you grab another beer.
- 6. Beer doesn't have a lawyer "in the family".
- 7. A beer won't get upset if you come home with beer on your breath.
- 8. Beer doesn't demand equality.
- 9. Beer labels come off without a fight.
-10. Beer doesn't mind being in the "wet spot" that IT left.
-%
-15 Reasons Why a Beer is Better Than a Man:
-
- 1. A beer doesn't care that you don't balance your checkbook.
- 2. Tall, dark, good-looking beers are common.
- 3. A beer won't steal all the covers.
- 4. A beer doesn't have friends who will drink all your beer.
- 5. A beer wouldn't yell if you dented the car.
- 6. A beer doesn't buy everything labeled "turbo".
- 7. You don't have to laugh at a beer's jokes.
- 8. A beer is not kinky unless you want it to be kinky.
- 9. A beer always lets you read the Sunday comics first.
-10. A beer doesn't think poetry is queer.
-11. If the beer is finished before you are, you can have another beer.
-12. A beer won't talk about the women who had it before you.
-13. A beer's life does not revolve around the world series.
-14. A beer won't mind at all if you're not in the mood for beer.
-15. A beer will NEVER call you "Babe". Or "Sugar".
-%
-18th Rule of Friendship:
- A friend will let you hold the ladder while he goes up on the roof
- to install your new aerial, which is the biggest son-of-a-bitch you
- ever saw.
- -- Esquire, May 1977
-%
-667 -- The neighbor of the beast.
-%
-68:
- Do me now and I'll owe you one.
-%
-6802 hackers make great use of the SEX instruction.
-%
-69 + 69 = dinner for 4.
-%
-71:
- 69 with two fingers up your ass.
- -- George Carlin
-%
-8 Reasons Why a Beer is Better Than a Woman:
-
- 1. You rarely (if ever) find beer labels on the shower curtain rod.
- 2. A beer doesn't care when you come.
- 3. Beer doesn't have a mother.
- 4. Beer doesn't need much closet space.
- 5. A beer won't accuse you of lying when you say you read Playboy
- "just for the articles".
- 6. Beer doesn't mind seeing Chuck Norris and Charles Bronson flicks.
- 7. Beer doesn't always want to go to the 'powder room' with everyone
- else's beer.
- 8. When you're through with a beer, the thought of another beer doesn't
- make you ill.
-%
-A '49er walked into the saloon at Bloody Gulch. He'd been prospecting for
-more than a year.
- "Hey! Y'got any wimmen around here?"
- "Nope," the bartender replied, "But there's George in the back room."
- "I don't go for that kind of thing," the prospector scowled. He
-downed his drink and left disgustedly.
-A few months passed before the miner found his way down the mountain again.
-He stumbled into the tavern and asked the bartender, "Any wimmen pass through
-this part of town?"
- "Nope. Nary a one. But we still got George in the back room."
- Angry, the miner shouted, "I told you I don't go for that kind of
-thing," and turned on his heel and left.
- Within a year he came back from his mine again. With a wild look on
-his face he re-entered the saloon. Leaning over the bar he whispered to the
-bartender, "If I was to go into the back room with George, how many people
-'round here would know?"
- "Oh," the bartender said, scratching his chin, "'bout seven, I guess."
- "Seven!?"
- "Yep. You, me, George, and the four men holdin' him down. You see,
-George don't go for that kind of thing neither."
-%
-A 6'8", 280-pound Southerner walked into a NY bar, sat down next to a
-patron, and said, "Ah'm big, and ah'm bad, and I *loves* to fuck Northern
-women!" The guy was so terrified that he put down his beer and ran out
-of the bar.
- The Rebel moved over to the next guy and said, "Ah'm big and ah'm
-bad and I *loves* to fuck New York women." The guy took one look at him,
-blanched and ran out of the bar.
- The man then went over to a short little guy with "Bronx" written
-all over him. "Ah'm big and ah'm bad and I *loves* to fuck your sister."
- The short guy looked him up and down and said, "I don't blame
-you one bit. She's *got* to be an improvement on yours."
-%
-A bar patron returned from the men's room grumbling to himself.
- "What's the trouble, buddy?" the bartender inquired.
- "You got John Wayne toilet paper in there!"
- "What do you mean?" the barkeeper asked.
- "It's rough, it's tough, and it doesn't take shit from nobody."
-%
-A beachcomber of 25 had been shipwrecked on a desert island since the age of
-six. One day, while in search of food, he stumbled across a beautifully
-sensuous female lying on the beach nearly naked; she'd been washed ashore from
-another shipwreck that morning. After they got over their initial surprise
-at seeing each other, the girl wanted to know how long he had been alone on
-this barren bit of land.
- "Almost twenty years," he answered.
- "Twenty years!" she exclaimed. "But how ever did you survive?"
- "Oh, I fish, dig for clams, and gather berries and coconuts," he
-replied.
- "And what do you do for sex?" she asked.
- "What's that?" He looked puzzled.
- Whereupon the maiden pulled the innocent young man down onto the sand
-beside her and proceeded to demonstrate. After they had finished, she asked
-how he had enjoyed it.
- "Great!" was the reply. "But look what it did to my clamdigger!"
-%
-A beautiful man is paradise for the eyes, hell for the soul, and
-purgatory for the purse.
-%
-A beautiful, voluptuous woman goes to see a gynecologist. The doctor takes
-one look at this woman and his professionalism is a thing of the past. Right
-away he tells her to undress. After she has disrobed he begins to stroke her
-thigh. As he does this he says to the woman, "Do you know what I'm doing?"
- "Yes," she says, "you're checking for any abrasions or dermatological
-abnormalities."
- "Correct," says the doctor. He then begins to fondle her breasts.
-"Do you know what I'm doing now?" he says.
- "Yes," says the woman, "you're checking for any lumps or breast
-cancer."
- "That's right," replies the doctor. He then gradually proceeds to
-having sexual intercourse with her. "Do you know," he pants, "what I'm doing
-now?"
- "Yes," she says. "You're getting herpes."
-%
-A big store buyer had been on the road for nearly two months. Each week he
-would send his wife a telegram saying,
- "Can't come home yet. Still buying."
-His wife knew that these buying trips usually involved more than business.
-She tolerated this particular jaunt for a while, but when the third month
-rolled by and she'd still seen nothing of her husband but the weekly telegrams,
-she wired him,
- "Better come home. I'm selling what you're buying."
-%
-A bisexual chap name of Lunt
-Taught himself an unusual stunt.
- He could peel back his spout
- Turn the skin inside out
-Like a glove, to be used as a cunt!
-%
-A bisexual is a man who likes girls as well as the next fellow.
-%
-A blind rabbit was hopping through the woods, tripping over logs and crashing
-into trees. At the same time, a blind snake was slithering through the same
-forest, with identical results. They chanced to collide head-on in a clearing.
- "Please excuse me, sir, I'm blind and I bumped into you accidentally,"
-apologized the rabbit.
- "That's quite all right," replied the snake, "I have the same
-problem!"
- "All my life I've been wondering what I am," said the rabbit, "Do
-you think you could help me find out?"
- "I'll try," said the snake. He gently coiled himself around the
-rabbit. "Well, you're covered with soft fur, you have a little fluffy tail
-and long ears. You're... hmmm... you're probably a bunny rabbit!"
- "Great!" said the rabbit. "Thanks, I really owe you one!"
- "Well," replied the snake, "I don't know what I am, either. Do you
-suppose you could try and tell me?"
- The rabbit ran his paws all over the snake. "Well, you're low, cold
-and slimey..." And, as he ran one paw underneath the snake, "and you have
-no balls. You must be an attorney!"
-%
-A bureaucracy is like a septic tank -- all the really big shits float
-to the top.
-%
-A businessman was awe-struck by the beautiful redhead at the hotel bar.
-Seeing his interest, she quietly informed him that she was a prostitute
-and that her price was $500. He was taken aback by the price, but after
-a few minutes of thought he took her up to his room. She spent a few
-minutes in the bathroom and was shocked when she came out to see him
-masturbating furiously on the bed. "What are you doing?", she asked.
- "Baby, for $500, you're not going to get the easy one!"
-%
-A Catholic and a Methodist were carpooling to work one morning, when a brick
-fell out of the sky, which startled the driver and caused him to swerve off
-the road and into a telephone pole, totaling the car.
- The two stumbled out of the wreckage, both feeling quite fortunate
-to be alive. The Catholic crossed himself. Then the Protestant crossed
-himself in an accentuated manner.
- "Hey," said the Catholic, "Why did you cross yourself, you're not
-Catholic!"
- "Just checking," replied his friend, crossing himself again,
-"spectacles, testicles, wallet, pen."
-%
-A certain bartender decided to try to get a few new customers into his bar
-by starting a gimmick involving a horse. His claim was that if anyone could
-get the horse to laugh, he would give them drinks on the house. The idea
-worked well and business improved until one night a young man walked in and
-whispered in the horse's ear. The horse immediately burst into hysterical
-laughter and the man won the contest. The next night the same thing
-happened: the man whispered in the horse's ear and the horse burst out
-laughing. The next night, the bartender decided to change the rules. Now,
-a person had to get the horse to cry in order to win the drinks on the
-house. Later on that night, the same guy came in and said "Can I take the
-horse into the bathroom for a minute? I promise I'll make him cry." The
-bartender agreed and sure enough, when the man came out leading the horse,
-the horse was crying his eyes out. The bartender could take it no more and
-said, "How did you make him laugh the other two nights?"
- "I told him that my dick was bigger than his", replied the man.
- "How did you make him cry tonight?"
- "I proved it."
-%
-A chiseler is a man who goes stag to a wife-swapping party.
-%
-A Christian is a man who feels repentance on Sunday for what he did on
-Saturday and is going to do on Monday.
- -- Thomas Ybarra
-%
-A clergical student named Simms
-Hums liturgical tunes while he rims:
- A nice piece of ass
- Gets the B-Minor Mass ...
-All the others get Anglican hymns.
-%
-A clitoris is a lot like Antarctica;
-most men know it's there, but few really care.
-%
-A conservative is a man who believes that nothing should be done for
-the first time.
- -- Alfred E. Wiggam
-%
-A conservative is a man with two perfectly good legs who has never
-learned to walk.
- -- Franklin D. Roosevelt
-%
-A couple more shots of whiskey, women 'round here start looking good.
-
- [something about a 10 being a 4 after a six-pack? Ed.]
-%
-A couple took their young son for his first visit to the circus, and by
-chance their seats were next to the elephant pen. When his father left
-to buy popcorn, the boy piped up,
- "Mom, what's that long thing on the elephant?"
- "That's the elephant's trunk, dear," she replied.
- "No, not that."
- "Oh, that's the elephant's tail."
- "No, Mom. Down underneath."
- His mother blushed and said, "Oh, that's nothing."
- Pretty soon the father returned, and the mother went off to get
-a soda. As soon as she had left the boy repeated his question.
- "That's the elephant's trunk, son."
- "Dad, I know what an elephant's trunk is. The thing at the
-other end."
- "Oh, that's the elephant's tail."
- "No. Down there."
- The father took a good look and explained, "That's the elephant's
-penis."
- "Dad, how come when I asked Mom, she said it was nothing?"
- The man took a deep breath and replied, "Son, I've *spoiled*
-that woman."
-%
-A definition of teaching: casting fake pearls before real swine.
- -- Bill Cain, "Stand Up Tragedy"
-%
-A drunk was sitting at the end of the bar in a popular singles' place,
-watching a young, good-looking man working his way through the women. The
-guy didn't appear to be having much luck, and he was only spending a few
-moments with each woman. As he worked his way closer, while he couldn't
-hear what the young man was saying, he realized that the women were somewhat
-shocked at his approach. Finally, the man approaches a pretty brunette and
-they hit it off immediately. After a bit of quiet conversation, she handed
-the young man her hotel key and they started off for the elevators. As they
-passed the drunk, he stopped the lucky one and asked him what his method was.
- "Well," the man replied, "It's simple. You say 'Tickle your ass
-with a feather?' If she sounds interested, you take it from there. If she
-sounds angry, you smile and say 'Typically nasty weather.'"
- The drunk says "Ohhhhh, got it, I got it!" and walks over to a woman
-at the end of the bar to try out his new approach. Getting her attention,
-he smiles and says "Fuck me!"
- "What?!?!?" she screams.
- "Raining like hell, isn't it?"
-%
-A figure with curves always offers a lot of interesting angles.
-%
-A fisherman from Maine went to Alabama on his vacation. He rented a boat,
-rowed out to the middle of the lake, and cast his line, but when he looked
-down into the water he was horrified to see a man wrapped in chains lying
-on the bottom of the lake. He quickly rowed to shore and ran to the police
-station. "Sheriff, sheriff," he gasped, there's a guy wrapped in chains,
-drowned in the lake!"
- "Now ain't that jest like a Yankee," drawled the sheriff, "to steal
-more chain than he can swim with?"
-%
-A fool is a man who worries about whether or not his lover has integrity.
-A wise man, on the other hand, busies himself with deeper attributes.
-%
-A friend of mine received a note through the mail advising him,
- "If you don't stop making love to my wife, I'll kill you."
-The trouble is, the note wasn't signed.
-%
-A friend with weed is a friend indeed.
-%
-A friendly message from your Internal Revenue Service: tax time is
-coming again soon. Bend over.
-%
-A gambler was telling a friend about his first junket to Las Vegas and how
-hard it was to get any sleep.
- "I was awakened at one, two and four in the morning by a
-drunken chorus girl banging on the door and screaming," he recalled.
- "That's terrible," the friend said." How'd you ever get any sleep?"
- "At five o'clock I unlocked the door and let her out."
-%
-A game can by God repent or we'll punish it.
-That's how they did it in Salem in the seventeenth century,
-and that's how we'll do it now.
- -- Dick Hamlet
-%
-A genius is a queer who can whistle while he works.
- -- Bobby Knight
-%
-A girl's conscience doesn't really keep her from doing anything wrong--
-it merely keeps her from enjoying it.
-%
-A gorgeous young sophomore is having an affair with her English
-professor. She goes home to visit her family for Christmas vacation
-and when she gets back, she immediately invites him over for the
-night. As soon as he walks through the door she hugs him and
-asks, "Were you blue while I was away?"
- "Blown, my dear," the professor corrects her, "blown."
-%
-A grade school teacher, who was doing a unit on World War II heard that
-the father of one of her students had been a fighter pilot during the war
-with one of the Scandinavian Air Forces. She invited him to come in and
-speak to the class. The guy was more than happy to talk, and began with
-a story about a morning patrol where he had been nearly shot down.
- "We had been up for about 20 minutes flying over enemy held
-territory, when we noticed, just in time, 3 Fokkers diving on us from above."
-At the first mention of `Fokkers' the class giggled a little bit.
- "Our group broke formation, and began the dog-fighting. As we
-fought, we noticed 2 more Fokkers coming at us from above and 2 more
-Fokkers, fresh from the landing field, come to join the battle".
-At this second and third mention of `Fokkers' the class was almost laughing
-openly, and the teacher interrupted the story to ask the pilot to explain
-to the class that a `Fokker' was a particular type of plane flown by the
-German Air Force.
- He replied, "Ya, dat is true, but these Fokkers were Messerschmitts."
-%
-A group of scientists discovered an apelike creature in the jungle, which
-they hoped would prove to be the missing link. The proof of their theory,
-however, required that a human mate with the animal so that they could see
-what characteristics the offspring would assume. Needing volunteers, the
-scientists placed an ad in the paper: "$5000 to mate with ape."
- Almost immediately, they received response from a man who said he
-would be willing to take part in the experiment, with three conditions.
- "First," he said, "my wife must never know. Second, any children
-must be baptized. And, third, I'd have to pay in installments."
-%
-A guy comes into a bar with a frog and sets it down next to the prettiest
-girl there.
- "This is a very special frog," he informs her. "His name is Charlie."
- "What's so special about this frog?" she asks.
-He's reluctant to tell her, but when pressed, explains that,
- "This frog can eat pussy."
-The girl slaps him, knocking him off his chair, and accuses him of telling her
-a filthy lie. But no, he assures her, it's completely true. And after much
-discussion, she agrees to come back to his apartment to see the frog in action.
-She positions herself appropriately, the guy carefully takes out the frog, and
-says, "Okay, Charlie, do your stuff!" The frog is immobile, despite his
-owner's exhortations, and the girl starts to snicker.
- "Okay, Charlie, do your stuff!"
- "C'mon Charlie, do your stuff!"
-By now, the girl is laughing openly.
- "Okay, Charlie," says the guy, moving the frog out of the way, "I'm
-only going to show you one more time."
-%
-A guy walks into a bar, orders a beer, carries it to the bathroom and dumps it
-into a urinal. Over the course of the next few hours, he goes back to the bar
-and repeats this sequence -- several times. Finally the bartender got so
-curious that he leaned over the bar and asked him what he was doing.
- Replied the customer, "Avoiding the middleman."
-%
-A hand in a bird is worth two on 'er bush.
-%
-A hand in the bush is worth two on the bird.
-%
-A hard man is good to find.
-%
-A huge Rambolike fellow walked into a tavern and took a seat in the middle of
-the bar. After downing a double in one gulp, he glared at the six men to his
-right and said, "You're all no-good motherfuckers. Anyone have a problem with
-that?"
- When no one said a word, the brawny fellow ordered another whiskey,
-downed it in one gulp, turned to the five men on his left and said, "You're
-all cocksuckers. Anyone have a problem with that?"
- Everybody on the left stared silently into his drink. Suddenly, a man
-on the right stood up and started walking toward the big guy. "Hey, asshole!"
-the thug bellowed. "You got a problem with what I said?"
- "No problem at all," came the reply. "I was just sitting at the wrong
-end of the bar."
-%
-A hunter saved a native boy from a boa constrictor. In gratitude, the boy gave
-the hunter a magic gorilla prick. The lad said the prick would do anything you
-told it to do until you told it to do something else. When the hunter returned
-home to England, he put the magic gorilla prick on the mantle along with some
-of his other trophies. His wife thought it quaint and his story charming. But
-soon, the hunter went a-safariing again. He was away for months. One evening,
-the woman eyed the MGP carefully and whispered, "Gorilla Prick, fuck me."
-Whereupon the thing jumped off the mantle and began to bang her with great
-thoroughness and ferocity. For the first twenty minutes it was pure heaven,
-but after the next few minutes it became fatiguing, and she said, "Stop it,
-Gorilla Prick," but it didn't. After a bit more she was screaming "Stop!
-Stop!" at the thing and trying to pull it out of her smoking hole. But nothing
-worked. Finally, the butler bursts into the room, summoned by her screams.
- "Saunders, help me please!"
- "But what is it, Madame?"
- "It's a Magic Gorilla Prick!"
- "Gorilla prick, my ass!! ... AAAaaeeeeeeeeeiiiiiiiii!!!!!!"
-%
-A husky foreigner, looking for sex, accepted a prostitute's terms. When
-she undressed, he noticed that she had no pubic hair. The man shouted,
-"What, no wool? In my country all women have wool down there."
- The prostitute snapped back, "What do you want to do, knit or fuck?"
-%
-A lanky Texan was mad because Texas had just become the second largest state in
-the Union, so he made up his mind to move to Alaska. He drove for three days
-and three nights to get there and finally he came to what looked like the state
-line. He halted his car and walked up to the border guard. "Hi, there! How
-do I become a resident of this here biggest state?" demanded the Texan.
- The guard looked him up and down and grinned. "Waal," he answered,
-there are three things you gotta do to get in. First, drink down a quart of
-110 proof corn liquor without blinkin'. Second, kill a grizzly bear, and
-third, make love to an Eskimo woman."
- "Sounds easy enough," said the Texan. "Where can I get a quart of
-this here corn liquor?"
- "Got one right here," replied the guard.
- The Texan gulped down the whiskey without batting an eyelash.
-"Now, do you happen to know where I can find me a grizzly?"
- "Yep," answered the guard, "there's a big b'ar over that way, 'bout
-a mile... lives in a cave on that cliff."
- The Texan lurched merrily off. About an hour later he returned
-with his clothes almost torn off and his face scratched and bloody. He was
-smiling happily. "Now," he roared, "where's that damn Eskimo woman you
-want killed?"
-%
-A lisping fag fell off a pleasure yacht and began to scream. "Help! Help, I
-can't thwim!" One of the other passengers heard the caterwauling and leaned
-over the rail, remarking, "Really, there's no need to scream. Just reach out
-and grab that buoy near you." To which the floundering sodomite answered,
-"Buoy! Oh, thith ith no time for thekth, you degenerate... I'm dwowning!"
-%
-A little bit of rape is good for a man's soul.
- -- Norman Mailer
-%
-A little Mexican boy comes home from school one day and says to his grand-
-father, "Granddaddy, today my teacher said that Pancho Villa, the bandit
-used to raid towns around here! Did you ever know him?"
- "Do *I* know Pancho Villa?" exclaims the man. "Why, boy, before
-your father was born, I was riding into town on my horse. Suddenly, from
-behind the bushes leaped Pancho with his six-guns drawn! He told me to get
-down off the horse and to give him all my money. Then, he told me to scoop
-some manure from the ground and eat it!"
- "I refused at first, but Pancho had the guns, so I ate the shit.
-And he started laughing so hard that it scared his horse into rearing up --
-I grabbed the guns from his hands! I said to Pancho, `Okay, Pancho, now
-it's your turn -- you eat the shit!' I had the guns, so he ate the shit.
- "And you ask me, child, if I know Pancho Villa, the bandit! Why,
-we had *lunch* together!"
-%
-A lively case was in progress in the District Court at Lick Skillet. Judge
-Flannery was presiding, and on the witness stand was Tush Bumpass.
- "From where ah was standin'", drawled Tush, "Ah could see he'd
-backed 'er up agin' thet there wall, and ef Ah ever sawed a screwin' match,
-thet one wuz!"
- "Mr. Bumpass," the Judge interrupted, "I'd prefer that you not use
-the word 'screw' in the courtroom. Say 'intercourse' instead."
- Tush looked puzzled. "Intercourse? Whut's thet, Judge?"
- His Honor sighed. "It's a technicality of language that you're
-probably not aware of. Never mind. Please continue."
- "Well, like ah said, he had 'er shoved up agin' thet wall, an' he
-was... uh... intercoursin' 'er, an' he give 'er the crossjostle, the Chicago
-Stroke, an' she let out with a holler thet..."
- "One moment," interrupted the Bench. "What is this, ah, Chicago
-Stroke, Mr. Bumpass?"
- "Well, thet's a technicality of screwin', Judge, thet you're probably
-not aware of!"
-%
-A lover without indiscretion is no lover at all.
- -- Thomas Hardy
-%
-A male gynecologist is like an auto mechanic who has never owned a car.
- -- Carrie Snow
-%
-A man always needs to remember one thing about
-a beautiful woman. Somewhere, somebody's tired of her.
-%
-A man and a woman got married. Although it is the first time for the
-husband, it is the woman's second marriage. As they go to bed on their
-wedding night, the wife says to her husband:
-
- "Dear, there's something I must tell you. I'm a virgin."
-Naturally, the husband is surprised.
- "You've been married before!", he says, "How can you still be a
-virgin?"
- "Well, it's all quite simple," she retorted, "my husband was a
-computer programmer."
- "What's so odd about that?", he asked. "Why would you still be
-a virgin after a marriage to a programmer?"
- "Well", she said, "all he did was sit on the edge of the bed and
-tell me how great it was going to be."
-%
-A man arrived home early to find his wife in the arms of his best friend,
-who swore how much they were in love. To quiet the enraged husband, the
-lover suggested, "Friends shouldn't fight, let's play gin rummy. If I win,
-you get a divorce so I can marry her. If you win, I promise never to see
-her again. Okay?"
- "Alright," agreed the husband. "But how about a quarter a point
-on the side to make it interesting?"
-%
-A man can sleep around, no questions asked, but if a woman makes nineteen
-or twenty mistakes she's a tramp.
- -- Joan Rivers
-%
-A man goes into a bar and begins to tell a Polish joke. The man sitting
-next to him, a big hulking powerhouse, turns and says menacingly, "*I'm*
-Polish."
- He then calls out, "Ivan! Come over here and bring your brother."
-Two men, bigger than the first, appear from the back room.
- "Josef!" the man calls out, "come here a second, and bring Lendl
-with you." Two more men appear, and all five men crowd around the man with
-the joke.
- "Now," says the first Polish man, "do you want to finish that joke?"
- "Nah," says the man.
- "Oh, no? And why not? I'm sure it was very funny," says the Polish
-man, opening and closing his fist. "Are you scared?"
- "No," replies the man. "I just don't feel like having to explain it
-five times."
-%
-A man goes into a hospital for a routine appendectomy. When he wakes up
-from the anesthesia, he sees a large group of doctors gathered anxiously
-around his bed.
- "What happened?" he asks worriedly.
- "Well," says one of the doctors, "there was a small clerical error,
-and you got mixed-up with another patient. Instead of an appendectomy, we
-performed a sex-change operation. Your penis has been removed and a vagina
-has been crafted into place."
- "WHAT!!!" screams the man. "That's horrible! What am I going to
-tell my wife? Can't you reverse it? This means I'm never going to experience
-another erection!"
- "Well, you will, you *will*," reassures the doctor, "but it will, of
-course, have to be someone else's."
-%
-A man is driving down the road on his way to Salerno. By the roadside he
-sees a man hitchhiking and stops to pick him up. As the man gets into his
-car he suddenly pulls out a gun and makes the driver get out of the car.
- "All right, buddy," says the man, "I want to you jerk off."
- "What!?" says the man, disbelievingly.
- "Go ahead, do it!" says the hitchhiker.
- So the driver masturbates, and when he is through, says, "All right,
-I did what you wanted, can I go now?"
- "Nope," says the hijacker. "Do it again."
- "Again?" the driver exclaims. "I just did it."
- "Do it again."
- It takes a little longer this time, but he manages to come again.
-Panting, he turns to his tormenter and again asks if he can leave.
- "Yes," the man replies, "but only after you've done it one more
-time."
- The guy is really scared now; he's starting to sweat. It takes him
-twenty minutes, this time, but he finally comes a third time.
- "Listen, buddy, can I please leave now?"
- "Yeah," says the man, lowering his gun. "And this is my daughter;
-I want you to drive her into Salerno."
-%
-A man is marooned on a desert island with a female sheep and a male Doberman
-for companionship. The animals soon get it on sexually, and all goes well
-until the man becomes unbearably horny and makes his move for the ewe, at
-which point the dog interposes himself, snarling, fangs bared. Months later,
-a raft drifts into sight. The sailor swims out, finds a beautiful girl on it,
-takes her to shore and feeds and comforts her.
- "You are so good to me," she responds gratefully. "I'd do absolutely
-anything to show my gratitude."
- "Would you?" smiles the sailor as he unfastens the length of rope
-that holds up his ragged pants. "Well, then, here -- use this as a leash
-and take that damn dog for a walk!"
-%
-A man is only as old as the woman he feels.
- -- Groucho Marx
-%
-A man is playing golf at a very exclusive country club when he hits a hole-
-in-one. As he takes his ball from the cup, a genie appears.
- "Since you've made a hole in one, you may have a single wish. What
-is your heart's desire?"
- "Great!", replies the man. I want a longer penis."
- "Your wish is granted," says the genie, and promptly disappears.
- As the golfer continues through the rest of the course he can
-feel his penis slowly growing, to an extent that it's becoming uncomfortable.
-By the time he completes the 18th hole it's extended down his pants leg to
-his knee. Thinking to himself that this isn't quite what he had in mind, he
-grabs a bucket of balls and heads back out onto the course. Three weeks later,
-he manages another hole-in-one and the genie reappears.
- "Since you've made a hole in one, you may have a single wish. What
-is your heart's desire?"
- "Yeah, I know all that," replies the man. "Listen, could you make
-my legs longer?"
-%
-A man is talking to his wife when he mentions that there's a "Big Dick"
-contest at one of the bars in town and the prize for the winner is $1000.
- "Oh, honey," she exclaims, "I don't want you taking that thing
-out in public!"
- "But baby," he says, "$1000 is a lot of money."
- "I don't care!" she says, stamping her foot. "I don't want you
-showing that thing to everybody."
- And the subject isn't mentioned again, until the following evening
-when he hands her $1000.
- "Did you enter the contest, even after I told you I didn't want
-you to?" she asks.
- "Please forgive me, turtle dove," he says. "I thought we could use
-the money."
- "You mean you took that thing out for everybody to see?" she says,
-tears welling up in her eyes.
- "Only enough to win, honey, only enough to win."
-%
-A man is walking along when he sees a funeral procession going by, the
-longest procession he's ever seen. It seems to consist of the hearse,
-followed by a man with a Doberman on a leash, followed by several hundred
-other men. After watching for a few minutes, he can restrain his curiosity
-no longer, and walks up to one of the mourners.
- "Excuse me, sir, I don't mean to bother you in your moment of grief,
-but this is the strangest procession I've ever seen. What happened, who is
-the funeral for?"
- "Well, it's nothing special, really, the funeral is for the mother-
-in-law of the man at the front of the procession. You see, his Doberman
-attacked and killed her."
- "That's awful!", replies the onlooker. "But... um... tell me, you
-don't think he'd let me borrow that dog, do you?"
- "Get in line, buddy," replies the mourner, "get in line."
-%
-A man is walking down the street when he sees a man with four arms, and
-antennae coming out of his head. He goes up to him and says, "You're not
-from around here, are you?"
- "No," replies the man with the antennae.
- "You know," continues the man, "I don't think you're an American,
-either. In fact, I bet you don't even come from this planet!"
- "Right again," says the man with four arms. "I'm from Mars."
- "Well," says the man, "that's quite some configuration you've got
-there, with those four arms and those antennae and everything."
- "We Martians all have four arms and antennae."
- "Well, that's just amazing," replies the man, "and how about that
-big gold colored plate in the middle of your chest, what's that, do all
-Martians have that?"
- "Well, no," says the Martian. "Not the *goyim*."
-%
-A man needs a mistress, just to break the monogamy.
-%
-A man never minds being in the doghouse
-as long as he can get his tail outside.
-%
-A man rushed into a bar and breathlessly asked the bartender to pour him
-three straight scotches. The bartender complied, and watched as he downed
-them one after another.
- "Why three scotches?" the bartender asked as he paused for breath.
- "Well, to be honest, I'm celebrating my first blow-job."
- "Hell, congratulations, the next one's on me."
- "No, thanks," the young man replied, "if the first three didn't get
-the taste out of my mouth, I don't think another one will."
-%
-A man sat down next to another passenger on a train recently and couldn't
-help overhearing his conversation out the window with a man standing on
-the train platform.
- "Thanks for putting me up while I was here, Sam," said the passenger.
- "Glad to do it," said the other man.
- "Thanks for the food and the drinks -- everything was wonderful."
- "It was a pleasure," said the man.
- "And thank your wife, Sam, she was great," said the passenger,
-"she was a truly great lay."
- The man was rather taken aback by this exchange and he later turned
-to his fellow passenger and said: "Pardon me sir, but did I understand you
-to say that your friend's wife was a great lay?"
- "Well," said the other passenger, "I didn't REALLY enjoy it. But
-Sam is a helluva nice guy."
-%
-A man walks into the doctor's office and the doctor says to him, "I've got
-some good news and some bad news."
- "Tell me the good news first" the patient replies.
- "The good news is that your penis is going to be about two inches
-longer and about an inch wider," the doctor says.
- "That's great!" says his patient. "What's the bad news?"
- "Malignant."
-%
-A man was playing golf one day when a little frog hopped out the water at a
-water hazard and croaked, "I am a magic frog, and since you are the 10,000th
-person to play through here, I'm prepared to offer you one of two magic gifts:
-First, for a whole year you can have the most fabulous sex life that anyone
-ever had; beyond your wildest dreams. Or, second, for a whole year you can
-be the best golfer the world has ever known. Which do you prefer?" The man
-thought a bit and said that he'd take the golf. Well, the man holed his wood
-shot from where he was, completed the course in an average of 2 per hole, and
-went round in 22. Quickly he attracted the attention of the sports world,
-and became the world's best-known golfer, setting course records wherever
-he went. A year later he was playing the same course inhabited by the frog,
-and at the water hazard the frog hopped out and said, "Well, the year is up,
-and you now revert to the 18-handicap player you were before. But tell me, I
-was a little surprised that you chose the golf -- I take it your sex life is
-outstanding?" The man said, "Well, I have no complaints in that department
-at all, which is why I chose the golf." "How many times did you engage in sex
-last year?" inquired the frog. The man thought a little and said, "Oh, eight
-or ten times, I guess." "Damn," said the frog, "that doesn't strike me as very
-satisfactory." "Oh, I don't know," replied the man, "it doesn't seem so bad
-for a Catholic priest from a little town in South Dakota."
-%
-A man was talking to his best friend about his married life. "You know," he
-says, "I really trust my wife, and I think she has always been faithful to
-me, but there's *always* that doubt. There's *always* that little doubt."
- "Yeah, I know what you mean," his friend replies.
- "Well, buddy, I've got to leave on a business trip this weekend,
-and I wonder... well... would you watch my house while I'm gone? I trust
-her, it's just that there's *always* that doubt."
- The friend agreed to help out and two weeks later gave his report.
- "I've got some bad news for you," says the friend. "The evening
-after you left I saw a strange car pull up in front of your house. A man
-got out of the car and went in the house and had dinner with your wife.
-After dinner they went upstairs and I saw your wife kissing him. Then, he
-took off his shirt and she took off her blouse. And then the light went
-out."
- "*Then* what happened?" said the husband, his eyes opening wide.
- "Well, I don't know," replied the friend, "it was too dark to see."
- "Damn!" roared the husband. "You see what I mean? There's *always*
-that doubt!"
-%
-A man who likes to lie in bed can usually
-find a girl willing to listen to him.
-%
-A man with no arms walked into a bar and asked for a beer. The bartender
-shoved the foaming glass in front of him.
- "Look," said the customer, "I have no arms -- would you please hold
-the glass for me?
- "Sure," said the bartender.
- "If," said the customer, "you'll reach in my right hand coat pocket,
-you'll find the money for the beer."
- The bartender got the money and rang up the bill.
- "You've been very kind," said the customer. "Just one thing more.
-Where is the men's room?"
- "Up the street to the light," said the bartender, "turn left, walk
-two blocks, and there's a gas station on the corner."
-%
-A man without a God is like a fish without a bicycle.
-%
-A man without a woman is like a statue without pigeons.
-%
-A man's father is very, very old, and the son can't afford very good treatment
-for him, so he's in a rather shabby, run-down nursing home. One day the son
-wins a lottery -- and the first thing he does is install his father in the best
-old age home that money can buy.
- On the first day the old man is sitting watching TV, and he starts
-to lean a little bit to one side. Right away a nurse runs over and gently
-straightens the old man. A little later he's eating dinner, and when he
-finishes, he begins to tip a little bit to one side. Another nurse runs
-over and gently pushes him upright again.
- The son visits his father later that evening and asks him how he's
-being treated.
- "It's a wonderful place, son," replies the father. "I really like
-it here, gourmet food, color TV's in every room, the service is unbelievable,
-there's just one little problem."
- "What's that, Dad?"
- "They won't let you fart."
-%
-A midget had a date with a very tall girl. It was a quiff-hanger.
-%
-A Mormon is a man that has the bad taste and the religion to do what a
-good many other people are restrained from doing by conscientious
-scruples and the police.
- -- Mr. Dooley
-%
-A mouse was sniffing around in a meadow, when an eagle swooped down,
-swallowed him whole, and rose up in the air again. The mouse worked
-his way through until his head was sticking out of the bird's asshole.
- "Say, good buddy," he squeaked, "how high up are we, anyway?"
- "Oh, about two thousand feet," answered the eagle.
- The mouse's eyes bugged out. "Hey, you wouldn't shit me, would you?"
-%
-A new lumberjack had just finished his first month in the lonely wilds of
-Alaska, where there were no women for miles. He finally couldn't take it
-anymore and nervously asked the foreman what the other men did to relieve
-the pressure.
- "Try the hole in the barrel outside the shower," suggested the
-foreman. "The other men swear by it."
- The lumberjack dubiously tried it out and had the experience of
-his life. "That barrel is fantastic! Warm! Wet! I'm going to use it
-every day!"
- "Every day but the third Wednesday of the month," one of the
-other men replied.
- "Why not then?"
- "That's your day in the barrel."
-%
-A New Yorker is riding down the road in his new Mercedes. So intent is he
-on the cocaine in his hand he completely misses a turn and his car plunges
-over the five-hundred-foot cliff to be smashed into pieces at the bottom.
-As the on-lookers rush to the edge of the cliff they see him fifty feet
-from the top of the cliff clinging to a stunted bush with all his strength.
-"Dear Lord," he prays, "I never asked you for nothin' before, but I'm askin'
-you now: Save me, Lord, save me."
- Booms the Lord: "LET GO OF THE BRANCH."
- "But Lord, if I do that, I'll fall!"
- "TRUST ME, LET GO OF THE BRANCH."
- "But Lord, I'm gonna fall and die..."
- "TRUST ME TO SAVE YOU. LET GO OF THE BRANCH."
- Okay, Lord, I'll trust you, here I... here I go!" And he falls
-to his death.
- "DUMB YANKEE."
-%
-A New Yorker was driving through Berkeley when he saw a big crowd gathered
-by the side of the street. Curiosity got the better of him and he leaned
-out of his window to ask an onlooker what was going on. The fellow explained
-that a protestor against the U.S. position in South America had doused
-himself with gasoline and set himself on fire. "That's terrible," gasped
-the man. "But why is everyone still standing around?"
- "Well, they're taking up a collection for his wife and kids," the
-onlooker explained. "Would you be willing to help?"
- "Well, sure," replied the New Yorker. "I suppose I could spare a
-gallon or two."
-%
-A Nixon [is preferable to] a Dean Rusk -- who will be passionately
-wrong with a high sense of consistency.
- -- J. K. Galbraith
-%
-A non-vegetarian anti-abortionist is a contradiction in terms.
- -- Phyllis Schlafly
-%
-A Norse god decides to assume human form, come down from Valhalla, and check
-out the local action. He finds himself in the piano bar of Caesar's Boardwalk
-Regency in Atlantic City, and sits down to sip an Acquavit or two. After a few
-minutes, an extremely attractive young woman, having been taken with his form
-and features, sends a drink down to him, then joins him. The chemistry between
-them is immediate and total. They have the next drink in her room, and spend
-the night repeatedly making passionate love. The woman has no idea of her
-partner's true identity; all she knows is he's driving her mad. In the
-morning, the Norse god jumps into the shower. Reflecting on the previous
-night he decides that he wants to be honest with his new lover. Without even
-bothering to wrap himself in a towel, he leaps from the shower into the room,
-where the woman is still in bed, exhausted. He kneels beside the bed, looks
-deep into her eyes and says, "Honey, I have something very important to tell
-you -- I'm Thor!".
- The woman looks at him. "You're Thor?", she says. "My inthides feel
-like grated cheeth!"
-%
-A nubile female virtually never experiences difficulty in finding willing
-sexual partners, and in a natural habitat nubile females are probably always
-married. The basic female "strategy" is to obtain the best possible husband,
-to be fertilized by the fittest available male (always, of course, taking
-risk into account), and to maximize the returns on sexual favors bestowed:
-to be sexually aroused by the sight of males would promote random matings,
-thus undermining all of these aims, and would also waste time and energy
-that could be spent in economically significant activities and in nurturing
-children. A female's reproductive success would be seriously compromised
-by the propensity to be sexually aroused by the sight of males.
- -- Donald Symons, "The Evolution of Human Sexuality",
- attempting to explain the lack of female interest in
- pornography.
-%
-A nuclear family is out golfing one day, when it becomes clear that Dad isn't
-going to win any trophies, at least on this course. On the 3rd hole, after
-two miserable bogies, he misses a two foot putt and exclaims, "Shit!"
- His wife glances over at their sixteen year old daughter and says
-nothing.
- On the fourth hole Dad tees off with an incredible hook, and, after
-the inevitable exclamation, his wife reproves him with "Honey!"
- This continues on, with his golfing getting worse and his wife getting
-more and more upset about his language. Finally, on the 17th hole, he again
-misses a very easy putt. Flinging his club down, he curses the hole, the
-club, and the sunset, using the word "fuck" for the first time. His wife
-whirls around and cries, "Honey! Our daughter is standing right next to you!"
- Feeling remorseful, but somewhat defensive, he turns to the
-daughter and says, "Well, Cindy, you've heard that word before, haven't
-you?"
- "Yes," the daughter replies, "but never in anger."
-%
-A nymph hits you and steals your virginity.
-%
-A pair of suburban couples who had known each other for quite some time
-talked it over and decided to do a little conjugal swapping. The trade
-was made the following evening and the newly arranged couples retired to
-their respective houses. After about an hour of bedroom bliss, one of
-the wives propped herself up on an elbow, looked at her new partner and
-said: "Well, I wonder how the boys are getting along?"
-%
-A pederastic necrophiliac is a gentleman who is
-true to the very end of the end of a friend.
-%
-A perfectly honest woman, a woman who never flatters, who never manages,
-who never cajoles, who never conceals, who never uses her eyes, who never
-speculates on the effect which she produces, who never is conscious of
-unspoken admiration, what a monster, I say, would such a female be!
- -- Thackeray
-%
-A performing octopus could play the piano, the zither and a piccolo, and his
-trainer wanted him to add the bagpipe to his accomplishments. With this in
-mind, a bagpipe was placed in the octopus's room, and the trainer awaited
-results. Hours passed, but no bagpipe music was heard. Since the talented
-octopus usually learned quickly, the trainer was disturbed. Opening the door
-the next morning, he asked the octopus,
- "Have you learned to play that thing yet?"
- "Play it!" retorted the octopus. "I've been trying to lay it all
-night!"
-%
-A person who has both feet planted firmly in the air can be safely
-called a liberal.
-%
-A policeman is walking his beat when he finds an inebriated man collapsed
-against a building, weeping uncontrollably and holding his car keys in his
-hands. He's moaning something about how "They took my car!" Seeing that
-the man is well-dressed, the officer suspects that he may have a real case
-of theft on his hands and attempts to question the man.
- "What happened to your car?"
- "My car, it was right on the end of my key, and those bastards
-stole it! Please officer, get my Porsche back. My God, it was right on
-the end of my key! Where is it? They stole it and it was right here;
-right on my key!"
- "OK, OK, stand up, we'll see what we can do. You'll have to come
-down to the stat... Mister, your fly's unzipped and you're exposing
-yourself!"
- "Oh my God, they stole my girlfriend!"
-%
-A pretty woman can do anything; an ugly woman must do everything.
-%
-A proctologist is a doctor who puts in a hard day at the orifice.
-%
-A Puritan is someone who is deathly afraid that someone, somewhere, is
-having fun.
-%
-A rabbi and a priest are sitting together on a train, and the rabbi leans
-over and asks, "So, how high can you advance in your organization?"
- The priest replies, "Well, if I am lucky, I guess I could become a
-Bishop."
- "Well, could you get any higher than that?"
- "I suppose that if my works are seen in a very good light that I
-might be made an Archbishop."
- "Is there any way that you might go higher than that?"
- "If all the Saints should smile, I guess I could be made a Cardinal."
- "Could you be anything higher than a Cardinal?"
- Hesitating a little bit, the priest said, "I suppose that I could
-be elected Pope, but only if it's God's will."
- "And could you be anything higher than that, is there any way to go
-up from being the Pope?"
- "What?! I should be the Messiah himself?!"
- The rabbi leaned back and smiled. "One of our boys made it."
-%
-A reactionary is a man whose political opinions always manage to keep
-up with yesterday.
-%
-A real estate agent, looking over a farmer's house for possible sale,
-commented to the farmer how sturdy the house looked.
- The farmer replied, "Yep, built it with my bare hands... did it
-the hard way. The steps to the front door, here, carved 'em out of
-field stones... did it the hard way. That hardwood floor in the living
-room, dovetailed the pieces myself... did it the hard way. The ceiling
-beams, made 'em out of my own oak trees... did it the hard way."
- Just then, the farmer's gorgeous daughter walked in. The farmer
-looks over at the real estate agent who is trying not to stare too
-obviously and smiles. "Yep... standing up in a canoe."
-%
-A retired schoolteacher finally decided that she was tired of living alone
-and wanted some companionship, so after a good deal of thought she decided
-to visit the local pet shop. The owner suggested a parrot, with which she
-could conduct a civilized conversation. This seemed to be an excellent
-idea, so she bought a handsome parrot, sat him on a perch in her living room,
-and said, "Say 'Pretty boy.'" Silence from the bird. "Come on now, say
-'Pretty boy ... pretty boy.'"
- At long last, disgustedly, the bird said, "Oh, shit."
- Shocked, the schoolteacher said, "Just for that, you get five minutes
-in the refrigerator." Five minutes later she put the shivering bird back on
-its perch and said, "Now let's hear it: 'Pretty boy ... pretty boy.'"
- "Damn it, wouldja lay off, lady?" said the parrot.
- Outraged, the woman grabbed the bird, said, "That's it! Ten minutes
-in the freezer," and slammed the door on him.
- Hopping about to keep warm, what does the parrot come across but a
-big frozen turkey waiting for Thanksgiving. Startled, he squawks, "My God,
-you must have told the bitch to go fuck herself!"
-%
-A Scotsman clad in a kilt walks up to the counter in an Apothecary. From
-his pocket he takes a plaid condom that has been heavily used, torn, patched,
-sewn, and is currently split down one side. He asks the proprietor, "How much
-to replace this, Ian?" The proprietor says, "Why, Angus, that'll be four
-pence." Then the Scotsman asks, "How much to repair?" The prop. looks the
-condom over carefully, and says "Three pence to repair." The Scotsman ponders
-for a moment, then says, "I'll be back."
- Later in the day, the Scotsman returns with a smile on his face and
-says, "Ian, the Regiment has voted to repair!"
-%
-A Scotsman clad in kilts left a bar one evening fair.
-One could tell by how he walked, he'd drunk more than his share.
-He staggered on until he could no longer keep his feet.
-So he stumbled off into the grass to sleep beside the street.
-
-Later on two young and lovely girls just happened by.
-One says to the other, with a twinkle in her eye.
-"See yon sleeping Scotsman so young and handsome built?"
-"I wonder if it's true what they don't wear beneath their kilts?"
-
-They stepped up to the Scotsman, so young and fancy free.
-They lifted up his kilt above the waist so they could see.
-And there behold for them the view beneath his Scottish skirt,
-Was nothing more than God had graced him with upon his birth.
-
-They marveled for a moment, then one said, "Best be gone."
-"Let's leave a present for our friend before we move along."
-As a gift they left a blue ribbon tied into a bow,
-Around the bonny star of the Scot's kilt lifting show.
-
-The Scot awoke to nature's call and stumbled to the trees.
-Behind a bush he lifts his kilt and gawks at what he sees.
-Then in a startled voice he says to what's before his eyes,
-"Och, lad I dinna know whar' ya been, but I see ya won first prize."
- -- Mike Cross, "The Scotsman"
-%
-A sheriff arrived at the scene of the horrible accident just as his deputy,
-all alone, was climbing down from the controls of a bulldozer. "Say,
-Junior, what's goin' on?" asked the sheriff.
- "A bus full of migrant workers went out of control and over the
-cliff, and I just finished buryin' 'em," explained the deputy.
- "Good work, boy," replied the sheriff. "Pretty gory work -- were
-all of 'em dead?"
- Junior nodded sadly and said, "Some of them said they weren't, but
-you know how them Mex'cans lie."
-%
-A shy young man, preparing himself for what he hoped would be the ultimate sex
-act with a pretty young lady, went into a drugstore to inquire about sizes and
-styles of condoms. The lusty proprietress, a buxom widow, saw an opportunity
-for fun at the lad's expense.
- "Come in the back and try some on for size," she said, taking his hand.
-The widow unzipped the youth's fly and watched the small instrument grow in
-her hand as she measured it. When the weapon had unfurled to a rosy seven and
-a half inches, the young man, unable to contain himself, had an orgasm with a
-tremendous discharge. After recovering, he asked the widow if she could now
-give him the proper size.
- "I'll do more than that," she said. "I'll give you free meals and a
-half interest in the store."
-%
-A son takes his Italian immigrant father to his first baseball game. It
-happens that it's Old Timer's Day at Yankee stadium and all the baseball
-greats are there. The son escorts his father to box seats right on the
-third base line and seats him with beer and a Yankees cap.
- The first batter up is Mickey Mantle. On the second pitch he
-swings that bat and CRACK! The ball ricochets off the wall for a double.
-The crowd goes crazy and the father stands up and yells, "Runna Mickey!
-Runna Mickey!"
- The next batter up is Joe DiMaggio. The pitcher, pitching him
-carefully, works him to a 3-2 count and just misses the outside corner.
- "Ball four!" yells the umpire and Joe tosses his bat aside and begins
-to walk to first base.
- The father yells out, "Runna Joe! Runna Joe!"
- "No, no, Pop," corrects his son. "He got four balls. He walks."
- And the old man clenches his fist and says solemnly, "Walka proud
-Joe. Walka proud."
-%
-A stately-looking matron was walking through the Bronx Zoo, studying the
-animals. When she passed the porcupine enclosure she beckoned to a nearby
-attendant.
- "Young man," she began, "do North American porcupines have sharper
-pricks than those raised in Africa?"
- The attendant hesitated for a moment. "Well, ma'am," he answered,
-"the African porcupine's quills are sharper... but I think their pricks are
-about the same."
-%
-A stranger had just arrived in the mining town and was spending the evening at
-the local saloon. After a few drinks, he mentioned to the bartender that he
-hadn't seen a single woman in the entire town.
- The bartender replied, "Nope. Ain't no women in this town!"
- "No women? What do the men do for... er..."
- "Oh, for sex? Did you see all those pigs in the street? That's the
-answer, right there."
- Shaking his head incredulously, the stranger settled back to his
-drinking. Within a short time, however, the liquor had convinced him that he
-wanted to try out a pig himself. He had watched several miners walk upstairs
-to the trysting rooms with squealing piglets under their arms. Now, he was
-game to make his move. He wandered out to the back of the saloon and chose
-a nice fat, pink sow. As he walked to the stairs, the entire saloon went
-quiet. In the embarrassing hush, all eyes were upon him.
- "What's the matter? I thought all you fellows did this!"
- "Yeah, but that's Black Bart's girl," replied the barkeep.
-%
-A stunning blonde, but probably all bean dip above the eyebrows.
-%
-A sweet young schoolteacher who had always been virtuous was invited to go
-for a ride in the country with the gym instructor, whom she admired. Under
-a tree on the bank of a quiet lake, she struggled with her conscience and
-with the gym instructor and finally gave in to the latter. Sobbing
-uncontrollably she asked her seducer,
- "How can I ever face my students again, knowing I have sinned twice?"
- "Twice?" asked the young man, confused.
- "Why, yes," said the sweet teacher, wiping a tear from her eye.
-"You're going to do it again, aren't you?"
-%
-A teacher announces to her class, "Children, the student who can name the
-greatest man who ever lived will win a shiny red apple."
- Immediately an Italian boy raises his hand.
- "Yes, Tony?"
- "Christopher Columbus!" says Tony.
- "Well," says the teacher, "Christopher Columbus was a very great man,
-but I don't think he was the greatest man who ever lived."
- From the back of the room little Bernie Goldstein raises his hand.
- "Yes, Bernie?"
- "Jesus Christ", says Bernie.
- "That is correct, Bernie," pronounces the teacher. "And here is
-your apple."
- When Bernie gets up to the front of the room to claim his prize,
-the teacher says, "Bernie, given the fact that you're Jewish, I'm surprised
-that you thought Jesus was the greatest man who ever lived."
- "Well, actually," replies Bernie, "I do think Moses had the edge,
-but business is business."
-%
-A toast to the kisses you've snatched and vice-versa.
-%
-A traveling circus was performing in a small town, around the turn of the
-century, when many of the circus animals were still considered to be very
-rare and exotic. One night one of the elephants escaped. It was hungry
-and found a garden in a little old lady's backyard. The woman, who had
-never before seen an elephant, was hysterical and called the police.
-
-Little Old Lady: "There's a *huge* monster in my garden!
-Police: "Calm down, ma'am, everything will be all right. Now exactly what
- does it look like?"
-LOL: "It's a dark color and it's tremendous! It's pulling up my
- vegetables with its tail!"
-Police: "With its tail? Then what's it doing?"
-LOL: "You wouldn't believe me if I told you!"
-%
-A vasectomy means never having to say you're sorry.
-%
-A virgin is chaste.
-%
-A virginal is a harpsichord that has never been plucked.
-%
-A virtuous abstinence from the joys of pederasty
-comes most easily to those who have no taste for it.
- -- Oscar Wilde
-%
-A widow is more sought after than an old maid of the same age.
- -- Addison
-%
-A wife lasts only for the length of the marriage, but an ex-wife is there
-*for the rest of your life*.
- -- Jim Samuels
-%
-A witty writer, K. Kraus in the Vienna "Fackel", has as it were, expressed
-this truth paradoxically in the cynical saying: "Coitus is merely an
-unsatisfactory substitute for onanism!"
- -- Sigmund Freud, attempting to explain why
- masturbation is "by no means harmless"
-%
-A woman can never be too rich or too thin.
-%
-A woman employs sincerity only when every other form of deception has failed.
- -- Scott
-%
-A woman forgives the audacity of which
-her beauty has prompted us to be guilty.
- -- LeSage
-%
-A woman had a followup visit with her doctor after his prescribing fairly high
-dosages of testosterone (a male hormone) for her. She was a little worried
-about some of the side effects she was experiencing.
- "Doctor Keyes, the hormones you've been giving me have helped a lot
-with my menopausal symptoms, but I'm really afraid that you're giving me too
-much. I've started growing hair in places that I've never grown hair before!"
- The doctor reassured her. "A little hair growth is a perfectly normal
-side effect of testosterone. Just where has this hair appeared?"
- "On my balls."
-%
-A woman has got to love a bad man once or twice in her life to be
-thankful for a good one.
- -- Marjorie Kinnan Rawlings
-%
-A woman is driving down the street, her ten-year-old daughter belted into
-the passenger seat. The daughter asks "Mommy, how old are you?"
- The mother says "That's a personal question. It's not nice to ask
-people personal questions."
- The daughter thinks a while, then asks "Mommy, how much do you weigh?"
- The mother replies "That's a personal question too. I'm not going
-to tell you."
- Chastised, the daughter asks no more questions. The mother parks the
-car. "I'm going to see Mrs. Tristan for a couple of minutes. You stay here in
-the car and watch my purse."
- After the mother leaves, the daughter removes her mother's driver's
-license from the purse, studies it for a few minutes and replaces it. When
-her mother returns they drive off. The little girl comments:
- "Mommy, I know how old you are. You're 32."
- "That's right! How did you know?"
- "And you weigh 119 pounds."
- "Did you look in my purse?"
- "And I know why you and Daddy divorced."
- "You *do*?"
- "Yes," said the daughter. "Because you flunked sex!"
-%
-A woman is like a dresser ... some man always goin' through her
-drawers.
- -- Blind Lemon Pledge
-%
-A woman is like your shadow; follow her,
-she flies; fly from her, she follows.
- -- Chamfort
-%
-A woman must be a cute, cuddly, naive
-little thing -- tender, sweet, and stupid.
- -- Adolf Hitler
-%
-A woman occasionally is quite a serviceable substitute for masturbation.
-It takes an abundance of imagination, to be sure.
- -- Karl Kraus, "Die Fackel"
-%
-A woman of generous character will sacrifice her life a thousand times
-over for her lover, but will break with him for ever over a question of
-pride -- for the opening or the shutting of a door.
- -- Stendhal
-%
-A woman takes off her claim to respect along with her garments.
- -- Herodotus
-%
-A woman who is guided by the head and not by the heart is a social
-pestilence: she has all the defects of the passionate and affectionate
-woman, with none of her compensations; she is without pity, without
-love, without virtue, without sex.
- -- Honore de Balzac
-%
-A woman who is unfaithful deserves to be shot.
- -- Pancho Villa
-%
-A woman's a woman until the day she dies, but a man's only a man as long
-as he can.
- -- Moms Mabley
-%
-A young boy is told by his puritanical father than he should never have
-sex with a woman, because a woman has teeth in her vagina and will bite
-off his penis.
- The years go by, and the boy finally marries. After a rather
-uninspiring honeymoon his wife finally confronts him and demands that he
-tell her why he won't make love to her.
- "Well, honey," he replies. "You have... teeth... down there."
- "What!?" she replies unbelievingly. "No I don't! Honest, darling,
-come here and look for yourself."
- The man rather hesitantly examines her very thoroughly.
- "There!" his wife says triumphantly. "Now do you believe me?"
- "Yes," replied her husband. "And your gums are in *terrible*
-condition."
-%
-A young lady friend of mine just swallowed a razor blade...
-She performed a tonsillectomy, an appendectomy, a hysterectomy,
-three circumcisions, and cut off the finger of a casual friend.
-%
-A young man walks into a bus station, and goes into the men's room to relieve
-himself. When he steps in he sees a leprechaun with the most enormous penis
-he has ever seen. As he urinates, he cannot avoid spying on the giant member
-of the tiny man dressed in green. The leprechaun zips up and the man asks him
-if he is indeed a real leprechaun.
- The little man says, "Aye, me laddie, I'm a leprechaun, and I can
-grant you three wishes."
- "Oh, wow!" comes the reply, "What do I need to do?"
- "Well, havin' such a large cock makes it a bit awkward with the
-ladies, the thing not fittin' and all... I'll grant you your three wishes
-if you wouldn't mind suckin' me dick 'til I come." The man is a bit taken
-aback, but agrees, realizing that the three wishes will be priceless. After
-the tiny fellow has come, he starts to walk away.
- The man exclaims, "Hey, what about my three wishes?"
- Replies the leprechaun, "How old are you, me boy?"
- "25."
- "Aren't you a wee bit old to be believin' in leprechauns?"
-%
-A young New York housewife was shocked by some of the language used by her
-daughter. When asked about it, the daughter said she had learned it from
-a small girl she played with in the park. The next day, the mother sought
-out the little girl as she played in the park. "Are you the little girl
-who uses bad words?"
- "Who told you?"
- "A little bird," answered the mother.
- "Well, I like that!" exclaimed the small girl. "And I've been
-feeding the little bastards, too!"
-%
-A young woman was afflicted with three brothers who had a friendly competition
-as to who was the best practical joker. When she announced her marriage,
-like all good brothers, they immediately found out where the honeymoon would
-be and repaired there to do their worst, er, best. The brother who was a
-carpenter went first, and came back out in five minutes. The brother who
-worked as a plumber went second and was out in about half an hour. Finally,
-the brother employed as a dentist went inside and came out almost immediately.
-A few days after the start of their sister's honeymoon the brothers each
-received a telegram from their sister. It read:
-
- I liked the couch falling apart when we sat on it. I was amused
- when the shower went cold five minutes after it started. But I'm
- going to kill whoever put the novocaine into the KY jelly...
-%
-A.A.A.A.A., n.:
- An organization for drunks who drive.
-%
-Aboard the good ship Venus, The cabin boy, the captain's joy,
-The mast it was a penis, A cunning little nipper,
- Her figurehead They filled his ass,
- A whore in bed, With broken glass,
-Good grief you should have seen us! And circumcised the skipper.
-
-The first mate's name was Higgins, The captain's daughter Mabel,
-And Higgins was a biggins, They screwed when they were able,
- Once round the deck, They nailed her tits,
- Twice up the mast, Those nasty shits,
-And the rest was used for riggins'! Right to the captain's table.
-
-The engineer's name was Carter, The second mate's name was Andy,
-And Carter was a farter, By God, he was a dandy,
- When the wind wouldn't blow, They broke his cock,
- And the ship couldn't go, With chunks of rock,
-Carter the farter would start her! For conking in the brandy!
-%
-Absinthe makes the tart grow fonder.
-%
-Acceptance without proof is the fundamental characteristic of Western
-religion, Rejection without proof is the fundamental characteristic of
-Western science.
- -- Gary Zukav, "The Dancing Wu Li Masters"
-%
-AC/DC is a rock band.
- -- Bisexuality, 101
-%
-Achilles' Biological Findings:
- (1) If a child looks like his father, that's heredity. If he
- looks like a neighbor, that's environment.
- (2) A lot of time has been wasted arguing over what came first
- -- the chicken or the egg. It was undoubtedly the
- rooster.
-%
-Adam's Law:
- (1) Women don't know what they want;
- they don't like what they have got.
- (2) Men know very well what they want;
- having got it, they begin to lose interest.
-%
-Admittedly, there are a lot of things that are better than sex,
-and a lot more that are worse; but there's nothing quite like it...
-%
-Adopting the metric system would have certain psychological advantages --
-such as being able to claim 18 centimeters instead of seven inches.
-%
-ADULTERY:
- Putting yourself in someone else's position.
-%
-Advertising is the most fun of anything you can do with your clothes on.
- -- Mary Wells, advertising executive
-%
-After a few steamy dances and a few more drinks, the pickup couple
-are back at his place tearing their clothes off. Things are really
-starting to heat up when he leaps out of bed and starts frantically
-rummaging through a dresser drawer.
- "What are you doing?" she asks.
- "Just a second, honey, I'm trying to find my lucky rubber."
-%
-After an evening at the theatre and several nightcaps at an intimate little
-bistro, the young man whispered to his date, "How do you feel about making
-love to men?"
- "That's MY business," she snapped.
- "Ah," he said. "A professional."
-%
-After cocktails in the Oak Room, the graying millionaire took the blond,
-attractive, wholesome, winning young woman up to his suite. They chatted
-for a while, and then kissed on the couch. A little fondling, some feeling
-and petting ... to which the young lady lent herself shyly ... and then they
-were in the wide, cool bed, naked together. They chatted more, established
-a communion, a rapport the older man considered remarkably gratifying. The
-girl seemed sympatico, innocent, good.
- "Yes, that was it," he thought, "essentially good. Why, she could
-be my own daughter." He smiled into the young girl's deep blue eyes.
- "Tell me," he asked, his hand on her breast, "What's a nice girl
-like you doing in a hotel like this?"
- "Oh, about $2000 a week, with tips."
-%
-After I run your program, let's make love like crazed weasels, OK?
-%
-After Joan and Max had been married for 25 years, Max became disinterested
-in sex, and his libido began to wan dramatically. In desperation, Joan
-hauled him to a marriage counselor, who listened patiently to Joan's complaints
-and Max's protestations. Max claimed that he was being nagged unmercifully
-to fulfill Joan's needs, and that after awhile every marriage tended to
-become less physical. Joan said that that wasn't true and that she had
-needs and desires that he, as her husband, was expected to fulfill. Finally,
-the counselor issued the verdict. "Max," he said, "Everybody has to give a
-little for a marriage to work. From now on, no matter how you feel at the
-time, you must give Joan her conjugal rights at least semi-annually. And,
-remember, do it in a loving, considerate manner; after all, you and your
-wife are a partnership of love." Joan was delighted, and floated out of the
-counselor's offices. On the way downstairs, she nudged Max.
- "So, honey, tell me... how many times a week is semi-annually?"
-%
-After making a daring escape from the penitentiary, the convict eluded
-bloodhounds and police roadblocks and dodged helicopter searchlights on
-his way to see his wife. Finally sneaking in the back entrance, he knocked
-on the door and smiled triumphantly as she opened it. "Where the hell have
-you been?" she blared. "You busted out more than six hours ago!"
-%
-After repeatedly warding off her date's amorous advances during the evening,
-the pretty young thing decided to put her foot down: "See here," she shouted
-indignantly. "This is positively the last time I'm going to tell you `no'."
- "Splendid!" exclaimed her date. "Now we can start making some
-progress."
-%
-After rushing into a drugstore, the nervous young man was obviously
-embarrassed when a prim thirty-ish woman asked if she could serve him.
- "N-no," he stammered, "I'd like to see the druggist."
- "I'm the druggist", she replied cheerfully.
- "Oh.. well, uh, it's nothing important," he said, and turned to leave.
- "Young man," said the woman, "my sister and I have been running this
-drugstore for nearly ten years. There is nothing you can tell us that will
-embarrass us.
- "Well, all right," he said. "I have this awful sexual hunger that
-nothing will appease. No matter how many times I make love, I still want to
-make love again and again. Is there anything you can give me for it?"
- "Just a moment," said the woman, "I'll have to discuss this with my
-sister."
- A few minutes later, she returned. "The best we can do," she said,
-"is room and board and a half-interest in the business."
-%
-After spending a forbidden night on the town, two young nuns were trying
-to sneak through the fence surrounding their Convent.
- "You know," giggled one as she held the wire apart for the other
-to crawl through, "I feel like a Marine."
- "So do I," the other nun sighed, "but where are we going to
-find one at three in the morning?"
-%
-After twelve years of therapy my psychiatrist said something that
-brought tears to my eyes. He said, "No hablo ingles."
- -- Ronnie Shakes
-%
-After we made love he took a piece of chalk and made an outline of my body.
- -- Joan Rivers
-%
-Ah spring, when a fancy young man lightly turns his lover over.
-%
-A.I. hackers do it with robots.
-%
-Aide to Raygun: Sir, the poor are outside protesting your budget
- cuts.
-Raygun himself: Tell them they'll have to help themselves.
-Aide to Raygun: Sir, the Pentagon wants another $30 billion.
-Raygun himself: Tell them to help themselves.
-%
-Al Gore resembled a Vulcan desperately in need of a blow job.
- -- Bobcat Goldthwait
-%
-Alaska, where Moosehead isn't a beer, it's a misdemeanor.
-
-Q: You know how to figure out if your lover's been "involved"?
-A: Antler marks on their hips.
-%
-Alcohol is like love: the first kiss is magic, the second is intimate,
-the third is routine. After that you just take the girl's clothes off.
- -- Raymond Chandler
-%
-Alcoholics Anonymous is when you get to drink under someone else's name.
-%
-Alex came home from a business trip to Chicago and found no one home but his
-daughter Rose, who was crying bitterly.
- "What's the matter, darling?" asked Alex.
- "Mommy almost died last night," sobbed Rose.
- "That's nonsense," said the father. "Why do you say that?"
- "Well," said Rose,"you always told us that when we die we'll see God;
-so when I heard Mommy moaning last night I rushed to her bedroom and she was
-screaming, "Oh God, here I come," and she would have but Uncle Jerry held her
-down."
-%
-"Algorithms" is an anagram for "Hilt orgasm". Maybe this explains
-the popularity of this field of study in computer science.
-%
-Alimony, n.:
- Having an ex you can bank on.
-%
-All a hacker needs is a tight PUSHJ, a loose pair of UUOs, and a warm
-place to shift.
-%
-All husbands are alike, but they have different faces so you can tell
-them apart.
-%
-All I really want in life is a piece and some quiet.
-%
-All I want is a girl made of wood,
-With fine-grained hair and carven knee.
-She wouldn't drink and wouldn't smoke,
-Oh, wooden tit be loverly?
- -- Pinocchio
-%
-All jobs should be open to everybody, unless they actually require a
-penis or a vagina.
- -- Florynce Kennedy
-
-There are really not many jobs that actually require a penis
-or a vagina, and all other occupations should be open to everyone.
- -- Gloria Steinem
-%
-All religions issue Bibles against Satan, and say the most
-injurious things against him, but we never hear his side.
- -- Mark Twain
-%
-All the girls in France, do a hookie-kookie dance,
-And you know the way they shake, is enough to fry a snake,
-And the snake they fry, is enough to tell a lie,
-And the lie they tell, is enough to go to
-Hello, operator, give me number nine,
-If you disconnect me, I'll kick you in the
-Behind the 'frigerator, there was a piece of glass,
-If you do not pick it up, I'll kick you in the
-Ask me no more questions, tell me no more lies,
-This is what Lulu told me, just before she died.
-She had a little brother, she named him Tiny Tim,
-She put him in the potty, to see if he could swim.
-He swam down to the bottom, he swam up to the top,
-Lulu got disgusted, and flushed him down the pot.
- -- Princess
-%
-All the waters of the earth are in the armpit of the Great Frog.
- -- R. Crumb
-%
-All things dull and ugly, All creatures short and squat,
- All things rude and nasty, The Lord God made the lot;
-Each little snake that poisons, Each little wasp that stings,
- He made their brutish venom, He made their horrid wings.
-All things sick and cancerous, All evil great and small,
- All things foul and dangerous, The Lord God made them all.
-Each nasty little hornet, Each beastly little squid.
- Who made the spikey urchin? Who made the sharks? He did.
-All things scabbed and ulcerous, All pox both great and small.
- Putrid, foul and gangrenous, The Lord God made them all.
- -- Monty Python's Flying Circus
-%
-All this big deal about white collar crime -- what's WRONG with white collar
-crime? Who enjoys his job today? You? Me? Anybody? The only satisfying
-part of any job is coffee break, lunch hour and quitting time. Years ago
-there was at least the hope of improvement -- eventual promotion -- more
-important jobs to come. Once you can be sold the myth that you may make
-president of the company you'll hardly ever steal stamps. But nobody
-believes he's going to be president anymore. The more people change jobs
-the more they realize that there is a direct connection between working for
-a living and total stupefying boredom. So why NOT take revenge? You're not
-going to find ME knocking a guy because he pads an expense account and his
-home stationery carries the company emblem. Take away crime from the white
-collar worker and you will rob him of his last vestige of job interest.
- -- J. Feiffer
-%
-All work and no pay makes a housewife.
-%
-Already the spirit of our schooling is permeated with the feeling that every
-subject, every topic, every fact, every professed truth must be submitted
-to a certain publicity and impartiality. All proffered samples of learning
-must go to the same assay-room and be subjected to common tests. It is the
-essence of all dogmatic faiths to hold that any such "show-down" is
-sacrilegious and perverse. The characteristic of religion, from their point
-of view, is that it is intellectually secret, not public; peculiarly revealed,
-not generally known; authoritatively declared, not communicated and tested
-in ordinary ways...It is pertinent to point out that, as long as religion
-is conceived as it is now by the great majority of professed religionists,
-there is something self-contradictory in speaking of education in religion
-in the same sense in which we speak of education in topics where the method
-of free inquiry has made its way. The "religious" would be the last to be
-willing that either the history of the content of religion should be taught
-in this spirit; while those to whom the scientific standpoint is not merely
-a technical device, but is the embodiment of the integrity of mind, must
-protest against its being taught in any other spirit.
- -- John Dewey, "Democracy in the Schools" (1908)
-%
-Alright, yes, date, and shop, and hang out, and go to school ... and
-save the world from unspeakable demons. You know, I want to do girlie
-stuff.
- -- Buffy, Buffy the Vampire Slayer, "Faith, Hope & Trick"
- Season 3, Episode 3
-%
-Although a fifth-generation American, Father Sweeny was more Irish than most
-of Erin's natives. He spoke with an Irish brogue which had mysteriously
-appeared during his nineteenth year and he *hated* the English. Due to his
-proclivity to belabor the British from his pulpit, complaints to his
-superiors were not infrequent. He would blame anything evil or merely
-inconvenient on the English people. If there was an act of terrorism, the
-responsibility was promptly laid at the feet of the Brits. If there was a
-natural disaster, undoubtedly the English government was an accessory to
-the fact, if not outrightly culpable. Repeatedly, his superiors called him
-on the carpet for his behavior. After a particularly vituperative
-anti-British broadside, the Bishop instructed Father Sweeny to come straight
-to his office; do not pass GO; do not collect two hundred dollars. Summing
-up a humiliating and soul-marking reprimand, the Bishop ended with: "Next
-week is Saint Patrick's Day. If you so much as *mention* the British, it's
-your last sermon!"
-
-The following Sunday, as Father Sweeny spoke lovingly and eloquently of
-Saint Patrick, and he made a reference to the last Passover celebrated by
-Christ and His disciples. "Sure, an' you're all familiar with the tale.
-You know that Our Lord sat at the table and told his disciples that one
-among them would betray Him. As He looked around the table, He stopped at
-Peter, the Rock, who said, `Not I, Lord!' He looked at Thomas, who doubted,
-and Thomas said, `I could never do such a thing!' Then the Lord looked long
-and hard at Judas Iscariot, who said, `Cor, bloimy, Guv'na, you couldn't
-main may!'"
-%
-Always talk to your wife while you're
-making love... if there's a phone handy.
-%
-Ambition, n.:
- An ant crawling up an elephant's leg with rape on his mind.
-%
-America ... just a nation of two hundred million used car salesman
-with all the money we need to buy guns and no qualms about killing
-anybody else in the world who tries to make us uncomfortable.
- -- Hunter S. Thompson, "Fear and Loathing:
- On the Campaign Trail"
-%
-America cannot be sold a can of beer without
-being offered a piece of pussy along with it.
- -- Julius Lester
-%
-America, I'm putting my queer shoulder to the wheel.
- -- Allen Ginsberg
-%
-America is a large, friendly dog in a very small room. Every time it
-wags its tail, it knocks over a chair.
- -- Arnold Joseph Toynbee
-%
-American culture is based on the automobile, and any young man of promise
-is going to own one and want to travel great distances in it. Consequently,
-any young woman of aspiration should expect to spend most of her vacations
-in a car, probing into unfamiliar corners. She is not required to know how
-to drive but she will certainly be expected to read the road map while her
-husband drives, and if she can't, or if she's abnormally slow in giving him
-help, she's bound to cause trouble. Therefore, you'd think that colleges
-which train the bright young women who're going to marry the bright young
-men who are going to own the Cadillacs that roar back and forth across this
-continent would teach the girls to read maps. None do. They teach a hundred
-other useless things, but never a word about the one that will cause the
-greatest friction.
- -- James Michener, "Space"
-%
-Americans have different ways of saying things. They say "elevator,"
-we say "lift" ... they say "President," we say "stupid psychopathic
-git."
- -- Alexei Sayle
-%
-America's two greatest inventions are finger-fucking and carpet-bombing.
- -- Lyndon B. Johnson
-%
-An 11 is a 10 who doesn't have headaches.
-%
-An American, a Frenchman, and a Vietnamese refugee had a discussion about
-the happiness of life.
- "To me, happiness is returning home on a Monday evening, having a wonderful
-dinner prepared by my wife, then slouching on the sofa watching Monday Night
-Football," the American said.
- "You Americans are not romantic at all", the French injected, "Sharing
-a beautiful evening with my lover, walking along the Seine river, and having a
-romantic dinner on top of the Eiffel tower. That is happiness of life."
- "You call those things happiness", the Vietnamese laughed, "then you
-two still don't understand life at all. Imagine this. You are sleeping
-soundly at night in Saigon. Then suddenly you hear loud knocks on your front
-door. You hear loud voices, 'Mr. Nguyen Van Binh, open the door!'. Quaking
-with fear, you rush out and open the door. Right there, you see two secret
-policemen ready to handcuff you. One of them says to you, 'Mr. Nguyen Van
-Binh, you are under arrest for your anti-revolutionary activities. You are
-being sent to the re-educational camp tonight!' Sweating profusely and
-shaking uncontrollably, you reply to them, 'Comrades, Mr. Nguyen Van Binh
-lives next door.' That moment is happiness in life, my friends.
-%
-An American businessman in London was given special visitor's privileges at an
-exclusive men's club. Striding in one afternoon, the American approached the
-only other man in the lounge and tried to strike up a conversation. "Care
-for a cigar?" he asked.
- "No, thank you," the Englishman replied. "I tried smoking once and
-didn't like it."
- "Would you care to join me in the bar for a drink, then?" the
-businessman asked.
- "No, thank you. I tried drinking once and it didn't agree with me."
- "Well, how about a game of billiards?"
- "Sorry. I tried it once and couldn't seem to get the hang of it."
- As the American started to turn away, the Englishman said, "But my
-son will be here shortly, and I'm sure he would enjoy a game with you."
- "Your son? An only child, I presume."
-%
-An American couple is in Paris, a much awaited trip, when suddenly the wife
-dies of a heart attack. The husband decides to have her buried there as the
-visit to France was something they had longed for for many years. All
-arrangements are made when he suddenly realizes that he doesn't have a black
-hat for the funeral. The hotel concierge tells him that what he wants is a
-"chapeau noir." So off he goes to find a store open late.
- First he meets a gendarme and in his fractured French asks, "M'sieur,
-ou pouvais-je acheter un capeau noir?"
- The policeman is a bit surprised but, after thinking a bit, gives our
-friend directions. The store -- if that is what it is -- looks a little seedy
-and run down, but the man behind the counter looks friendly so in goes our
-hero. He speaks first:
- "M'sieur, je veux acheter un capeau noir."
- "Mais, monsieur, j'ai des capeaux rouges, des capeaux blancs, et des
-capeaux marrons, mais pas des capeaux noires. Pourquoi avez vous besoin d'un
-capeau noir?"
- "Ma femme est morte."
- "O Monsieur! Quelle beau sentiment!"
-%
-An American walks into an Irish pub around lunchtime, and finds the place
-is completely filled and there are no chairs available, with the exception
-of one -- seating a Chihuahua next to a woman. He very politely asks her
-if she would mind placing her dog on the floor for a few minutes while he
-got a quick bite to eat.
- "I most certainly would!", the woman haughtily replies. "Little
-Fifi *always* sits next to me at lunchtime and there she will stay!"
- Whereupon, the American picks up the Chihuahua, throws it out of
-an open window and takes the seat.
- An Irishman, watching the whole encounter, walks over, taps the
-American on the shoulder and says, "Mate, I guess I never will understand
-you Americans. You drink your beer cold, drive on the right side of the
-street, and you just threw the wrong bitch out the window!"
-%
-An angst-ridden amorist, Fred,
-Saw sartorial changes ahead.
- His mind kept on ringing
- With fishy girls singing;
-Soft fruit also filled him with dread.
- -- J. Walker, "The Love Song Of J. Alfred Prufrock"
-%
-An Army travels on her stomach.
-%
-An egg has the shortest sex-life of all: it gets laid once; it gets
-eaten once. It also has to come in a box with 11 others, and the only
-person who will sit on its face is its mother.
-%
-An encounter with a beautiful woman is good medicine for the well organized
-logical mind -- a little jolt never hurt. Note that the anarchists have
-been saying this for years about the A-bomb and civilization.
- -- Encyclopadia Apocryphia
-%
-An office party is not, as is sometimes supposed the Managing Director's
-chance to kiss the tea-girl. It is the tea-girl's chance to kiss the
-Managing Director (however bizarre an ambition this may seem to anyone
-who has seen the Managing Director face on).
- -- Katherine Whitehorn, "Roundabout"
-%
-And Bezel saideth unto Sham: "Sham," he saideth, "Thou shalt goest
-unto the town of Begorrah, and there thou shalt fetcheth unto thine
-bosom 35 talents, and also shalt thou fetcheth a like number of cubits,
-provideth that they are nice and fresh."
- -- Dave Barry, "Getting Religion"
-%
-And do you not think that each of you women is an Eve? The judgment of God
-upon your sex endures today; and with it invariably endures your position of
-criminal at the bar of justice.
- -- Tertullian, second-century Christian writer
-%
-...And have you ever noticed that you never see the Father, the Son, and
-the Holy Ghost partying together at the same time? Oh, sure, everybody
-talks like they aren't the same person, but I wonder...
-%
-And having stretched me out upon his bed with my head a little to one side,
-he sat down next to me and raised my head upon his lap. He peered avidly at
-me, his eyes seemed ready to devour the secretion oozing from my nose. "Oh,
-the pretty little snotface," said he, beginning to pant, "How I'm going to
-suck her." Therewith bending down over me, and taking my nose in his mouth,
-not only did he devour all the mucus between my nose and mouth, but he even
-lewdly darted the tip of his tongue into each of my nostrils, one after the
-other, and with such cleverness he provoked two or three sneezes which
-redoubled the flow he desired and was consuming so hungrily. But ask me for
-no details bearing upon this fellow, Messieurs, nothing appeared, and whether
-because he did nothing, or because he did it all in his drawers, there was
-nothing to be seen, and amidst the multitude of his kisses and lecherous
-lickings there was nothing outstanding which might have denoted an ecstasy,
-and consequently it is my opinion that he did not discharge. All my clothes
-were in place, even his hands stayed still, and I give you my word that this
-old libertine's fantasy might be performed upon the world's most respectable
-and least initiated girl without her being able to suppose there was anything
-lewd in it at all.
- -- Marquis de Sade
-%
-And let me the canakin clink, clink;
-and let me the canakin clink.
- A soldier's a man;
- O, man's life's but a span,
-Why then, let a soldier drink.
-%
-And now, the Bing Crosby show, brought to you by the makers of Ex-Lax.
-... a brief pause, and then Bing!
-%
-And on the third day, Christ arose, pushed aside the rock that had served
-as the tomb door, and walked again on the earth.
- And as he departed, a passer-by pointed at the door Jesus had left
-open. "What's the matter with you?" he said. "Born in a barn?"
-%
-And prively he caughte hire by the queynte,
-And heeld hire harde by the haunche-bones.
- -- Geoffrey Chaucer, "The Miller's Tale"
-%
-And so it goes. It is humiliating, when you should know better, to become
-victim of the timeless story of the little brown dog running across the
-freight yard, crossing all the railroad tracks until a switch engine nipped
-off the end of his tail between wheel and rail. The little dog yelped, and
-he spun so quickly to check himself out that the next wheel chopped through
-his little brown neck. The moral is, of course, never lose your head over
-a piece of tail.
- -- John D. MacDonald, "The Scarlet Ruse"
-%
-And the northern lights commenced to glow.
-And she said, with a tear in her eye,
-"Watch out where the huskies go, and don't you eat that yellow snow."
- -- Frank Zappa, "The Story of Nanook and the Fur Trapper"
-%
-And then there was the lawyer that stepped in cow manure and thought
-he was melting...
-%
-Angel: We need you to distract the vampires.
-Buffy: Right.
-Xander: What are you going to do?
-Buffy: I'm going to kill them all. (Walking away)
- That oughta distract them.
- -- Buffy the Vampire Slayer, "When She Was Bad"
- Season 2, Episode 1
-%
-Another greeting card category consists of those persons who send out
-photographs of their families every year. In the same mail that brought the
-greetings from Marcia and Philip, my friend found such a conversation piece.
-"My God, Lida is enormous!" she exclaimed. I don't know why women want to
-record each year, for two or three hundred people to see, the ravages wrought
-upon them, their mates, and their progeny by the artillery of time, but
-between five and seven per cent of Christmas cards, at a rough estimate, are
-family groups, and even the most charitable recipient studies them for little
-signs of dissolution or derangement. Nothing cheers a woman more, I am afraid,
-than the proof that another woman is letting herself go, or has lost control
-of her figure, or is clearly driving her husband crazy, or is obviously
-drinking more than is good for her, or still doesn't know what to wear.
-Middle-aged husbands in such photographs are often described as looking
-"young enough to be her son," but they don't always escape so easily, and a
-couple opening envelopes in the season of mercy and good will sometimes handle
-a male friend or acquaintance rather sharply. "Good Lord!" the wife will say.
-"Frank looks like a sex-crazed shotgun slayer, doesn't he?" "Not to me," the
-husband may reply. "to me he looks more like a Wilkes-Barre dentist who is
-being sought by the police in connection with the disappearance of a choir
-singer."
- -- James Thurber, "Merry Christmas"
-%
-Another nun joke!!!
- You see, three nuns were walking down the street, when suddenly
-this flasher jumped out in front of them and opened his trench coat,
-exposing his all to the sisters. Well, two of the nuns had strokes right
-there, but the third nun wouldn't touch it.
-%
-Another stupid gay joke!!!
- You see, this gay man walks into a Texas bar and orders a strawberry
-daiquiri. The bartender looks him over with amusement and says: "We don't
-serve your kind, buddy, why don't you get out of here before the boys come
-in and kick your ass?"
- The guy whimpers a little and lisps, "Pleasse misssture I am soooo
-thurstay ..."
- Well, the bartender feels somewhat sorry for him and hands him a beer
-on the house on the condition that he drink it in the back and leave as soon
-as he's done. A little while later, a hulking cowboy walks in and up to the
-bar. He slams his fist on the bar and hollers, "I'm so thirsty, I could
-lick the sweat off of a bulls' balls!"
- From the back of the bar comes the cry... "Moo, moo, buckaroooooo!!!"
-%
-Anxiety, n.:
- The first time you can't do it a second time.
-
-Panic, n.:
- The second time you can't do it the first time.
-%
-Any girl who believes that the way to a man's heart is through
-his stomach is obviously setting her standards too high.
-%
-Any woman is a volume if one knows how to read her.
-%
-Anya: Look, I know you find me attractive, I've seen you looking
- at my breasts.
-Xander: Nothing personal, but when a guy does that it just means
- his eyes are open.
- -- Buffy the Vampire Slayer, "The Prom"
- Season 3, Episode 20
-%
-Anything created must necessarily be inferior to the essence of the creator.
- -- Claude Shouse
-
-Einstein's mother must have been one heck of a physicist.
- -- Joseph C. Wang
-%
-Anything more than three shakes is for fun.
-%
-APL hackers take all they want.
-%
-Apple owners do it with mice!
-%
-APPOINTMENT BOOK:
- The reference of last resort when trying to duck undesired
- invitations ("Gee, the soonest I can pencil you in is
- December, 2039"), or when trying to figure out what the hell
- it was you did during the past year.
-%
-Approximately 80% of our air pollution stems from hydrocarbons
-released by vegetation, so let's not go overboard in setting and
-enforcing tough emissions standards from man-made sources.
- -- Ronald Reagan
-%
-Are there those in the land of the brave
-Who can tell me how I should behave
- When I am disgraced
- Because I erased
-A file I intended to save?
-%
-ARIES (Mar. 21 to Apr. 19)
- Be cheerful today. People who don't like you will outnumber those
- who do. You have warts. Focus on domestic status, financial matters,
- and venereal disease. Look for involvement with Libra or Aquarius
- natives; probably a fistfight with one of each.
-%
-Arkansas:
- Where the men are men, so are the women and the sheep run scared.
-%
-As fathers commonly go, it is seldom a misfortune to be fatherless;
-and considering the general run of sons, as seldom a misfortune to
-be childless.
-
-The only solid and lasting peace between a man and his wife is,
-doubtless, a separation.
- -- Lord Chesterfield, letter to his son (1763)
-%
-As for Carter being for registration but against the draft, isn't that
-sort of being like for putting it in and not taking it out? Even if it
-was possible not to follow through, you'd still be getting screwed.
-%
-As long as your ass is pointed at the ground, don't fuck with me.
-%
-As my dear auntie used to say, "Love makes the world go 'round, but sex
-makes the ride fun."
-%
-As near as I can tell, you're not any crazier
-than the average asshole on the street.
- -- R.P. McMurphy, "One Flew Over the Cuckoo's Nest"
-%
-As part of an equal opportunity project, a memo was sent to all the offices
-within External Affairs asking for "A list of all employees broken down by
-sex."
- One of the memos was returned with the notation: "I'm sorry: we
-know of nobody in this office who fits your criteria. We do, however,
-have two alcoholics."
-%
-As Rev. Spooner would say, you are a shining wit.
-%
-As she lay there dozing next beside me, a voice inside my head kept
-saying "Relax... you're not the first doctor who's ever slept with
-one of his patients," but another voice kept reminding me, "Howard,
-you're a veterinarian."
-%
-As the Catholic church becomes more and more tolerant, some day they will
-have to consider the possibility of a gay pope. Possibly the largest
-issue will be having to decide whether he is "absolutely divine" or "just
-simply marvelous."
-%
-As the recent sightings of bumper stickers reading "IN CASE OF RAPTURE, THIS
-VEHICLE WILL BE UNMANNED" have created a great deal of confusion, Fortune
-offers the following excerpts from the 1989 printing of the State of Maryland
-Driver's Handbook:
- If you notice a glorious light in the sky, a sound as of an infinite
-choir of unearthly voices, and a host of winged beings descending from the
-heavens, do not panic. If you are on the freeway, move to the shoulder as
-soon as it is safe to do so, activate your hazard blinkers, and wait for the
-end of the world. If you are Saved, it is especially important that you do
-this BEFORE you are carried to your Eternal Reward, in order that your vehicle
-not become a hazard to others. Remember, Rapture is the number one cause of
-automobile accidents during major spiritual upheavals. You may experience a
-feeling of discorporation ("being pulled from one's body") while driving. To
-ensure the safety of your passengers and other drivers, move to the shoulder
-as soon as you notice any of the following symptoms:
- -- An overwhelming sense of peace and happiness.
- -- Visions of the faces of deceased family members.
- -- A glorious figure in white, beckoning from the end of a tunnel of
-white mist (do not confuse this with traffic control or maintenance officers,
-who wear dark blue and safety orange.)
- Once the feeling has passed, inspect your surroundings. If still in
-your car, you have probably suffered a stroke and should have someone drive
-you to a hospital at once. If you find yourself in the Kingdom of God, consult
-the local officials for information on local traffic rules and regulations.
-%
-As the truck driver came flying over the top of a steep hill, he spotted two
-figures in his path rolling around in the middle of the road. The driver blew
-his horn and braked frantically, but the couple continued their lovemaking,
-oblivious to his warnings. The truck finally slid to a halt barely three
-inches from the pair. "Are you crazy?" the driver screamed at them. "You
-could have been killed!"
- The man stood up and faced the driver. "Well, I was coming, she was
-coming and you were coming," he panted, "and you were the only one with
-brakes."
-%
-As they say about Dungeons and Dragons, "Life's a die, and then you bitch."
-%
-Ask your boss to reconsider --
-It's so difficult to take "Go to hell" for an answer.
-%
-Asked by reporters about his upcoming marriage to a forty-two-year-old
-woman, director Roman Polanski told reporters, "The way I look at it,
-she's the equivalent of three fourteen-year-olds."
- -- David Letterman
-%
-Ass, n.:
- The masculine of "lass".
-%
-Ass, grass or gas... nobody rides for free!
-%
-Assassins do it from behind.
-%
-At her annual checkup, the attractive young woman is told by the doctor that
-it's necessary to take her temperature rectally. She agrees and bends over
-the examining table, but a few seconds later says indignantly, "Doctor, that's
-NOT my rectum!"
- "Madam," says the doctor, "that's not my thermometer!"
- Just then, the woman's husband, hearing her voice, comes into the
-room. "Just what the hell is going on here?" he demands.
- "I'm taking your wife's temperature," the doctor cooly replies.
- "Okay, doc, you know best," says the husband as he picks a scalpel
-off the doctor's desk, "but when that thing comes out, it better have
-numbers on it!"
-%
-At last, the first Soviet, artificially intelligent computer had been produced.
-The engineers did not get it, nor the physicists. First things first: it went
-to the institute of Marxism-Leninism.
-
-"IS IT POSSIBLE TO BUILD SOCIALISM IN SWITZERLAND?" typed in one of the
- theologians.
-"YES," replied the computer. "BUT IT WOULD BE SUCH A PITY TO DESTROY
- SUCH A BEAUTIFUL COUNTRY."
-%
-At twenty-six, Kate, though not promiscuous, had slept with most of the
-decent men in public life.
- -- Renata Adler
-%
-Attractive bisexual young woman seeks same for high mellow times.
-%
-Australia's a lovely land
-It's full of bonza blokes,
-Sheilas, beer and no-one's queer
-Except in Pommie jokes.
-
-Australians are lovely chaps
-They're God's own chosen race.
-If they ever see a fairy Pom
-They'll smash him in the face.
-
-Australians like dressing up
-In skirts and having fun
-And that's all we were doing
-When the Vice Squad came along.
- -- Monty Python
-%
-A-Z affectionately,
-1 to 10 alphabetically,
-from here to eternity without in betweens,
-still looking for a custom fit in an off-the-rack world,
-sales talk from sales assistants
- when all i want to do is lower your resistance,
-no rhythm in cymbals no tempo in drums,
-love's on arrival,
-she comes when she comes,
-right on the target but wide of the mark...
-%
-B4 I4Q, RU/18 QT 3.14
-%
-Bachelors' wives and old maids' children are always perfect.
- -- Nicolas Chamfort
-%
-Back in the good ole days in Texas, when stagecoaches and the like was
-popular, there were three people in a stagecoach one day: a true red-
-blooded born-and-raised Texas gentleman, a tenderfoot city-slicker from
-back East, and a beautiful and well-endowed Texas lady. The city-
-slicker kept eyeing the lady, and finally he leaned forward and said,
-"Lady, I'll give you $10 for a blow job." The Texas gentleman looked
-appalled, pulled out his pistol, and killed the city-slicker on the
-spot. The lady gasped and said, "Thank you, suh, for defendin' mah
-honor!" Whereupon the Texan holstered his gun and said, "Your honor,
-hell! No tenderfoot is gonna raise the price of women in Texas!"
-%
-Balls Law:
- The angle of the dangle is directly proportional to the heat
- of the meat provided that the thrusts of the busts are constant.
-%
-Baltimore, n.:
- Where the women wear turtleneck sweaters to hide their flea
- collars.
-%
-Bankers do it with interest (penalty for early withdrawal).
-%
-Based on what you know about him in history books, what do you think
-Abraham Lincoln would be doing if he were alive today?
-
- (1) Writing his memoirs of the Civil War.
- (2) Advising the President.
- (3) Desperately clawing at the inside of his coffin.
- -- David Letterman
-%
-Be prepared... that's the Boy Scout's solemn creed.
-Be prepared... to be clean in word and deed.
-Don't solicit for your sister, that's not nice,
-Unless you get a good percentage of her price ...
- -- Tom Lehrer
-%
-Beat me, bite me, whip me, fuck me, make me write bad checks!
-%
-Beauty, n.:
- The power by which a woman charms a lover and terrifies a husband.
- -- Ambrose Bierce, "The Devil's Dictionary"
-%
-Beauty seldom recommends one woman to another.
-%
-Because woman's work is never done and is underpaid or unpaid or boring or
-repetitious and we're the first to get the sack and what we look like is
-more important than what we do and if we get raped it's our fault and if we
-get bashed we must have provoked it and if we raise our voices we're nagging
-bitches and if we enjoy sex nymphos and if we don't we're frigid and if we
-love women it's because we can't get a "real" man and if we ask our doctor
-too many questions we're neurotic and/or pushy and if we expect community
-care for children we're selfish and if we stand up for our rights we're
-aggressive and "unfeminine" and if we don't we're typical weak females and
-if we want to get married we're out to trap a man and if we don't we're
-unnatural and because we still can't get an adequate safe contraceptive but
-men can walk on the moon and if we can't cope or don't want a pregnancy we're
-made to feel guilty about abortion and... for lots and lots of other reasons
-we are part of the women's liberation movement.
-%
-Bedfellows make strange politicians.
-%
-Beef stroganoff, n.:
- A bull masturbating.
-%
-Behold the unborn fetus and
- Weep salt tears crocodilian;
-All life is sacred (save, of course,
- An enemy civilian).
-%
-Being a woman is of special interest only to aspiring male transsexuals.
-To actual women it is merely a good excuse not to play football.
- -- Fran Lebowitz, "Metropolitan Life"
-%
-Being stoned on marijuana isn't very different from being stoned on
-gin.
- -- Ralph Nader
-%
-Bend over and take it like a man!
-%
-Beneath this stone a virgin lies,
-For her life held no terrors.
-A virgin born, a virgin died:
-No hits, no runs, no errors.
-%
-Beneath this stone lies Murphy,
-They buried him today,
-He lived the life of Riley,
-While Riley was away.
-%
-Benny Hill: Would you like a peanut?
-Girl: No, thank you, I don't want to be under obligation.
-Benny Hill: You won't be under obligation for a peanut.
- It's not as if it were a chocolate bar or something.
-%
-Better a sister in a whorehouse than a brother on a Honda.
-%
-BETTER LATE THAN NEVER:
- The single girl's motto.
-%
-Beware of a tall dark man with a spoon up his nose.
-%
-Beware of altruism. It is based on self-deception, the root of all
-evil.
-%
-Bi now, gay later!
-%
-Big Toe: The pad of the male big toe applied to the clitoris or the vulva
-generally is a magnificent erotic instrument. The famous gentleman in erotic
-prints who is keeping six women occupied is using tongue, penis, both hands,
-and both big toes. Use the toe in mammary or armpit intercourse or any time
-you are astride her, or sit facing as she lies or sits. Make sure the nail
-isn't sharp. In a restaurant, in these days of tights one can surreptitiously
-remove a shoe and sock, reach over, and keep her in almost continuous orgasm
-with all four hands fully in view on the table top and no sign of contact--
-A party trick which really rates as advanced sex. She has less scope, but
-can learn to masturbate him with her two big toes. The toes are definitely
-erogenic areas, and can be kissed, sucked, tickled, or tied with stimulating
-results.
- -- The Joy of Sex
- [Avoid armpit intercourse when razor stubble is present. Ed.]
-%
-Bill and Jim were walking home from work. As they walked along, they
-discussed their wives' spending habits. "I don't understand how women
-can spend so much money," Bill exclaimed. "I mean, understand, she
-don't drink, and she's got her own pussy!"
-%
-Birth, copulation and death.
-That's all the facts when you come to brass tacks;
-Birth, copulation and death.
- -- T.S. Elliot, "Sweeney Agonistes"
-%
-Bisexuality immediately doubles your chances for a date on Saturday night.
- -- Woody Allen
-%
-Bitch, bitch, bitch --
-That's all I ever hear,
-Ever since the dog ate the baby,
-"Get rida the dog, get rida the dog."
-%
-Blessed are the meek for they shall inhibit the earth.
-%
-Blow it out your ass!
-%
-Board the windows, up your car insurance, and don't leave any booze in plain
-sight. It's St. Patrick's day in Chicago again. The legend has it that St.
-Patrick drove the snakes out of Ireland. In fact, he was arrested for drunk
-driving. The snakes left because people kept throwing up on them.
-%
-BOHICA:
- Bend over, here it comes again.
-%
-Bondage, or as the French call it, ligottage, is the gentle art of tying up
-your sex partner --- not to overcome reluctance but to boost orgasm. It's
-one unscheduled sex technique which a lot of people find extremely exciting
-but are scared to try, and a venerable human resource for increasing sexual
-feeling, partly because it's a harmless expression of sexual aggression --
-something we badly need, our culture being very uptight about it -- and more
-because of its physical affects: slow orgasm when unable to move is a
-mind-blowing experience for anyone not too frightened of their own aggressive
-self to try it.
- -- The Joy of Sex
-%
-Bookstores will soon be stocking a volume called "The Unsensuous
-Census Taker". It's about a guy who comes once every ten years.
-%
-Booze is the answer. I don't remember the question.
-%
-Brain on vacation, penis on autopilot.
-%
-Breakfast sometime?
- Sure.
-Shall I call you or just nudge you?
-%
-Bridget O'Flaherty McHugh
-Held venal traffic with a gnu.
-Mistaking fore for aft one morn
-Impaled herself upon its horn.
-
-Moral: Those who seek high ends should shun
- our furred and feathered friends.
-%
-Brigands will demand your money or
-your life, but a woman will demand both.
- -- Samuel Butler
-%
-Bringing your mate to a convention is like taking a game warden hunting.
-%
-Britain has lowered the tax on chastity belts by about 60 cents each...
-[reclassifying them] as a safety device rather than... clothing
- -- NY Times
-%
-Brother Jim's recent appearance on the William and Mary campus this past
-week was cut short by an ingenious device designed by two computer science
-students. A three-foot bar of extruded aluminum was precisely machined,
-with a hole milled down the center of precisely the dimensions of one of
-the small Gideon bibles. The end capped off, a CO2 canister was connected
-to provide up to 2,000 PSIG. Preliminary estimates during field testing
-revealed a muzzle velocity of approximately 120-150 MPH for bibles exiting
-the tube. Sufficient ammunition was obtained during a previous visit to
-campus by another religious organization, and the system was first used on
-Brother Jim, who suffered a broken rib and numerous small bruises, in
-addition to the usual humiliation.
-%
-Brunette bush, n.:
- The dark side of the moon.
-%
-Buffy: Am I repulsive? If there was something repulsive about me, you'd
- tell me right?
-Willow: I'm your friend. I would call you repulsive in a second.
- -- Buffy the Vampire Slayer, "The Harsh Light of Day"
- Season 1, Episode 3
-%
-Buffy: How do you get to be renowned? I mean like, do you have to be
- nowned first?
-Willow: Yes. First there is the painful nowning process.
- -- Buffy the Vampire Slayer, "The Freshman"
- Season 1, Episode 1
-%
-Buffy: It was exactly you Will, every detail. Except for your not being
- a dominatrix, as far as we know.
-Willow: Oh right, me and Oz play, "Mistress of Pain" every night.
-Xander: Did anyone else just go to a scary visual place?
-Buffy: Oh yeah.
- -- Buffy the Vampire Slayer, "Dopplegangland"
- Season 3, Episode 16
-%
-Buffy: No! You guys are gonna have a prom. The kind of prom that
- everyone should have. I'm going to give you all a nice, fun,
- normal evening; if I have to kill every single person on the
- face of the earth to do it!
-Xander: Yay.
- -- Buffy the Vampire Slayer, "The Prom"
- Season 3, Episode 20
-%
-Bug, n.:
- A son of a glitch.
-%
-Build a better mousetrap, the saying goes -- and with the brassiere,
-Yankee Ingenuity did exactly that. But their true stroke of genius was
-the new bait. The old fashioned mousetrap was loaded with cheese;
-nobody cares much about cheese, except mice. But when American
-Know-How reloaded the brassiere with tits, every heterosexual male in
-the country was hopelessly trapped.
- -- Alan Sherman, "The Rape of the A*P*E*"
-%
-Build a man a fire, and he'll be warm for a day. Set a man on fire,
-and he'll be warm for the rest of his life.
- -- Terry Pratchett
-%
-But if it's 80% glucose, then why does it taste salty?
- -- Anonymous med school student
-%
-But they'll never mechanize me -- not me!
-Said Charlotte, the Louisville harlot.
- -- S.I. Hayakawa
-%
-But we've only fondled the surface of that subject.
- -- Virginia Masters, of Master & Johnson
-%
-Buy old masters. They fetch better prices than old mistresses.
- -- Lord Beaverbrook
-%
-By all means marry: If you get a good wife, you'll become happy; if you
-get a bad one, you'll become a philosopher.
- -- Socrates
-%
-CAD:
- A man who doesn't tell his wife
- that he's sterile until she's pregnant.
-%
-CALIFORNIA:
- From Latin 'calor', meaning "heat" (as in English 'calorie' or
- Spanish 'caliente'); and 'fornia', for "sexual intercourse" or
- "fornication." Hence: Tierra de California, "the land of hot sex."
- -- Ed Moran, Covina, California
-%
-California is proud to be the home of the freeway.
- -- Ronald Reagan
-%
-Call for Ms. Lingus, Ms. Connie Lingus...
-%
-Callgirl, n.:
- A negotiable blond.
-%
-Camille's Axiom:
- If you haven't asked yourself, "Why the hell did
- I go to college anyway?", you must be teaching.
-%
-Canada is so square even the female impersonators are women.
- -- From the movie "Outrageous"
-%
-CANCER (June 21 - July 22)
- You are sympathetic and understanding of other people's problems.
- They think you are a sucker. You are always putting things off.
- That's why you'll never make anything of yourself. Most welfare
- recipients are Cancer people.
-%
-Candy
-Is dandy
-But liquor
-Is quicker.
- -- Ogden Nash, "Reflections on Ice-Breaking"
-
-Fortune updates the great quotes: #53.
- Candy is dandy; but liquor is quicker,
- and sex won't rot your teeth.
-%
-Captain Hook died of jock itch.
-%
-"Carefully study these two enlarged photographs on display, Mr. Rafferty,"
-the attorney for a politician suing a newspaper for libel instructed his
-client on the witness stand, "and indicate which is your ass and which is
-a hole in the ground."
-%
-Catholicism has changed tremendously in the recent years. Now when
-Communion is served there is also a salad bar.
- -- Bill Maher
-%
-Ce livre est dedie a Chagrin, This book is dedicated to Chagrin,
-Qui fit un petit mannequin: Who fashioned a small doll:
- Sans bras et tout noir, Without arms and all black,
- Il etait affreux voir; It was horrible sight;
-En effet, absolument la fin. In effect, the absolute end.
- -- Edward Gorey
-%
-Champagne don't make me lazy.
-Cocaine don't drive me crazy.
-Ain't nobody's business but my own.
- -- Taj Mahal
-%
-Chaste makes waste.
-%
-Chastity:
- The most unnatural of the sexual perversions.
- -- Aldous Huxley
-%
-CHASTITY BELT:
- An anti-trust suit.
-
- (And an unchivalrous knight is the one that files it.)
-%
-Chastity is its own punishment.
-%
-Chicago has journalists' bars, ethnic bars, neighborhood bars, even midget
-bars, hundreds, maybe thousands of bars, on every neighborhood block.
-I was drinking on afternoon in O'Rourke's, a bar on the Near North side.
-It was dark and empty, which suited my mood. A fat, stubble-bearded,
-middle-aged man waddled in, took the stool next to mine, and ordered a
-beer. He was completely unremarkable, except that he was dressed, head
-to toe, in a white-lace wedding gown. After a silence, I said, "Been to
-a wedding?"
- He brushed back his veil, rustled his petticoats and said, "Uh...
-yeah."
- He silently finished his drink and left. The bartender said, "You
-know, even the transvestites in this town have five o'clock shadows."
-%
-Chipmunks roasting on an open fire
-Jack Frost ripping up your nose
-Yuletide carolers being thrown in the fire
-And folks dressed up like buffaloes
-Everybody knows a turkey slaughtered in the snow
-Helps to make the season right
-Tiny tots with their eyes all gouged out
-Will find it hard to see tonight
-They know that Santa's on his way
-He's loaded lots of guns and bullets on his sleigh
-And every mother's child is sure to spy
-To see if reindeer really scream when they die
-And so I'm offering this simple phrase
-To kids from one to ninety two
-Although it's been said many times, many ways
-Merry Christmas, Merry Christmas, Merry Christmas, Fuck you!!
-%
-Chorus:
- I don't want to join the army, I don't want to go to war,
- I'd rather sit around, pickin' dillies off the ground,
- And livin' off the favors of an 'igh-born lady.
- I don't want a bullet up me arse 'ole,
- I don't want me pecker blown away,
- I'd rather live in England, in jolly, sunny, England,
- And fornicate me bloody life away!!
-
-Monday I touched her on the ankle,
-Tuesday I touched her on the knee,
-And Wednesday after Mass, I lifted up her dress,
-And Thursday I saw you know what,
-Friday I put me 'and upon it,
-Saturday she gave me balls a tweak [tweak, tweak]
-And Sunday after supper, I ran me fucker up 'er,
-And now she pays me forty quid a week!
-Oh, blimey...
-
-[chorus]
-%
-Christ, n.:
- A man who was born at least 5,000 years ahead of his time.
-%
-Christ died for our sins. Dare we make his martyrdom meaningless by not
-committing them?
- -- Jules Feiffer
-%
-CHRISTIAN:
- One who follows the teachings of Christ in so far
- as they are not inconsistent with a life of sin.
-%
-Christian, n.:
- One who believes that the New Testament is a divinely inspired
-book admirably suited to the spiritual needs of his neighbor. One who
-follows the teachings of Christ in so far as they are not inconsistent
-with a life of sin.
-%
-Christianity and Judaism aren't all that different, really. Growing up in
-a Christian family, the feeling of guilt for Man's sins comes from God.
-In a Jewish family, it comes from your parents.
-%
-Christianity has not been tried and found wanting; it has been
-found difficult and not tried.
- -- G. K. Chesterton
-%
-CHRISTMAS:
- A day set apart by some as a time for turkey, presents, cranberry
- salads, family get-togethers; for others, noted as having the best
- response time of the entire year.
-%
-CHRISTMAS:
- A time when each of us gets to reflect upon what we each most
- deeply and sincerely believe in. Money. At the mall of our
- choice.
-%
-Christmas comes but once a year,
-A time for love and laughter;
-You can come much more than that,
-But you have to clean up after.
-%
-Cinderella 10:
- A woman who sucks and fucks 'til midnight and
- then turns into a pizza and a six-pack.
-%
-Clark Kent is a transvestite.
-%
-Clarke's Third Law:
- Any sufficiently advanced technology is indistinguishable from
- magic.
-
-G's Third Law:
- In spite of all evidence to the contrary, the entire universe
- is composed of only two basic substances: magic and bullshit.
-
-H's Dictum:
- There is no magic...
-%
-Claude believed that only smart attractive people had the right to
-fuck, and it sincerely hurt him when he discovered evidence to the
-contrary.
- -- Tom Robbins
-%
-Cleveland still lives. God MUST be dead.
-%
-Clitoris, n.:
- A haired trigger.
-%
-CLONE OF MY OWN (to Home on the Range)
-
-Oh, give me a clone
-Of my own flesh and bone
- With the Y chromosome changed to X.
-And when she is grown,
-My very own clone,
- We'll be of the opposite sex.
-
-Chorus:
- Clone, clone of my own,
- With the Y chromosome changed to X.
- And when we're alone,
- Since her mind is my own,
- She'll be thinking of nothing but sex.
- -- Randall Garrett
-%
-Close the door, let me give you what you've been waiting for!!
-%
-COCAINE:
- The thinking man's Dristan.
-%
-Cocaine is nature's way of telling you you have too much money.
-%
-Cocaine isn't habit forming. I should know -- I've been using it for years.
- -- Tallulah Bankhead
-%
-Cocaine: using tomorrow's energy today.
-%
-Cocaine's a joke!
- (Who's got the next line?)
-%
-Cock-sucker, n.:
- Someone who got caught doing what you got away with.
-%
-Coffee without caffeine. Beer without alcohol. Milk without fat.
-What's next? Bridal suites with bunk beds?
- -- Orben's Current Comedy
-%
-Coito ergo sum
-%
-Coitus interruptus, n.:
- A jerky movement following the words (by either sex partner)
- "I want to have your child."
-%
-Coitus is punishment for the happiness of being together. Live as
-ascetically as possible... that is the only possible way for me to
-endure marriage. But she?
- -- Franz Kafka
-%
-Coitus upon a cadaver
-Is the ultimate way you can have 'er.
- Her inanimate state
- Means a man needn't wait,
-And eliminates all the palaver.
-%
-Cold, adj.:
- When the local flashers are handing out written descriptions.
-%
-Cold, adj.:
- When your dog sticks to the fire hydrant.
-%
-College is like a woman -- you work so hard to get in, and nine months
-later you wish you'd never come.
-%
-Come along and sing a song and join our family.
-B & D
-S & M
-Post to A.S.B.!
-Rope and leather, cuffs and cats, and toys from JTT.
-B & D
-S & M
-Post to A.S.B.!
-A.S.B.!
- (A.S.B.!)
-A.S.B.!
- (A.S.B.!)
-Come on now, let's try another tie!
- (Tie! Tie! Tie!)
-All the kinky folks are here, and some on IRC.
-B & D
-S & M
-Post on A.S.B.!
- -- To the Mickey Mouse March
-%
-Come on, Virginia, don't make me wait!
-Catholic girls start much too late,
-Ah, but sooner or later, it comes down to fate,
-I might as well be the one.
-Well, they showed you a statue, told you to pray,
-Built you a temple and locked you away,
-Ah, but they never told you the price that you paid,
-The things that you might have done.
-So come on, Virginia, show me a sign,
-Send up a signal, I'll throw you a line,
-That stained glass curtain that you're hiding behind,
-Never lets in the sun.
-Darling, only the good die young!
- -- Billy Joel, "Only The Good Die Young"
-%
-Come up and see me sometime. Come Wednesday, that's amateur night.
- -- Mae West
-%
-COMMENT:
- A superfluous element of a source program included so the
- programmer can remember what the hell it was he was doing
- six months later. Only the weak-minded need them, according
- to those who think they aren't.
-%
-Communists do it without class.
-%
-Computer scientists are programmed to do it by macro insertion.
-%
-Computerfirm nymphomaniac, n.:
- Hot Apple pie.
-%
-Condoms are like listening to a symphony with cotton in your ears.
-%
-Condoms are the feminists' revenge on men for diaphragms.
- -- Robin Williams
-%
-Confucius say:
- man who lay girl on hill, not on level.
- man who pull out too fast leave rubber.
- man who go to bed with sex problem wake up with solution in hand.
- modern house without toilet uncanny.
- man with athletic finger make broad jump
- woman should not marry basketball players -- they dribble before
- they shoot.
- man who sleep in road wake up with run-down feeling.
- woman who goes to man's apartment for snack, may get tit bit.
- child conceived in back seat of car with automatic transmission
- turn out to be shiftless bastard.
- a smart man knows on which side his broad is better.
- man who arrives late to party will find himself beaten to the punch!
-%
-Confucius say:
- man who screws near graveyard is fucking near dead.
- man who fishes in other man's well often catch crabs.
- man and mouse the same, both end up in pussy.
- boy who play with himself pulls boner.
- woman who cooks carrots and pees in same pot very unsanitary.
- man who marry girl with no bust has right to feel low down.
- man who sleeps with old hen finds it's better than pullet.
- man with hole in pocket feel cocky all day.
- man who lie under car, get tired
- man who stand behind car, get exhausted.
-%
-Confucius say:
- woman who put man in dog house find him in cat house.
- woman who spring on inner-spring this spring, have off-spring
- next spring.
- man who kiss girl's behind, get crack in face.
- passionate kiss like spider web, lead to undoing of fly.
- man who kicked in testicles get left holding bag.
- man who suck nipples make clean breast of things.
- woman who slide down bannister make monkey shine.
- woman's virginity like balloon, one prick and all gone.
- Kotex not best thing on earth, but next to best.
- squirrel who run up woman's leg not find nuts.
- epileptic woman who give blow-job may bite big one.
- seven days on honeymoon make one hole weak.
-%
-Confucius say:
- woman who ride bicycle peddle ass around town.
- fool man climb tree to get cherries; wise man spread limbs.
- woman who fly upside down in airplane have big crack up.
- man who live in glass house should bathe in the basement.
- man who make love on ground have piece on Earth.
- man who lose key to girlfriend's apartment get no new key.
- man who fights with wife all day, gets not peace at night.
- man who make oral love to epileptic woman may get tongue-tied.
- man with head up ass have shitty outlook on life.
- man who streak unsuited for work.
- woman who bathe in vinegar have sour puss.
- man who beat off in car have hot rod.
-%
-CONFUSION:
- One woman plus one left turn.
-EXCITEMENT:
- Two women plus one secret.
-BEDLAM:
- Three women plus one bargain.
-CHAOS:
- Four women plus one luncheon check.
-%
-Confusion, n.:
- Father's Day in San Francisco.
-%
-Conservative, n.:
- One who admires radicals centuries after they're dead.
- -- Leo C. Rosten
-%
-Conserve energy -- make love more slowly.
-%
-CONSULTANT:
- Someone who knows 101 ways to make love, but can't get a date.
-%
-Continental breakfast, n.:
- A roll in bed with some honey.
-%
-Coors, n.:
- Like making love in a canoe -- fucking close to water.
-%
-Copa-ulation:
-(to the tune of Copacabana)
-
-Her name was Lola, she was a bimbo, with yellow streamers in her hair,
-She wore see-through underwear, she'd go to discos, and do the go-go,
-And while she tried to be star, Tony jacked off on the bar,
-And when the dance was done, his hand was full of come,
-His favorite drink is cream in coffee,
-Won't you order one?
-
-At the Copa, Copa-ulation ...
-
-Her name was Lola, she was a show-girl,
-But that was thirty years ago, when she still could slurp and blow,
-Now she's a sado, but not for Tony, still in her chains and leather gown,
-She ties Rico to the ground, and fucks that boy half-blind,
-But Rico, he don't mind, there are whips and a lot of beatings,
-But a real good time ...
-%
-Cordelia: Does looking at guns make you want to have sex?
-Xander: I'm seventeen. Looking at _L_I_N_O_L_E_U_M makes me want to have sex.
- -- Buffy the Vampire Slayer, "Innocence"
- Season 2, Episode 14
-%
-Couples in motion have moments.
-%
-Courage, n.:
- Two cannibals having oral sex.
-%
-Cover your stump before you hump.
-Before you attack her, wrap your wacker.
-Don't be silly... protect your Willie.
-Wrap it in foil before checking her oil.
-If you're not going to sack it, go home and wack it.
- -- National Condom Week
-%
-Cox's philosophy:
- Life's a bitch, then you die.
-%
-Coyote love, n.:
- Coyote love is a nebulous term. Basically, what it involves is
- the taking of a member of the preferred sex home from a singles
- bar. Then, when you wake up the next morning, they're sleeping
- on your arm. So, rather than wake them up as you escape, you
- chew off your arm at the shoulder.
-
-Coyote ugly, adj.:
- When you chew off the other arm 'cause she'll be looking for
- a one-armed man!
-
-See also proof that average instantaneous beauty increases monotonically
-as alcohol consumption increases and time, t, approaches last call.
-%
-"Creation science" has not entered the curriculum for a reason so simple
-and so basic that we often forget to mention it: because it is false, and
-because good teachers understand exactly why it is false. What could be
-more destructive of that most fragile yet most precious commodity in our
-entire intellectual heritage -- good teaching -- than a bill forcing
-honorable teachers to sully their sacred trust by granting equal treatment
-to a doctrine not only known to be false, but calculated to undermine any
-general understanding of science as an enterprise?
- -- Stephen Jay Gould, "The Skeptical Inquirer"
-%
-Crew, n.:
- Eight big men and their cute little cox.
-%
-Cried Miss Pratt: "What are you staring at?
-I know - you don't have to say that!
- All you guys want of me
- Is a poke where I pee,
-And it's pounding my ass mighty flat!"
-%
-Crinklaw's Observation:
- Nowadays the order of life is reversed: Sex is first enjoyed,
- marriage follows, and after marriage comes abstinence.
-%
-Cum Hilde autem ambulabat
-Homo qui aedificabat.
- Dixit volebat. Debet et potebat.
- Sic ille ducebat. Statim faciebat.
-Sed virginem pine necebat.
-%
-Cunnilingus is next to cleanliness.
-%
-Cunnilingus is next to godliness.
-%
-Curiosity killed the cat, but satisfaction brought her back.
-%
-Daisy, Daisy, give me your answer true,
-Daisy, Daisy, wouldn't you like to screw?
-I really must beg your pardon,
-But I've got a hell of a hard-on,
-From beating my meat, against the seat,
-Of a bicycle built for two.
- -- "Daisy, Daisy", "The Dirty Song Book"
-%
-Dallas still lives. God MUST be dead.
-%
-Dame Catherine of Ashton-on-Lynches
-Got on with her grooms and her wenches:
- She went down on the gents,
- And pronged the girl's vents
-With a clitoris reaching six inches.
-%
-Dames lie about anything -- just for practice.
- -- Raymond Chandler
-%
-Dammit, how many times do I have to tell you? _F_I_R_S_T you rape,
-_T_H_E_N you pillage!!
-%
-Damned if I know. And you can be fuckin' sure I'll never rent no car
-from Avis again.
- -- Herbie Sperling, on the meaning of two pistols and an
- axe used in three murders being found in the trunk of
- his rented car.
-%
-Dance is the vertical expression of a horizontal intention.
-%
-date; talk; touch; unzip; finger; expand; strip; head; mount; yes; yes; yes;
-eject; more; sleep
-%
-Dave has an aeroplane,
-In which he likes to frisk.
-Oh what a foolish boy,
-His silly *.
-%
-David was just a shepherd who liked to get his rocks off in leather.
-%
-De Hispanice puella verumque
-Simplex oris verborumque
- Tulit potens vagina
- Hominum agmina
-Iterum iterum iterumque.
-%
-Dear Abby:
- I have two brothers. One was sent to the electric chair when I was
-a child. My mother died in an insane asylum. My father is a pimp and my
-sister is a very successful and highly paid prostitute. My other brother
-is a graduate student attending Purdue University.
- Recently I met a wonderful girl who has just been released from prison
-for murdering her illegitimate child with a Zip-loc sandwich bag. We're very
-much in love and want to be married after her venereal disease is cured.
- My problem is this: should I tell her about my brother at Purdue?
-
- Sincerely,
- Undecided.
-%
-Dear Abby:
- I just met the most terrific girl and we get along fabulously. I
-think she's the one for me. There's just one problem: I can't remember
-from our first date if she told me she had TB or VD. What should I do?
- -- Confused
-
-Dear Confused:
- If she coughs, fuck her.
-%
-Dear Ann Landers:
- I have a problem. I have two brothers; one works for the Illinois
-Bell Telephone Company, the other brother was just sentenced to death
-in the electric chair for murder. My mother died from insanity when
-I was three years old. My two sisters are prostitutes and my father
-sells narcotics.
- I recently met girl who was just released from a reformatory where
-she served time for smothering her illegitimate child to death. I love
-this girl and want to marry her. My problem is this -- dare I tell her
-about my brother who works for Illinois Bell?
- -- Confused
-%
-Dear Ann Landers:
- My husband watches the TV preachers every Sunday. He claims
-one minister said there are 350 different sins. My husband wants to
-know if you can get the list. He thinks he is missing something.
- -- E.J. Mayfield
-%
-Dear Lord, observe this bended knee
-This visage meek and humble,
-And hear this confidential plea
-Voiced in reverent mumble:
- Give me Shylock, give me Fagin
- But O God spare me Ronald Reagan!
- -- Ansel Adams
-%
-Dear Miss Manners:
-Please list some tactful ways of removing a man's saliva from your face.
-
-Gentle Reader:
-Please list some decent ways of acquiring a man's saliva on your face.
-If the gentleman sprayed you inadvertently to accompany enthusiastic
-discourse, you may step back two paces, bring out your handkerchief,
-and go through the motions of wiping your nose, while trailing the cloth
-along your face to pick up whatever needs mopping along the route. If,
-however, the substance was acquired as a result of enthusiasm of a more
-intimate nature, you may delicately retrieve it with a flick of your
-pink tongue.
-%
-Dear Mr. Seldes: I cannot remember the exact wording of the statement
-to which you allude; but what I meant was that ... a man who calls
-himself a 100% American and is proud of it, is generally 150% an idiot
-politically. But the designations may be good business for war
-veterans. Having bled for their country in 1861 and 1918, they have
-bled it all they could consequently. And why not?
- -- George Seldes, "The Great Quotations"
-%
-Democracy can learn some things from Communism: for example, when a
-Communist politician is through, he is through.
-%
-Democracy means simply the bludgeoning of the people by the people for
-the people.
- -- Oscar Wilde
-%
-Demonstrating once again the importance of the lowly comma, this
-telegram was sent from a wife to her husband:
- "NOT GETTING ANY, BETTER COME HOME AT ONCE."
-%
-Desperate because her husband hadn't made love to her in months, a lonely
-housewife finally mustered her courage and went to their doctor for advice.
-The doctor was very sympathetic and wrote out a prescription for pills that
-were guaranteed to rekindle the husband's ardor in a big way. "They'll make
-him horny as hell," the doctor confided, "but they're very potent, so just
-put one in whatever he's drinking."
- Upon arriving home, the woman left the pills on the kitchen counter
-and dashed off to the supermarket. It didn't take long before the cat jumped
-up, knocked them over onto the floor, and ate a couple, as did the family
-dog. And when the husband got home with a headache, he took a few thinking
-they were aspirin.
- When the housewife returned, she was horrified to see the dog humping
-the cat and the cat jumping all over the dog, but even stranger was the sight
-of her husband with his penis inside the pencil sharpener on the counter.
-"What in heaven's name are you doing, John?" she cried.
- "See that mosquito?" he replied.
-%
-Dial 911. Make a cop come.
-%
-Diaphragm, n.:
- A childproof cap.
-%
-Dicker, v.:
- What you do to your wife if arguing doesn't work.
-%
-Did Detroit invent the back seat to destroy the morals of America?
- -- Ed Sanders
-%
-Did you hear about...
- the butcher who dropped his cleaver and went home half-cocked?
-%
-Did you hear about...
- the plastic surgeon who hung himself?
-%
-Did you hear about the nearsighted fetishist who got off on the wrong foot?
-%
-Did you hear about the new German microwave oven?
- ... Seats 500.
-%
-Did you hear about the new sorority girl doll?
-You put a ring on her finger and her hips expand.
-%
-Did you hear about young Henry Lockett?
-He was blown down the street by a rocket.
- The force of the blast
- Blew his balls up his ass,
-And his pecker was found in his pocket.
-%
-Did you hear they canceled Easter this year?
-Found the body.
-%
-Did you know that some people your age have sex
-thirty-seven times in a week? And die immediately after?
-%
-Did you know that Spiro Agnew is an anagram of "Grow a Penis"?
-%
-Did you know that there are 71.9 acres of nipple tissue in the U.S.?
-%
-Dig it, first they killed those pigs, then they ate dinner in the same
-room with them, then they even shoved a fork in a victim's stomach. Wild!
- -- Bernadine Dohrn, on the Manson killings
-%
-Disclaimer of the Week:
- Any Society Which Requires Disclaimers Has Too Many Goddamn Lawyers.
-%
-Disillusioned words like bullets bark,
-As human gods aim for their mark,
-Make everything from toy guns that spark
-To flesh-colored christs that glow in the dark.
-It's easy to see without looking too far
-That not much is really sacred.
-%
-Distributed Systems people do it loosely coupled.
-%
-[District Attorneys] learn in District Attorney School that there are
-two sure-fire ways to get a lot of favorable publicity:
-
-(1) Go down and raid all the lockers in the local high school and
- confiscate 53 marijuana cigarettes and put them in a pile and hold
- a press conference where you announce that they have a street value
- of $850 million. These raids never fail, because ALL high schools,
- including brand-new, never-used ones, have at least 53 marijuana
- cigarettes in the lockers. As far as anyone can tell, the locker
- factory puts them there.
-(2) Raid an "adult book store" and hold a press conference where you
- announce you are charging the owner with 850 counts of being a
- piece of human sleaze. This also never fails, because you always
- get a conviction. A juror at a pornography trial is not about to
- state for the record that he finds nothing obscene about a movie
- where actors engage in sexual activities with live snakes and a
- fire extinguisher. He is going to convict the bookstore owner, and
- vote for the death penalty just to make sure nobody gets the wrong
- impression.
- -- Dave Barry, "Pornography"
-%
-DIVE!!! DIVE!!! DIVE!!!
-UP PERISCOPE!!!
-
-(Ooops, sorry, wrong fantasy.)
-%
-Divorce, n.:
- A change of wife.
-%
-Do infants have as much fun in infancy as adults do in adultery?
-%
-Do married women make the best wives?
-%
-Do not permit a woman to ask forgiveness, for that is only the first
-step. The second is justification of herself by accusation of you.
- -- DeGourmont
-%
-Do not rejoice in his defeat, you men,
-For though the world stood up
-And stopped the bastard,
-The bitch that bore him is in heat again.
- -- Bertolt Brecht
-%
-Do something big -- fuck a giant
-%
-Do you smoke after sex?
-Why, do you know, I've never looked!
-%
-Doctors take two aspirin and do it in the morning.
-%
-Documentation is like sex: when it is good, it is very,
-very good; and when it is bad, it is better than nothing.
- -- Dick Brandon
-%
-Does he treat your breasts like unripe grapefruit? Who needs him?
- -- J, "The Sensuous Woman"
-%
-Does it rape elephants?
- -- Brent Byer
-%
-Doing business with the government is like fucking sheep.
-It's easy, but it's not very satisfying.
-%
-Don't accept rides from strange men -- and remember that all men
-are strange as hell.
- -- Robin Morgan, "Sisterhood Is Powerful"
-%
-Don't dip your wick in a WAC,
-Don't ride the breast of a WAVE,
- Just sit in the sand
- And do it by hand,
-And buy bonds with the money you save.
-%
-Don't forget to support the ERA apersonment.
-%
-Don't get the idea that I'm one of those goddamn radicals. Don't get the
-idea that I'm knocking the American system.
- -- Al Capone
-%
-Don't knock masturbation -- it's sex with someone I love.
- -- Woody Allen
-%
-Don't let your mouth write no check that your tail can't cash.
- -- Bo Diddley
-%
-Don't look now -- your office mate is a pederast!!!
-%
-Don't look now, but your mother is having sex with a horse.
-%
-Don't see 'em this big out here, do they?
- -- Lyndon B. Johnson, exposing himself to reporters
- in a public toilet during a tour of the Far East
-%
-Dope will get you through times of no money better that money will get
-you through times of no dope.
- -- Freewheelin' Franklin, "The Fabulous Furry Freak
- Brothers" by Gilbert Shelton
-%
-Down by the old model T,
-Where she first showed it to me.
- It was furry and black,
- And she called it a crack,
-But it looked like a manhole to me.
-%
-Draft beer, not people
-%
-Dry fucking: that's man on top of woman, the action is the same as fucking,
-but you're dressed. It's great for the girl... you're hitting and rubbing
-exactly the area that you ought to be... I still like that.
- -- Grace Slick
-%
-Due to a mixup in urology, orange juice will not be served this morning.
-%
-Dull women have immaculate homes.
-%
-DuPont, I.G., Monsanto, and Shell
-Built a world-circling pussy cartel,
- And by planned obsolescence,
- So controlled detumescence,
-A poor man could not get a smell.
-%
-During the darkest days of World War II, when each night brought waves of
-Luftwaffe bombers raining death and destruction on a near-defenseless London,
-Prime Minister Churchill went on the air to address the British people. "I
-read this morning's paper that Herr Hitler plans to wring England's neck like
-that of a chicken," he began, "and I was reminded of what the Irish poacher
-said as he stood on the gallows. It seems the poor fellow was approached by a
-well-meaning if somewhat overzealous priest who, in horrific detail, described
-the unfading torments of Hades which awaited him if he did not repent of his
-misdeeds. The condemned man listened patiently to all that the priest had to
-say, and when he was done, grinned broadly and replied, 'Eat it raw, fuzz
-nuts.'"
- -- "The Churchill Wit", National Lampoon
-%
-Dyke, n.:
- A woman who kick-starts her vibrator. And rolls her own
- tampons.
-%
-Dyslexia means never having to say that you're ysror.
-%
-Dyslexics have more fnu.
-%
-DYSLEXICS OF THE WORLD, UNTIE!
-%
-Early to bed and early to rise makes a man a helluva big nuisance.
-%
-Eat prune yogurt for that "get up and go" feeling.
-%
-Eat shit and die a virgin!
-%
-Eat the rich -- the poor are tough and stringy.
-%
-Economists are still trying to figure out why the
-girls with the least principle draw the most interest.
-%
-EE's do it without shorts.
-%
-Eighteen goddess-like daughters are not equal to one son with a hump.
- -- Chinese Proverb
-%
-Eighty percent of married men cheat in America. The rest cheat in Europe.
- -- Jackie Mason
-%
-Eisenhower was very nice,
-Nixon was his only vice.
- -- C. Degen
-%
-Eleven reasons a cucumber is better than a man:
- (1) Cucumbers can stay up all night, and you won't have to
- sleep in the wet spot.
- (2) Cucumbers don't play the guitar and try to find
- themselves.
- (3) You won't find out later that your cucumber (a) is
- married, (b) is on penicillin, (c) likes you -- but loves
- your brother!
- (4) A cucumber won't care what time of the month it is.
- (5) A cucumber never wants to get it on when your nails are
- wet.
- (6) Cucumbers don't say "Let's keep trying until we have a
- boy".
- (7) Cucumbers won't tell you size doesn't count.
- (8) A cucumber won't leave you for a cheerleader or an ex-nun.
- (9) Cucumbers don't fall asleep on your chest or drool on the
- pillow.
- (10) Cucumbers don't care if you make more money than they do.
- (11) With a cucumber, the toilet seat is always the way you
- left it.
-%
-Embarrassment, n.:
- Finding out your German Shepherd has the clap.
-%
-Equality is not when a female Einstein gets promoted to assistant
-professor; equality is when a female schlemiel moves ahead as fast as a
-male schlemiel.
- -- Ewald Nyquist
-%
-Erogenous zone, n.:
- The skin you touch to love.
-%
-Es giebt ein Arbeiter von Tinz,
-Er schlaft mit ein Madel von Linz.
- Sie sagt, "Halt sein' plummen,
- Ich hore Mann kommen."
-"Jacht, jacht," sagt der Plummer, "Ich binz."
-%
-Eternity, n.:
- The length of time between when you come and he leaves.
-%
-Ethnologists up with the Sioux
-Wired home for two punts, one canoe.
- The answer next day,
- Said, "Girls on the way,
-But what the hell's a `panoe'?"
-%
-Evangelists do it with Him watching.
-%
-Even bytes get lonely for a little bit.
-%
-Even nowadays a man can't step up and kill a woman without feeling
-just a bit unchivalrous ...
- -- Robert Benchley
-%
-Evening hours "all clear" for romance!
-(Tell mate you have to work late.)
-%
-Ever notice that the women who are against abortion are the ones you
-wouldn't want to fuck in the first place?
- -- George Carlin
-%
-Ever wondered why you always run out of breath when you throw up?
-Ah, but a man's retch should exceed his gasp, else what's a heaving for?
-%
-Every harlot was a virgin once.
- -- William Blake
-%
-Every now and then when your life gets complicated and the weasels start
-closing in, the only cure is to load up on heinous chemicals and then drive
-like a bastard from Hollywood to Las Vegas ... with the music at top volume
-and at least a pint of ether.
- -- Hunter S. Thompson, "Fear and Loathing in Las Vegas"
-%
-Every single person down there is ignoring your pain because they're too
-busy with their own.
- -- Buffy, Buffy the Vampire Slayer, "Earshot"
- Season 3, Episode 18
-%
-Every time you masturbate, God kills a kitten.
-
-Please, think of the kittens.
-%
-Everyone: "Australia, Australia, Australia, Australia, we love you,
- Amen!"
-Bruce: "Another two! (Bottles opening.) Any questions?"
-Bruce: "New-Bruce, are you a Poofter?"
-Bruce: "Are you a Poofter?"
-New-Bruce: "No!"
-Bruce: "No. Right, I just want to remind you of the faculty rules:
- Rule One!"
-Everyone: "NO POOFTERS!"
-Bruce: "Rule Two, no member of the faculty is to maltreat the Abbos
- in any way at all -- if there's anybody watching. Rule Three?"
-Everyone: "NO POOFTERS!"
-Bruce: "Rule Four, now this term, I don't want to catch anybody not
- drinking. Rule Five..."
-Everyone: "NO POOFTERS!"
-Bruce: "Rule Six, there is NO... Rule Six. Rule Seven..."
-Everyone: "NO POOFTERS!"
-Bruce: "Right, that concludes the readin' of the rules, Bruce. This
- here's the wattle, the emblem of our land. You can stick it in a
- bottle, you can hold it in your hand. Amen!
- -- Monty Python
-%
-Everyone has the right, without exception, to equal pay for equal work.
-Except for women.
-%
-Everyone in the office is welcome to join the group going to the Columbus
-Theater tonight. Meet in the lobby at 8:30. The films are "Blue Jennifer"
-and "Hot Coed Cheerleaders".
-%
-Everyone *knows* cats are on a higher level of existence. These silly humans
-are just to big-headed to admit their inferiority.
- Just think what a nicer world this would be if it were controlled by
-cats.
- You wouldn't see cats having waste disposal problems.
- They're neat.
- They don't have sexual hangups. A cat gets horny, it does something
-about it.
- They keep reasonable hours. You *never* see a cat up before noon.
- They know how to relax. Ever heard of a cat with an ulcer?
- What are the chances of a cat starting a nuclear war? Pretty negligible.
-It's not that they can't, they just know that there are much better things to
-do with ones time. Like lie in the sun and sleep. Or go exploring the world.
-%
-Except for 75% of the women, everyone in the whole world wants to have sex.
- -- Ellyn Mustard
-%
-Exotic dancer, n.:
- A girl who brings home the bacon a strip at a time.
-%
-Exuberant Sue from Anjou
-Found that fucking affected her hue.
- She presented to sight
- Nipples pink, bottom white;
-But her asshole was purple and blue.
-%
-Faith: Tell me you don't get off on this!
-Buffy: It didn't suck.
- -- Buffy the Vampire Slayer, "Bad Girls"
- Season 3, Episode 14
-%
-Falsie salesman, n.:
- Fuller bust man.
-%
-Famous last words:
- 1: Everything that you'll need to know is in the manual.
- 2: You and what army?
- 3: Don't worry, I can handle it.
- 4: If you were as smart as you think you are, you wouldn't
- be a cop.
- 5: I don't see how they make a profit
- out of this stuff at a dollar and a quarter a fifth.
- 6: We're just getting into semantics again.
- 7: Everything's under control.
- 8: He's an asshole! Don't try to "shush" me!
-%
-Fat dirty farts came spluttering out of your backside. You had an arse full
-of farts that night, darling, and I fucked them out of you, big fat fellows,
-long windy ones, quick little merry cracks...
- -- James Joyce
-%
-Fed some caviar to my girlfriend
-She was a virgin tried and true
-Now my girlfriend needs no urgin'
-There ain't nothin' she won't do!
- Caviar comes from a Virgin Sturgeon -
- Virgin Sturgeon's a very fine fish.
- Virgin Sturgeon needs no urgin'
- That's why caviar is my dish!
-
-Fed some caviar to my Grandpa
-He was a man of ninety-three
-Shrieks and screams were heard from Grandma
-He had chased her up a tree!
- (chorus)
-%
-Felt tip, v.:
- Past tense for a breast examination!
-%
-Female ballet dancers are the bravest girls around. Who else would take a
-flying leap into the arms of a homosexual and expect to be caught?
- -- Rita Rudner
-%
-Female, n.:
- Life support system for a pussy.
-%
-Feminism, n.:
- A political position which seeks to rebuild society so that
- both men and women are treated as women wish to be treated.
-%
-Feminists just want the human race to be a tie.
-%
-Feminists say 60 percent of the country's wealth is in the hands of
-women. They're letting men hold the other 40 percent because their
-handbags are full.
- -- Earl Wilson
-%
-Fie for shame, you lascivious, lewd, lecherous, libidinous, lustful,
-licentious, dirty bum!!
-%
-Fig Newton.
-%
-Fighting for peace is like screwing for virginity.
-%
-Filth and old age, I'm sure you will agree,
-Are powerful wardens upon chastity.
- -- Geoffrey Chaucer
-%
-Finally, a reporter got a chance to interview Tarzan.
-
-Reporter: Tarzan? Is that your first or last name?
-Tarzan: Tarzan first name.
-Reporter: Then, what's your whole name?
-Tarzan: Tarzan of the Apes.
-Reporter: And who is the woman with you?
-Tarzan: That Jane.
-Reporter: And what's Jane's whole name?
-Tarzan: Cunt.
-%
-First you get down on your knees, Get in line in that processional,
-Fiddle with your rosaries, Step into that small confessional,
-Bow your head with great respect, There the guy who's got religion'll
-And genuflect, genuflect, genuflect! Tell you if your sins' original.
-Do whatever steps you want if If it is, try playin' it safer,
-You have cleared them with the Pontiff, Drink the wine and chew the wafer,
-Ev'rybody say his own Two, four, six eight,
-Kyrie eleison, Time to transubstantiate!
-Doin' the Vatican Rag.
-
-So get down upon your knees, Make a cross on your abdomen,
-Fiddle with your rosaries, When in Rome do like a Roman,
-Bow your head with great respect, Ave Maria,
-And genuflect, genuflect, genuflect! Gee, it's good to see ya,
- Gettin' ecstatic an' sorta dramatic an' Doin' the Vatican Rag!
- -- Tom Lehrer, "The Vatican Rag"
-%
-Five-foot nine, eyes that shine
-He was born in Palestine
-Has anybody seen my Lord?
-
-He's so cool, he's so fine
-Eat his bread and drink his wine
-Has anybody seen my Lord?
-
-He's so neat, he's so cool,
-Walks across my swimming pool.
-Has anybody...
-%
-Flirt, n.:
- A girl whose favorite man is the next one.
-%
-Floating idly one day through the air,
-A circus performer named Blair,
- Tied a sizeable rock,
- To the end of his cock,
-And shattered a balcony chair.
-%
-Floppy now, hard later.
-%
-Folks, what can I tell you about my next guest. This cat allowed himself
-to be adored, but not loved. And his success in show business was matched
-by failure in his personal relationship bag, now that's where he really
-bombed. And he came to believe that work, show business, love, his whole
-life, even himself and all that jazz was bullshit. He became numero uno
-gameplayer. Uh, to the point where he didn't know where the games ended
-and the reality began. Like to this cat, the only reality... is death, man.
-Ladies and gentlemen, let me lay on you, a so-so entertainer, not much of
-a humanitarian, and this cat was never nobody's friend. In his final
-appearance on the great stage of life, uh, you can applaud if you want to,
-Mr. Joe Gideon!!
- -- All That Jazz
-%
-Fond of equestrians, Mabel
-Looked for true love in the stable.
- But she found the studs,
- For her were all duds,
-Now she's out with the leg of a table.
-%
-For a good time, call 632-9485. Ask for Michael.
-%
-For a house-to-house salesman named Moore,
-Getting housewives' attention's no chore:
- He's endowed with a dong
- That is 12 inches long,
-So he wedges his foot in the door.
-%
-For a thousand years I wielded the powers of the wish. I brought ruin
-to the heads of unfaithful men. I brought forth destruction and chaos
-for the pleasure of the lower beings. I was feared and worshiped across
-the mortal globe. And now I'm stuck at Sunnydale High. A mortal.
-A child ... and I'm flunking math.
- -- Anya, Buffy the Vampire Slayer, "Doppelgangland"
- Season 3, Episode 16
-%
-For a young man, not yet: for an old man, never at all.
- -- Diogenes, asked when a man should marry
-
-When should a man marry? A young man, not yet; an elder man, not at all.
- -- Sir Francis Bacon, "Of Marriage and Single Life"
-%
-For children, a woman.
-For pleasure, a boy.
-For sheer ecstasy, a melon.
-%
-For her first week's salary the gorgeous new secretary was given an
-exquisite nightgown of imported lace. The next week her salary was
-raised!
-%
-For months the loving newlywed had asked his blushing bride to perform oral
-sex on him, but to no avail. His sweet entreaties never worked, for she was
-simply too innocent and inexperienced to even *think* of such a thing, let
-alone attempt it. But a year of gentle persistence finally paid off, and
-one night his darling nervously but lovingly performed the act. When it was
-over, she looked deeply into his eyes, blushed, and asked, "How was I,
-sweetheart?"
- He looked at her and replied, "How should I know -- I'm no
-cocksucker!"
-%
-For the sores on his prick he used Dial.
-That failed; he gave Lava a trial.
- But the one remedy
- For contagious V.D.
-Is the wonder drug sulfa-denial.
-%
-"For the tenth time, dull Daphnis," said Chloe,
-"You have told me my bosom is snowy;
- You have made much fine verse on
- Each part of my person,
-Now do something -- there's a good boy!"
-%
-For those of you how have been looking for evidence that a working
-version of "Star Wars" can be built, consider the following proof
-offered by Caspar Weinberger:
-
- "If such a system is so unattainable, why have the Soviets been
- working desperately to get it for over 17 years?"
-
- -- USA Today, 24 June 1986
-%
-Fornication, n.:
- Term used by people who don't have anybody to screw with.
-%
-FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #15
-
-Sex:
- Women prefer 30-40 minutes of foreplay. Men prefer 30-40 seconds of
-foreplay. Men consider driving back to her place as part of the foreplay.
-
-Maturity:
- Women mature much faster than men. Most 17-year-old females can
-function as adults. Most 17-year-old males are still trading baseball cards
-and giving each other wedgies after gym class. This is why high school
-romances rarely work out.
-
-Handwriting:
- To their credit, men do not decorate their penmanship. They just
-chicken-scratch. Women use scented, colored stationary and they dot their
-"i's" with circles and hearts. Women use ridiculously large loops in their
-"p's" and "g's". It is a royal pain to read a note from a woman. Even
-when she's dumping you, she'll put a smiley face at the end of the note.
-%
-FORTUNE DISCUSSES THE DIFFERENCES BETWEEN MEN AND WOMEN: #18
-
-Sexual frequency:
- The average man would prefer having sex every evening, or every
-morning, or maybe both if he's under 25. The average woman would like to
-have sex non-stop all weekend, once a month.
-
-Shopping:
- It's no coincidence that L.L. Bean, Sears, and Roebuck were all men.
-Men don't like to shop. If a man can't foist the job off on some woman, he
-will grit his teeth and plan the outing as he would a jungle expedition.
-He wants a map of the store showing where he has to go to get item X in
-color Y in the correct size, which he doesn't know. Even then it takes him
-half an hour to get there from the entrance. When he's finally accomplished
-his mission, he'll discover that he forgot his checkbook. Women shop to
-relax.
-%
-Fortune Personals:
- SWBiM, 29. Gr/Fr/Mild English. Have
- own moose, hoop. Sincere inquiries
- only. Discreet. Fortune P.O. Box 1910.
-%
-Fortune presents:
- USEFUL PHRASES IN ESPERANTO, #3.
-
-Kie estas la plej proksima masa^gejo? Where's the nearest massage parlor?
-Vi dolorigas min. You're hurting me.
-Mi deziras viziti usonan kuraciston. I want to see an American doctor.
-Mi deziras a^ceti kontraugraveda^jojn. I would like to buy some
- contraceptives.
-^Cu tiu estis ankau bona por ci? Was it good for you too?
-%
-Fortune presents:
- USEFUL PHRASES IN ESPERANTO, #4.
-Mia ^svebo^sipo estas plena je angiloj. My hovercraft is full of eels.
-Neniu anticipas la hispanan No one expects the Spanish
- Inkvizicion. Inquisition.
-La solvo estas kvardekdu. The answer is forty-two.
-Adiau, kaj dankoj por ^ciom da fi^so. So long, and thanks for all the fish.
-^Cu estas krajono en via po^so, au ^cu Is that a pencil in your pocket,
- vi feli^cas pri vidi min? or are you happy to see me?
-%
-Fortune suggests uses for YOUR favorite UNIX commands!
-
-Try:
- [Where is Jimmy Hoffa? (C shell)
- ^How did the^sex change operation go? (C shell)
- "How would you rate BSD vs. System V?
- %blow (C shell)
- 'thou shalt not mow thy grass at 8am' (C shell)
- got a light? (C shell)
- !!:Say, what do you think of margarine? (C shell)
- PATH=pretending! /usr/ucb/which sense (Bourne shell)
- make love
- make "the perfect dry martini"
- man -kisses dog (anything up to 4.3BSD)
- i=Hoffa ; >$i; $i; rm $i; rm $i (Bourne shell)
-%
-FORTUNE TESTS THE GREAT MANAGERS: #3
-
-You have prepared a proposal for your supervisor. The success of this
-proposal will mean increasing your salary 20%. In the middle of your
-proposal your supervisor leans over to look at your report and spits into
-your coffee. You:
-
- (a) Tell him you take your coffee black.
- (b) Ask him if he has any communicable diseases.
- (c) Show him who's in command; promptly take a piss in his
- "In" basket.
- (d) Take a sip and comment how much better it tastes.
-%
-FORTUNE TESTS THE GREAT MANAGERS: #5
-
-You have just returned from a trip to Green Bay, Wisconsin in January and
-tell your boss that nobody but ladies of the evening and football players
-live there. He mentions that his wife is from Green Bay. You:
-
- (a) Pretend you are suffering from amnesia and don't
- remember your name.
- (b) Ask what position she played.
- (c) Ask if she is still working the streets.
- (d) Pull lacy underwear from your raincoat pocket and ask
- if he recognizes the label.
-%
-FORTUNE TESTS THE GREAT MANAGERS: #6
-
-You are having lunch with a prospective vendor talking about what could be
-your best deal of the year. During the conversation a blonde walks into
-the restaurant and she is so stunning you draw your companion's attention
-to her and give a vivid description of what you would do if you had her alone
-in your hotel. She walks over to your table and the vendor introduces her as
-his daughter. Your next move is to:
-
- (a) Ask for her hand in marriage.
- (b) Pass out and hope for sympathy.
- (c) Forget the business; repeat the conversation to the
- daughter and get her number.
- (d) Turn red and slink off into the men's room.
-%
-FORTUNE TESTS THE GREAT MANAGERS: #9
-
-You are making a sales presentation to a group of corporate executives
-in the plushest office you've ever seen. The enchilada casserole and
-egg salad sandwich you had for lunch react, creating severe pressure.
-Your sphincter loses control and you break wind, causing the glass
-bookcase doors to shatter and a secretary to pass out. You:
-
- (a) Offer to come back next week when the smell has gone away.
- (b) Point to the Chief Executive and accuse him of the offense.
- (c) Challenge anyone in the room to do better.
-%
-Fortune understands that the vote on a bill to legalize bisexuality
-could go either way.
-%
-Fortune's Guide to Movies:
-G: No girl.
-PG: The hero gets the girl.
-R: The bad guy gets the girl, then the good guy gets the girl.
-X: The hero still gets the girl in the end, but he's never sure
- which end it will be.
-XXX: Everybody gets the girl.
-%
-Fortune's Real-Life Courtroom Quote #25:
-
-Q: You say you had three men punching at you, kicking you, raping you,
- and you didn't scream?
-A: No ma'am.
-Q: Does that mean you consented?
-A: No, ma'am. That means I was unconscious.
-%
-Fortune's Rules for Memo Wars: #1
-
- Any attempt to say that someone's personal beliefs are wrong, even if
-you supply conclusive evidence to support your claim, is an outright attack.
-If you show someone a flaw in his/her logic, they have every right to punch
-you in the face. Mathematical proofs of errors are the moral equivalent
-of rape and should be avoided at all cost.
- Now... your opponent has requested a "rational discussion". What do
-you do? Well, remember that people are normally willing to discuss things
-rationally if and only if you agree with them; anything less would obviously
-not be rational. Therefore, agree immediately, and continue as before.
- Always assume that whenever you see someone making a statement about
-"certain parties who shall remain nameless", "some people", "assholes", etc.,
-they are talking about *you*. It is also correct to assume that words you
-don't understand, such as "prestidigatory", "lapidarian", and "buprestid",
-are direct personal attacks aimed at your loved ones and merit an equally
-scathing response. Failure to do this results in many lost opportunities for
-rational discussion. (See above.)
-%
-Fortune's Rules for Memo Wars: #3
-
-The proper time for a vicious ad hominem attack is when you have no logical
-recourse. If you have been arguing a point with a person or persons for
-30 odd weeks, and a memo comes across that logically tears down the
-final shred of evidence that you thought you had, that is the time to call
-the author of that memo:
- 1: a mindless twit who attacks other people's beliefs for no reason.
- 2: an egotistical flaming typical wombat aggie melon-humping
- cheese-whizzing nanosexual subuseless clamsucker whose memos
- are apparently sneezed onto his/her terminal.
- 3: something unpleasant.
-The OTHER proper time for an ad hominem attack is immediately after someone
-has posted something you don't understand. Given the current state of modern
-electronic communications technology your inability to comprehend the meaning
-of a memo constitutes a violation of western moral tradition on the part of
-the author of that memo, and the author should be taken to task publicly via
-a series of really nasty, name-calling oriented memos.
-%
-FORTUNE'S RULES TO LIVE BY: #5
-
- Don't wear your spurs while making love in a waterbed.
-%
-FORTUNE'S RULES TO LIVE BY: #8
-
- Don't wear your high heels while making love on the pool table.
-%
-Four men had been playing golf together for twenty years. After their usual
-Saturday game one week, one of the men joined the other three for a post-game
-shower for the first time. His friends were surprised - "For twenty years",
-one of them says, "you haven't showered after our game, you've just waited for
-us in the clubhouse. Why the sudden change?"
- "Well", replies their friend, "I was born with a fairly unusual
-medical condition. I had both a penis and a vagina. Last month I finally
-decided to have the vagina removed."
- The other three men look at him in disbelief and disgust. "You
-mean," snaps one of them, "you could have played from the women's tee all
-these years?"
-%
-France is a country where the money falls apart and you can't tear
-the toilet paper.
- -- Billy Wilder
-%
-From the outset, the blind date was a fiasco and it was intensified by the
-fact that the fellow was too insensitive and ego-ridden to realize it. The
-moment of truth came in the supper club as he clutched the girl's thigh and
-whispered,
- "Baby, how's about our cutting out to my pad so I can slip you nine
-inches?"
-There was a moment of silence, and then the girl said,
- "You know, I really don't think you could get it up three times
-in a row!"
-%
-Fuck art; let's dance!
-%
-Fuck off and die!
-%
-Fuck you and anybody who looks like you.
-%
-Fuck'em if they can't take a joke!
-%
-Fucking is a filthy deed. -- I like it.
-It satisfies a normal need. -- I like it.
- It makes you sick, it makes you well,
- It turns your spine to fucking jell,
-It damns your soul to Eternal Hell! -- I like it.
-%
-Fuck-me pumps, n.:
- Stiletto heels of a certain length, usually black patent leather.
-The proper designation is "throw-me-down-and-fuck-me" pumps. Shoes with
-heels just high enough to let the frayed tip of a bullwhip trail around
-them properly.
-%
-Fuckoff, n.:
- The tie breaker at the Miss America Beauty Pageant.
-%
-Gardeners do it in raised beds.
-%
-GARTER:
- An elastic band intended to keep a woman
- from coming out of her stockings and desolating the country.
-%
-Gary Hart's biggest mistake was not getting Teddy Kennedy to drive
-Donna Rice home.
-%
-GAY:
- One who'd rather swish than fight.
-%
-GEMINI (May 21 - June 20)
- You are a quick and intelligent thinker. People like you because
-you are bisexual. However, you are inclined to expect too much for too
-little. This means you are cheap. Geminis are known for committing incest.
-%
-Gentlemen prefer blondes, but who says blondes prefer gentlemen?
- -- Mae West
-%
-Geometry teaches us to bisex angels.
-%
-George, after tying on a whopper the night before, woke up in the morning to
-find a pathetically unattractive woman sleeping blissfully beside him. He
-leaped out of bed, dressed quickly, and furtively placed $100 on top of the
-bureau. He then started to tiptoe out of the room. But, as he passed the
-foot of the bed, he felt a tug at his trouser leg. Glancing down, he saw
-another female even homelier than the one he'd left in bed. She gazed up
-at him soulfully, and asked, "Nothing for the bridesmaid?"
-%
-George Washington not only chopped down his father's cherry tree, but
-he also admitted doing it. Now, do you know why his father didn't
-punish him? Because George still had the axe in his hand.
-%
-GEORGIA:
- Where kinky sex means getting laid.
-%
-"Get a load of that chick!" "Dude -- you gotta ask her out."
-"Weellll, I dunno..." "Look. The worst she can say, is 'No'!"
-"Hey! You're right!" "I'm always right!"
-"The worst she can say... is 'No'!"
-
-"Idunnoifyou'vebeennoticingmebutI'vebeennoticingyouandIwaswonderingif
-you'd like to go out with me!"
-
-Oh my god you little Geek!
-Get away before I freak! You ugly, stupid, zitfaced scum,
-I'm a babe and you are not. You asked me out; you MUST be dumb.
-You can't handle what I've got! Well you can beg until you're blue,
-I'm too hot, too hot for you.. But you're not even fit to lick my shoe.
- I'm too hot, too hot for you.
-Ha ha ha! Don't make me laugh!
-I want a whole man, not a half. I've got a bitchin' bod and a killer
-You wet your pants, I'm so sure. face,
-Too bad wimp-itis has no cure. I'm god's gift to the male race.
-I'm too hot, too hot for you. I'm the queen of babes supreme,
- But you'll only see me in you dreams.
-"Well? What'd she say??" I'm too hot, too hot for you.
-"Well, she didn't say no..."
- -- Barry and the Bookbinders, "The Worst She Can Say is No"
-%
-GET OFF THE FUCKING SYSTEM THIS INSTANT, YOU ASSHOLE!!!!
-%
-Get your bytes from our backend!
- -- Britton Lee
-%
-Getting an education at the University of California is like having
-$50.00 shoved up your ass, a nickel at a time.
-%
-Getting Cheryl to shed her apparel
-Is like shooting goldfish in a barrel.
- But her genital area
- Is so vast it'll scareya,
-And you venture inside at your peril.
-%
-Gibble gabble gabble gibble gurgle lubble gibble babble beeble triggle
- Lean closer.
-Libble gabble gabble ibble gurgle gubble tibble babble feeble riggle
- Smile at her *knowingly*.
-Gibble gabble sabble gibble surgle gubble gibble babble beeble giggle
- Nod sympathetically. Show you're on *her* side.
-Bibble gabble gabble babble gurgle gubble gibble tribble beeble figgle
- Touch her hand lightly. Nobody understands but we two.
-Fibble gabble fobble gibble gurgle bubble gibble tabble beeble giggle
- Look sincere.
-
-"Why don't we have the next drink up at MY place?"
-
- God's gift to women strikes again.
- -- J. Feiffer
-%
-Giles: What do you want?
-Angelus: I want to torture you. I used to love it, it's been a long time.
- I mean, the last time I tortured somebody, they didn't even _H_A_V_E
- chain saws.
- -- Buffy the Vampire Slayer, "Becoming, Part 2"
- Season 2, Episode 22
-%
-Gimme that old bisexuality,
-Gimme that old bisexuality,
-Gimme that old bisexuality,
-'Cause it's good enough for me!
-
-It was good for David Bowie,
-It was good for David Bowie,
-It was good for David Bowie,
-And it's good enough for me!
-%
-Girls are better looking in snowstorms.
- -- Archie Goodwin
-%
-Girls are like pianos. When they're not upright, they're grand!
-%
-Girls marry for love. Boys marry because of a chronic irritation
-that causes them to gravitate in the direction of objects with
-certain curvilinear properties.
- -- Ashley Montagu
-%
-Girls really do know just what they want -- you to figure it out for
-yourself!
-%
-Girls who put out are tramps. Girls who don't are ladies. This is,
-however, a rather archaic use of the word. Should one of you boys happen
-upon a girl who doesn't put out, do not jump to the conclusion that you
-have found a lady. What you have probably found is a lesbian.
- -- Fran Lebowitz, "Metropolitan Life"
-%
-Girls who throw themselves at men,
-are actually taking very careful aim.
-%
-Girls would never stay out late if guys didn't make them.
-%
-Give a man a free hand and he'll run it all over you.
- -- Mae West
-%
-Give me Librium or give me Meth.
-%
-Give me the Luxuries, and to Hell with the Necessities!
-%
-GLEE CLUB GROUPIE:
- A girl into choral sex.
-%
-GNU Make will no longer go into an infinite loop when fed the horrid
-trash that passes for makefiles that `imake' produces (so you can
-compile X, despite the extreme stubbornness and irrationality of its
-maintainers).
- -- GNU Make 3.55 release notes
-%
-Go out with girls Dutch treat -- pay for dinner, drinks,
-and the movie, and the rest of the evening is on her.
-%
-Go to Heaven for the climate, Hell for the company.
- -- Mark Twain
-%
-God gives us relatives; thank goodness we can chose our friends.
-%
-God is a polytheist.
-%
-God is an atheist.
-%
-GOD is applied POWER
- which is applied GOVERNMENT
- which is applied POLITICS
- which is applied ADVERTISING
- which is applied SOCIOLOGY
- which is applied PSYCHOLOGY
- which is applied BIOLOGY
- which is applied CHEMISTRY
- which is applied PHYSICS
- which is applied MATH
- which is applied PHILOSOPHY
- which is applied BULLSHIT
-%
-"God is as real as I am," the old man said. My faith was restored, for
-I knew that Santa would never lie.
-%
-God is big, so don't fuck with him.
-%
-God is not dead! He's alive and autographing bibles at Cody's.
-%
-God is omnipotent, omniscient, and omnibenevolent -- it says so right here
-on the label. If you have a mind capable of believing all three of these
-divine attributes simultaneously, I have a wonderful bargain for you. No
-checks, please. Cash and in small bills.
- -- Lazarus Long
-%
-God isn't dead -- he's been busted.
-%
-God isn't dead, he just couldn't find a parking place.
-%
-God isn't dead, He's just trying to avoid the draft.
-%
-God made the world in six days, and was arrested on the seventh.
-%
-God must love assholes -- She made so many of them.
-%
-God wanted to have a holiday, so He asked St. Peter for suggestions on
-where to go.
- "Why not go to Jupiter?" asked St. Peter.
- "No, too much gravity, too much stomping around," said God.
- "Well, how about Mercury?"
- "No, it's too hot there."
- "Okay," said St. Peter, "What about Earth?"
- "No," said God, "They're such horrible gossips. When I was
-there 2000 years ago, I had an affair with a Jewish woman, and they're
-still talking about it."
-%
-God wants us to know that if we see a bumper sticker saying "Honk if you love
-Jesus" it is a bad idea to honk to express an opinion about Jesus because it
-will annoy the turkey who put the bumper sticker on as well as everyone else
-in the vicinity. However, it is just fine to honk to annoy the turkey simply
-for being a turkey, for God told Man to be fruitful and multiply, and to rule
-over the beasts of the field and the birds of the air, and that includes the
-turkeys who buy such bumper stickers. Of course, God understands that innocent
-bystanders will also be annoyed, but He has wisely created traffic cops to
-impose some constraint on how much we may annoy the turkeys within city limits,
-for God's wisdom comprehends full well that thou shalt not make an omelette
-without breaking eggs. God only wishes they were turkey eggs, so such moral
-dilemmas shall be fewer in number in the future, when the generations a-coming
-(hallelujah) won't have so many turkeys to deal with. But God knows full well
-that such things take time, and the turkeys are showing more resilience than
-expected, and may be with us for a long time yet.
-%
-God's plan had a great beginning,
-But man spoiled his chances by sinning
- We trust that the story
- Will end in God's glory
-But at present the other side's winning.
-%
-Going into politics is as fatal to a gentleman as going into a bordello
-is fatal to a virgin.
- -- H.L. Mencken, "A Carnival of Buncombe"
-%
-Gold coast slave ship bound for cotton fields
-Sold in a market down in New Orleans
-Scarred old slaver knows he's doing alright
-Hear him whip the women, just around midnight
-
-Ah, brown sugar how come you taste so good?
-Ah, brown sugar just like a young girl should
-
-Drums beating cold English blood runs hot
-Lady of the house wonderin' where it's gonna stop
-House boy knows that he's doing alright
-You should a heard him just around midnight.
-...
-I bet your mama was tent show queen
-And all her girlfriends were sweet sixteen
-I'm no school boy but I know what I like
-You should have heard me just around midnight.
- -- Rolling Stones, "Brown Sugar"
-%
-Goldfish: Two naked people tied and put on a mattress together to make love
-"fish fashion" (ie: no hands). Originally a nineteenth-century bordel joke.
-It can be done (if you are the victims, try on your sides from behind).
-Venerable party game, but don't play it with strangers, or leave players
-unsupervised, even briefly. There was a nice spoof on this sex stunt in
-the movie "Soldier Blue". A good many women can get an orgasm from this
-simply by struggling, especially if you put them in front of a mirror.
-Don't both tie yourselves, even if you can manage it -- you might not be
-able to get loose.
- -- The Joy of Sex
-%
-Good day for water sports. Take a bath with a friend.
-%
-Good evening Ladies and Gentlemen!
-Here's a little number I tossed up in the Caribbean recently...
-
-Isn't it awfully nice to have a Penis,
-isn't it frightfully good to have a Dong.
-
-It's swell to have a Stiffy,
-it's divine to have a Dick,
-from the tinyest little Tadger,
-to the world's greatest Prick.
-
-So, breeches for your Willy or John-Thomas,
-Hooray! for your One Eyed Trouser's Snake.
-
-Your Piece of Pork, your Wife's best friend,
-your Porky or your Cock,
-you can wrap it up in ribbons,
-you can stick it in your sock!
-
-But, don't take it out in public,
-or they will stick you in the dock,
-and you won't come back.
- -- Monty Python, "The Meaning of Life"
-%
-Good scout, n.:
- Someone who knows the lay of the land and will take you to her.
-%
-Gorbachev woke up early one morning, and felt great. He walked over to his
-window, threw back the curtains, and saw the sun coming up. He felt *so*
-good, he crowed, "Good Morning Sun!", and was startled when a great booming
-voice came back to him, "Good morning Comrade! Good morning to you and
-the great Soviet Socialist Republic!". Of course, this surprised him, but
-great politician that he is, he considers the political ramifications.
-Gorbachev then woke up Reza and his closest aides, brought them into his
-bedroom, and shouted out "Good morning, Comrade Sun!". Again a booming reply,
-"Good morning, Comrade. Good morning to you and the rest of the Party!"
-Everyone was quite excited about this, and Gorbachev sat down to his
-day's work with a feeling of being destiny's favorite child.
- Later, in the evening, he was preparing for the ballet. As he
-dressed, he noticed that the sun was setting. Walking over to the window,
-Gorbachev threw up the sash and again addressed the sun, "Good evening to
-you, Comrade Sun!". Once more the great voice boomed out, "Fuck you,
-asshole! I'm in the West now!"
-%
-Grain grows best in shit.
- -- Ursula K. LeGuin
-%
-Gravity is a myth, the Earth sucks.
-%
-Gravity is an unforgiving motherfucker.
-%
-Great Lover, n.:
- A man who can breathe through his ears.
-%
-GREAT MOMENTS IN AMERICAN HISTORY (#21): July 30, 1917
-
-On this day, New York City hotel detectives burst in and caught then
-Senator Warren G. Harding in bed with an underage girl. He bought
-them off with a $20 bribe, and later remarked thankfully, "I thought
-I wouldn't get out of that under $1000!" Always one to learn from
-his mistakes, in later years President Harding carried on his affairs
-in a tiny closet in the White House Cabinet Room while Secret Service
-men stood lookout.
-%
-Gross, adj.:
- When your bloody mary still has the string in it.
-%
-Gross, adj.:
- When your grandmother kisses you goodnight and
- slips you some tongue.
-%
-Gynecologist, n.:
- Someone who spends their time spreading old wives' tails.
-%
-HACKER:
- A master byter.
-%
-Hackers do it bottom-up.
-%
-Hackers do it with all sorts of characters.
-%
-Hackers do it with bugs.
-%
-Hackers do it with fewer instructions.
-%
-Hackers have kernel knowledge.
-%
-Hackers know all the right MOVs.
-%
-Haggis, n.:
- Haggis is a kind of stuff black pudding eaten by the Scots and
-considered by them to be not only a delicacy but fit for human
-consumption. The minced heart, liver and lungs of a sheep, calf or
-other animal are mixed with oatmeal, sealed and boiled in maw in the sheep's
-intestinal stomach-bag and ... Excuse me a minute ...
-%
-Half the posts to this group are about masturbation and the other half
-are about penis size. And what I want to know is, if all you're doing
-is jerking off, why do you care how big it is?
- -- From alt.sex
-%
-Halt!! Who goes there, friend or enema?
-%
-Handsome woman. -- Lovely bust.
-Fine young fellow. -- Stirred-up lust. --
- Babies' diapers. --
- Bottom wipers. --
-Years of struggle. -- Coffin. -- Dust.
-%
-Handy hint:
- A tea bag or two can be a dandy substitute
- when you're out of tampons.
-%
-Hang gliders come down very slowly.
-%
-Hangover, n.:
- The burden of proof.
-%
-HAPPINESS:
- Having your Herpes (Type II) test come back negative.
-%
-Hardly a pure science, history is closer to animal husbandry than it is
-to mathematics, in that it involves selective breeding. The principal
-difference between the husbandryman and the historian is that the
-former breeds sheep or cows or such, and the latter breeds (assumed)
-facts. The husbandryman uses his skills to enrich the future; the
-historian uses his to enrich the past. Both are usually up to their
-ankles in bullshit.
- -- Tom Robbins
-%
-Harold had never wanted a woman so much in his life, upon overhearing the
-22- year-old beauty remark that he was too old and out of shape for her. The
-determined septuagenarian immediately embarked upon a rigorous self-improvement
-program. He had his face lifted, bought a toupee, ran five miles every day,
-lifted weights and adopted a strict vegetarian diet. Within months, the
-rejuvenated man won the young woman's heart, and she agreed to marry him.
- On the way out of the chapel, however, Harold was fatally struck
-by lightning. Furious, he confronted Saint Peter at the pearly gates. "How
-could you do this to me after all the pain I went through?"
- "To be honest, Harold," Saint Peter sheepishly replied, "I didn't
-recognize you."
-%
-Harry came into work on Monday feeling absolutely fine, and so was astonished
-when his secretary urged him to lie down on the sofa; even more so when his
-boss took one look at him and ordered him to take the day, if not the week,
-off. Even his poker buddies wouldn't have anything to do with him, insisting
-that he go straight to bed. Finally, tired of resisting everyone's advice,
-he went to see his doctor, who took one look at him and rushed over with
-a stretcher.
- "But doctor," he protested, "I feel fine."
-Well, this was a puzzler, conceded the doctor, who proceeded to refer to the
-enormous reference tomes behind his desk, muttering to himself.
- "Looks good, feels good... No, you look like hell. Looks good,
-feels terrible... Nah, you feel fine, right?"
-Thumbing furiously through another volume, he said,
- "Looks terrible, feels terrible... Nope, that won't do it either."
-Finally, "Looks terrible, feels terrific... Aha!! You're a vagina!"
-%
-Have you ever really thought about there being a simple solution to
-America's problems? Why, we could solve all of our raw materials
-difficulties, foreign complications etc. over a long weekend. If we
-got up early, early mind you, on Saturday, we could take over Mexico
-by 10:00. Panama and most of South America would be a bit more difficult,
-but I believe we could do it by 6 or 7 that evening. Turning our
-attention northward, Canada would require most of Sunday morning.
-General mopping up and execution of the civilian populations would take
-up Sunday afternoon. I just don't understand why Washington hasn't
-thought of this...
-%
-Have you ever stopped to think what it would be like to have a woman
-President? "I can't deal with the Russians today. Not now. I've got
-my period."
- -- Steven Moore
-%
-Have you ever tried to tickle yourself? Everybody has some wacko aunt or
-uncle that can just point at you and have you rolling with laughter. But
-if you shove your fist in your underarm for a week and a half you won't
-laugh. Somehow your underarm just knows that it's *your* fist. Thank God
-other parts of our bodies are dumber.
-%
-Have you ever wondered what makes Californians so calm? Besides drugs, I
-mean. The answer is hot tubs. A hot tub is a redwood container filled with
-water that you sit in naked with members of the opposite sex, none of whom
-is necessarily your spouse. After a few hours in their hot tubs, Californians
-don't give a damn about earthquakes or mass murderers. They don't give a
-damn about anything, which is why they are able to produce "Laverne and
-Shirley" week after week.
- -- Dave Barry
-%
-Have you heard about Magda Lupescu,
-Who came to Rumania's rescue?
- It's a wonderful thing
- To be under a king--
-Is democracy better, I esk you?
-%
-Have you heard of knock-kneed Samuel McGuzzum
-Who married Samantha, his bow-legged cousin?
- Some people say,
- Love finds a way,
-But for Sam and Samantha it doesn'.
-%
-Have you heard of the lady named Cox
-Who had a capacious old box?
- When her lover was in place
- She said, "Please turn your face.
-I look like a gal, but I screw like a fox."
-%
-Have you heard of those trollops of Birmingham
-And the scandal that's currently concerning'em?
- How they lift the frock
- And tickle the cock
-Of the bishop while he was confirming 'em?
-%
-Have you seen how Sonny's burning,
-Like some bright erotic star,
-He lights up the proceedings,
-And raises the temperature.
- -- The Birthday Party, "Sonny's Burning"
-%
-Having discovered the possibility that other creatures could be used
-for sexual intercourse, early man was likely to have made many such
-attempts ... though it is doubtful that he was so sexually carnivorous
-as the Christian and Jewish Adam, who, rabbinical interpreters of the
-Old Testament tell us, had intercourse with every creature before God
-finally hit upon the idea of woman and created Eve.
- -- R. E. Masters
-%
-Having lost his potency years before, the octogenarian was desperate to
-satisfy his new 18-year-old wife. He visited a gypsy woman with magical
-powers.
- After the man downed a foul-tasting potion, the gypsy said, "There.
-Now the words beep-beep will give you an enormous erection. Repeating
-the phrase will make it disappear. But remember," she cautioned, "it will
-work only three times. Make use of them wisely."
- As the old man left, he decided to test her prediction. "Beep-beep,"
-he said, and sure enough, he got the biggest erection of his life.
-"Beep-beep", he repeated. It went away.
- He sped through traffic on his way home. "Beep-beep," honked a taxi.
-The old man gasped as he instantly got hard.
- "Beep-beep," honked a truck. His erection wilted.
- Pulling into his driveway at last, the frantic man rushed inside
-and found his nubile wife lying on the bed reading a novel.
- "Have I got a surprise for you," he said, tearing off his clothes.
-"Beep-beep!"
- "Hold on a second," his wife said, eyeing his magnificent erection.
-"What's all this beep-beep shit?"
-%
-Having made a remark rather coarse,
-A young lady was seized with remorse;
- She fled from the room,
- And later, a groom
-Saw her rolling about in the gorse.
- -- Edward Gorey
-%
-He: Am I... am I your first?
-She: Well, honey, I could have sworn your face looked familiar...
-%
-He: "Hey, Baby, I'd sure like to get in your pants!"
-She: "No, thanks, I've already got one asshole in there now."
-%
-He: So, what do you say to little fuck?
-She: I say, "get lost, little fuck."
-%
-He boil my first cabbage, make it awfully hot,
-But when he put in the bacon, oooh, you know it overflow the pot.
- -- Bessie Smith, "Empty Bed Blues"
-%
-He carried me over the stream, striding through the current, his strong,
-muscular, thighs scarcely hesitating as he sure-footedly forded the water.
-But what was that bulge, small, oblong, solid, that might have been, say,
-a pocket camera?
- -- An Exciting Journey
-%
-He could be a poster child for retroactive birth control.
-%
-He dove down overweighted with lead.
-Passed one hundred and flat lost his head.
- He flapped and he flailed,
- Spit his hose and he wailed,
-Swallowed water and found himself dead.
-%
-He drank with curvy Mable,
-The pace was fast and furious,
-He slid beneath the table,
-Not drunk but merely curious.
-%
-He grabbed me by my slender neck,
-I could not call or scream.
-He dragged me to his tiny room,
-Where we could not be seen.
-He tore away my filmy wrap,
-And gazed upon my form.
-I so cold and frightened,
-While he so strong and warm.
-He pressed me to his thirsty lips,
-I gave him every drop.
-He drained me of my very self,
-I could not make him stop!
-And that is why you see me here,
-An empty, broken bottle of beer...
-%
-He had heard that a certain whorehouse had a reputation for the bizarre.
-So he drove to the place and, once inside, asked the Madam if she had anything
-unusual for him to try. "Things are pretty slow today," she said, "but I
-do have one number you might enjoy." She went on to describe a New Jersey
-hen that had been trained to do blow jobs.
- "We've got her here, but only for the day."
- The visitor could hardly believe it, but he paid the fee and went
-into a room with a hen. After a frustrating hour of trying to force his
-cock into the hen's mouth, he figured out that he was dealing with nothing
-but a plain old chicken. He left. Thinking about it later, he decided
-that he had had so much fun trying that he returned the few days later and
-asked the Madam, "Do you have anything new today?"
- "Come this way," she said, and led him to a dark room where a group
-of men were looking through a one-way mirror. He saw that they were watching
-a girl making it with a large doberman pinscher.
- "Wow!" he said to the man standing next to him. "This is really
-great!"
- The man replied, "Man, it ain't nothin'! You shoulda been here
-a week ago and seen the guy with the chicken!"
-%
-He hated to mend, so young Ned
-Called in a cute neighbor instead.
- Her husband said, "Vi,
- When you stitched up his torn fly,
-Did you have to bite off the thread?"
-%
-He played smooch and stinkfinger with Daisy
-Till this virgin was gotch-eyed and hazy.
- Then his gargantuan pole in
- Her pink, tight, and swollen
-Young cunt just about drove her crazy.
-%
-He used to kiss her on her lips, but it's all over now.
-%
-He was not only a great swordsman, but also a cunning linguist.
-%
-He was so gay he'd never lean his ass on a baseball bat --
-scared it'd get serious.
-%
-He was so ugly hookers used to tell him, "Not on the first date."
-%
-He was the world's only armless sculptor. He put the chisel in his mouth
-and his wife hit him on the back of the head with a mallet.
- -- Fred Allen
-%
-He wasn't much of an actor, he wasn't much of a Governor -- Hell, they
-_H_A_D to make him President of the United States. It's the only job he's
-qualified for!
- -- Michael Cain
-%
-He who farts in church must sit in his own pew.
-%
-He who findeth sensuous pleasures in the bodies of lush, hot, pink
-damsels is not righteous, but he can have a lot more fun.
-%
-He who sneezes without a handkerchief takes matters into his own
-hands.
-%
-He who trains his tongue to quote the learned
-sages, will be known far and wide as a smart ass.
- -- Howard Kandel
-%
-Hear about...
- one penile desensitizer that's so effective that you
- have to stroke the tube for five minutes to get the cap off?
-%
-Hear about...
- the 97-year-old prostitute who got herself listed in the Yellow
- Pages and now claims to be the oldest trick in the book?
-%
-Hear about...
- the absent minded nurse who made the patient without disturbing
- the bed?
-%
-Hear about...
- the absent minded sculptor who put his model to bed and
- started chiseling on his wife?
-%
-Hear about...
- the absent-minded exhibitionist who was arrested for exposing
- his whatchamacalit?
-%
-Hear about...
- the ambitious secretary who walked into her boss's office and
- demanded a salary on next week's advance?
-%
-Hear about...
- the Ayatollah Khomeini Doll?
- Wind it up and it takes Ken and Barbie hostage.
-%
-Hear about...
- the basketball player who was so tall that his girlfriend had to
- go up on him?
-%
-Hear about...
- the careless canary that did it for a lark?
-%
-Hear about...
- the careless contortionist who accidentally swallowed his pride?
-%
-Hear about...
- the compulsive gambler who drove to Las Vegas, pulled up to
- a parking meter, put a dime in -- and lost his car?
-%
-Hear about...
- the couple on the stalled elevator who got off between floors?
-%
-Hear about...
- the cross-eyed shoe fetishist who was always getting off on the
- wrong foot?
-%
-Hear about...
- the doctor that prescribed sex for insomnia? His patients didn't
- get any more sleep, but they had more fun staying awake.
-%
-Hear about...
- the drunken midget who walked into a home for girls and kissed
- everybody in the joint?
-%
-Hear about...
- the elderly gentleman who was stung on the privates by a bee and
- asked the doctor to relieve the pain but leave the swelling?
-%
-Hear about...
- the Eskimo girl who spent the night with her boyfriend and
- next morning found she was six months pregnant?
-%
-Hear about...
- the farmer who couldn't keep his hands off his wife, so he
- fired them?
-%
-Hear about...
- the fellow who chased his girlfriend up a tree and kissed
- her between the limbs?
-%
-Hear about...
- the fellow who got ten years for pumping Ethyl behind the station?
-%
-Hear about...
- the fellow who maintains a special register of particularly
- accommodating girls? He refers to it as his little blew book.
-%
-Hear about...
- the fellow who was descended from a long line his mother heard?
-%
-Hear about...
- the fine, upstanding young woman who's wonderful laying down?
-%
-Hear about...
- the freaky WAC who was court-martialed for contributing to the
- delinquency of a major?
-%
-Hear about...
- the French soldier who kissed his wife's cheeks before he went
- to the front?
-%
-Hear about...
- the freshman coed who decided not to sign up for a course in sex
- education when she heard the final exam would be oral?
-%
-Hear about...
- the frustrated musician who worked all week on an arrangement and
- then his wife didn't leave town?
-%
-Hear about...
- the fun-loving young lady who insists she won't even consider
- marriage until she's gotten some experience under her belt?
-%
-Hear about...
- the gay tattoo artist who had designs on several of the local
- sailors?
-%
-Hear about...
- the girl that wanted to impress her new boyfriend,
- so she put on her low-cut dress to show him a thing or two?
-%
-Hear about...
- the girl who called her boyfriend Amaretto, 'cause he was
- such a sweet liquor?
-%
-Hear about...
- the girl who was so undesirable that she even turned her vibrator
- off?
-%
-Hear about...
- the girl with the big wardrobe who started with just a little slip?
-%
-Hear about...
- the guy who couldn't find his way to the orgy? Just kind of lost
- his ball bearings.
-%
-Hear about...
- the guy who had his vasectomy done by Sears?
- Every time he gets a hard-on, the garage door goes up.
-%
-Hear about...
- the guy who took a course in exotic lovemaking and announced that
- he'd never be able to face his girl again?
-%
-Hear about...
- the guy who was an incurable romantic until penicillin came along?
-%
-Hear about...
- the guy who was so well endowed that he had a fiveskin?
-%
-Hear about...
- the handsome bachelor Senator who hired a ravishing blonde as his
- assistant and then made her the object of a long Congressional probe?
-%
-Hear about...
- the high school drum major who dated two of the majorettes and
- so enjoyed the breasts of both whirlers?
-%
-Hear about...
- the hurricane that recently struck Fire Island -- Hurricane Bruce?
-%
-Hear about...
- the inexperienced stenographer who discovered that she could lose
- a lot more than letters behind the files?
-%
-Hear about...
- the insurance salesman who says his greatest successes are
- with young housewives who aren't adequately covered?
-%
-Hear about...
- the little boy that found a fifty cent piece, so he went home
- for some money?
-%
-Hear about...
- the loner who gave up his solitary vice for Lent? Except on
- Palm Sunday, of course.
-%
-Hear about...
- the man who never worried about his marriage until he moved from New
- York to California and discovered that he still had the same milkman?
-%
-Hear about...
- the mother of 12 who was called upon to use her diaphragm so often
- that she kept it tacked to the headboard of her bed?
-%
-Hear about...
- the new breakfast cereal called Queerios? You simply add milk
- and they eat each other.
-%
-Hear about...
- the new breakfast cereal called "Swingers". They don't go snap,
- crackle, or pop; they just lie there and go bang, bang, bang?
-%
-Hear about...
- the new instrument of credit especially designed for use in
- Los Angeles single bars? It's called Bang Americard.
-%
-Hear about...
- the new rule at the girls' school?
- Lights out by ten, candles by eleven.
-%
-Hear about...
- the new vitamin made from chicken blood,
- it makes men cocky and women lay better?
-%
-Hear about...
- the nurse they thought had drowned
- until they found her under the doc?
-%
-Hear about...
- the nymphomaniac teenager popularly known as Little Often Annie?
-%
-Hear about...
- the over-eager bride who came, walking down the aisle?
-%
-Hear about...
- the perverted Australian who left his wife and returned to Sydney?
-%
-Hear about...
- the poor Greek fisherman who got his upper torso wedged into
- a porthole and couldn't get out to save his ass?
-%
-Hear about...
- the real smart girl who could play post-office all night
- without getting any mail in her box?
-%
-Hear about...
- the recent cigarette survey that disclosed that 99% of the
- men who have tried Camels have gone back to women?
-%
-Hear about...
- the San Franciscan who backed off the bus because he thought
- someone would grab his seat?
-%
-Hear about...
- the secretary that got fired because she had one too mini?
-%
-Hear about...
- the sultan who had ten wives, nine of them had it soft.
-%
-Hear about...
- the swinger who labeled his little black book "Future Shack"?
-%
-Hear about...
- the tight end who got two years for possession and came out a
- wide receiver?
-%
-Hear about...
- the truck driver who pulled out to avoid a child and fell
- off the sofa?
-%
-Hear about...
- the ultimate in singles bars. It's a place where girls have
- to show their I.U.D.'s to be admitted?
-%
-Hear about...
- the woman who claimed that two martinis usually made her
- feel like a new man?
-%
-Hear about...
- the young lady attacked in San Francisco?
- By two men, one held her down while the other one did her hair.
-%
-Hear about...
- the young thing who is fondly known to the men in the office as
- Secretariat -- not just because she's a good secretary but because
- she's a wonderful mount?
-%
-Hear about the...
- guy who wore a tux to his vasectomy, because he figured that
- if he was going to be impotent he might as well look impotent.
-%
-Hear that...
- bookstores will soon be stocking a volume called "The Unsensuous
- Census Taker". It's about a guy who comes once every ten years?
-%
-Hear that...
- the Masters and Johnson clinic may well be the only organization
- in the world from which a man resigns when he becomes a member
- in good standing?
-%
-Hear that...
- the only thing worse than coming home with lipstick on your
- collar is being caught with leg make-up on your ears?
-%
-Hear that...
- the Pope's next pronouncement on birth control is to be titled
- "Paul's Epistle to the Fallopians"?
-%
-Hear that...
- there's an establishment near the White House that caters to kinky
- tastes? There's a House whip in attendance, of course?
-%
-Hear that...
- those new edible candy pants are about to be distributed in a male
- version -- with nuts of course?
-%
-Heard tell that the Iron Magnolia wanted to divorce ol' Jimmy.
-Seems he's screwing everyone but her.
-%
-He'd kiss and the girls called him Georgie
-They'd cry and the girls called him Porgie.
- So he put Spanish fly
- In their pudding and pie
-And had the first tiny-tot orgy.
-%
-Heisenberg may have done it.
-%
-"Hell, no," said the Duchess of Quick,
-"I won't suck his filthy old prick!
- It's not that I funk
- At a mouthful of spunk,
-But the smell of his ass makes me sick!"
-%
-Hello, children!!
- This is Uncle Dennis welcoming you to your very own fortune.
- Today we are going to hear a story, so sit right here on my lap
- and we can all start. Comfortable? Ah, yes, ah... Ah? Ah!!
-
- One day, Rikki, the magic Pixie, went to visit Daisy Bumble in her
- tumbledown cottage. He found her in the bedroom. Roughly he
- grabbed her heaving ******* pulling her down on the bed and
- hurriedly ripping off her thin *******.
-
- Old Nick, the Sea Captain was a rough tough jolly sort of fellow.
- He loved the life of the sea and he loved to hang out down by the
- pier where the men dressed as ladies ****** **** ******* *******
- of ***** ****** **** the ****** with a melon.
-
- Rumpletweezer ran the Dinky Tinky shop in the foot of the Magic
- oak tree by the wobbly dum-dum tree in the shade of the enchanted
- glen down in Dingly Dell. Here he sold contraceptives, ********
- and various appliances *** ******** *** ***** naked fun and *****
- the ******** ******* *** into six or seven pairs.
-%
-Help! I'm a lesbian trapped in a gay man's body!
- -- Bisexuality, 101
-%
-Help Stamp Out Rape! (Say Yes.)
-%
-HENPECKED HUSBAND:
- One who's afraid to tell his pregnant wife that he's sterile.
-%
-Her brother, a bastard named Ben,
-Could rotate his pecker, and then
- He would shoot through his rear
- Which made him dear
-Of the girls, and the envy of men.
-%
-Her daughter, thought worried Ms. Coffin,
-Had morals the city might soften.
- So she phoned and asked, "Lynn,
- Are you living in sin?"
-Lynn said, "No -- but I visit there often."
-%
-Her figure described a set of parabolas that could cause cardiac arrest
-in a yak.
- -- Woody Allen
-%
-Her kisses left something to be desired -- the rest of her.
-%
-Here I sit, my cheeks a flexin',
-Just gave birth to another Texan.
-%
-Here is the problem: for many years, the Supreme Court wrestled with
-the issue of pornography, until finally Associate Justice John Paul
-Stevens came up with the famous quotation about how he couldn't define
-pornography, but he knew it when he saw it. So for a while, the
-court's policy was to have all the suspected pornography trucked to
-Justice Stevens' house, where he would look it over. "Nope, this isn't
-it," he'd say. "Bring some more." This went on until one morning when
-his housekeeper found him trapped in the recreation room under an
-enormous mound of rubberized implements, and the court had to issue a
-ruling stating that it didn't know what the hell pornography was except
-that it was illegal and everybody should stop badgering the court about
-it because the court was going to take a nap.
- -- Dave Barry, "Pornography"
-%
-Here's a toast to Screwy Dick,
-The man who was born with a corkscrew prick.
-He spent his life in a futile hunt,
-To find a woman with a spiral cunt.
-And when he did, he dropped stone dead,
-'Cause the blasted thing had a left-hand thread!
-%
-Here's the holiday schedule for Monday's observation of Martin Luther
-King, Jr.'s birthday, when the following will be closed:
-
- * Governmental offices
- * Post offices
- * Libraries
- * Schools
- * Banks
- * Parts of Palm Beach
-
-and the mind of Senator Jesse Helms of North Carolina.
- -- Dennis Miller, "Saturday Night Live"
-%
-Here's to the girl in little red shoes,
-She drinks my liquor, she drinks my booze,
-She has no cherry, but that's no sin,
-She has the box the cherry came in.
-%
-Here's to the girl that's dressed in black,
-She's dressed so neat there's nothing to lack
-She feels so fine and kisses so sweet
-She makes things stand that have no feet.
-%
-Here's to the girl that's sweet,
-Here's to the girl that's true,
-Here's to the girl in all our hearts...
-
-In other words, guys, what do you say we all go downtown for
-the rest of the night?
-%
-Here's to the woman beautiful and divine
-she flowers every month bears fruit every nine
-she's the only creature 'tween heaven and hell
-can get the juice from a nut without cracking the shell.
-%
-Here's to women. Would that we could fall into her arms without falling
-into her hands.
- -- Ambrose Bierce
-%
-HERMIT:
- A man who'd rather get off by himself.
-%
-HERPES:
- The final proof that 'tis better to give than to receive.
- Much better.
-%
-He's a son-of-a-bitch, but he's our son-of-a-bitch.
- -- FDR on Nicaraguan dictator Anastasio Somoza
-%
-He's gallantry personified, in fact, his brochures ought to
-read satisfaction guaranteed, or your virginity returned intact.
-%
-He's learned about 50% of the rules of sex and conversation;
-he knows how to stick it in, but not how to stick it out.
-%
-He's not pining, he's passed on! This parrot won't squawk! He's
-ceased to be! He's expired, and gone to meet his maker! It's a
-stiff! No breath of life, he may rest in peace! If you hadn't nailed
-him to the perch, he'd be pushing up the daisies! He's off the twig!
-He's kicked the bucket! He's curled up his tooties! He's shuffled off
-this mortal world! He's run down the curtain, and joined the bleed'n
-Choir Invincible! HE'S FUCKING SNUFFED IT! Vis-a-vi his metabolic
-processes is head is lost. All statements concerning this parrot is no
-longer a going concern, after from now on, Inoperative...
-
- THIS IS AN EX-PARROT!!
- -- Monty Python
-%
-Hey baby!
- How 'bout a brutal face fuck?
-%
-HEY KIDS! ANN LANDERS SAYS:
- A great way to prevent the tragedy of unwanted pregnancy is to
-become a homosexual. Every year, millions of young men and women, just
-like you, are making the clean change to worry-free homosexuality.
-They're having more sex than ever, and more fun than ever. Send 50 cents
-today for my leaflet "Gay sexual techniques". Be sure to specify the
-male or female edition.
-%
-HEY, KIDS! ANN LANDERS SAYS:
- Masturbation isn't as simple as it looks. Do it right!
-Send 50 cents for my illustrated booklet "Masturbation techniques
-for the teenager". Be sure to specify the male or female edition.
-%
-HEY KIDS! ANN LANDERS SAYS:
- Remember, oral sex CAN cause pregnancy, unless you use an
-oral contraceptive. See your family planning clinic today!
-%
-Hickory Dickory Dock,
-Three mice ran up a clock!
-The clock struck one,
-Right in the balls!
-
-There was an old woman,
-Who lived in a shoe,
-Who had so many children,
-Her uterus fell right out.
-%
-Higgledy Piggledy Coeducational
-Yale University Extracurricular
-Gave up misogyny Heterosexual
-Opened its door. Fun is in store.
-%
-Hire the handicapped -- they're fun to watch!
-%
-His shy bride admitted to Crandall
-That for years she'd worked off with a candle,
- But a cock like his dick
- Gave her ten times the kick,
-Though it strained her wee peehole to handle!
-%
-History has the relation to truth that theology has to religion --
-i.e., none to speak of.
- -- Lazarus Long
-%
-Home is where the hurt is.
- -- Strange de Jim
-%
-Honest, officer, had I known my health was
-in jeopardy, why, I'd never have lit one!
-%
-HONOR:
- Almost as good as in 'er.
-%
-Horny, adj.:
- When your cock gets hard if the wind blows.
-%
-Horsecrap, little brother. There's always something more to be done.
-Another palm to be greased. Another back to be scratched. Another
-weak sister to be shored up.
- -- J.R. Ewing
-%
-HOT TUB TIPS FOR WOMEN
- Vol. I -- Etiquette
-
-1. It's not lady-like to straddle a water jet, moan in ecstasy, and then
- scream at the top of your lungs, "Oh, yes, YES, BABY!"
-2. Washing your partner's back is sexy. Washing your panty hose is not.
-3. Nude bathing with strangers can be a pleasant experience; don't spoil
- it for everyone with a thoughtless remark, such as "My God, I've
- seen bigger wangs on hamsters!"
-4. It's O.K. to pass a joint while tubbing. Don't pass anything else.
-5. Don't think you're fooling anybody by passing off your vibrator as a
- toy submarine.
-%
-How can you say that the world isn't
-Jewish, when the sun's real name is Sol?
-%
-How come if you're horny it's lust, but if she's horny it's affection?
-%
-How do you like the new America? We've cut the fat out of the
-government, and more recently the heart and brain (the backbone was
-gone some time ago). All we seem to have left now is muscle. We'll be
-lucky to escape with our skins!
-%
-How should they answer?
- -- Abigail Van Buren (Dear Abby) in reply to the question
- "Why do Jews always answer a question with a question?"
-%
-How soon can you have sexual relations after your wife delivers?
-Well, depends on if she's in a ward or a private room.
-%
-HOW TO REMOVE STAINS -- #28
- Semen stains can be removed from computer terminals with
- Fantastik or the like. Use Windex on the glass however, and
- be sure to turn the power off if you have to clean between
- the keys.
-%
-Howard Cosell's biggest protrusion is his asshole.
- -- John Valby
-%
-Hugh Hefner is a virgin.
-%
-Hunters make the best lovers; they go deeper into the
-bush, shoot more often and *always* eat what they shoot.
-%
-Hypocrisy is the Vaseline of social intercourse.
-%
-Hypocrite, n.:
- A man who says he likes cats, but won't eat pussy.
-%
-I am an atheist, thank God!
-%
-I believe that Ronald Reagan will someday make this country what it
-once was ... an arctic wilderness.
- -- Steve Martin
-%
-I bet you think you're pretty cool driving around without auto insurance.
-You're probably saying to yourself, "I'm beating the system." But what's
-going to happen when you get pulled over and lose your license because
-you're not insured. What girl's going to ride shotgun on a ten-speed on
-a Saturday Night? Yeah, you're going to be beating more than the system...
- -- auto insurance ad, heard on KNAC, Long Beach
-%
-I call Christianity the one great curse, the one enormous and innermost
-perversion, the one great instinct of revenge, for which no means are
-too venomous, too underhand, too underground and too petty -- I call it
-the one immortal blemish of mankind.
- -- Fredrich Nietzsche
-%
-I call it the "Madman Theory". I want the North Vietnamese to believe that
-I've reached the point where I might do *anything* to stop the war. We'll
-just slip the word to them that "For God's sake, you know, Nixon is obsessed
-about Communism. We can't restrain him when he's angry -- and he has his
-hand on the nuclear button."
- -- Richard M. Nixon
-%
-I came; I saw; I fucked up.
-%
-I can feel for her because, although I have never been an Alaskan prostitute
-dancing on the bar in a spangled dress, I still get very bored with washing
-and ironing and dishwashing and cooking day after relentless day.
- -- Betty MacDonald
-%
-I can understand companionship. I can understand bought sex in the
-afternoon. I cannot understand the love affair.
- -- Gore Vidal
-%
-I can't quite put my finger on it, but something about you pisses me off.
- -- Peter Knight
-%
-I choked Linda Lovelace.
-%
-I continued wetting my bed for a long time, not just out of contrariness,
-but to have the pleasure of feeling my warm urine running down my legs
-and wallowing in its odor.
- -- Salvador Dali
-%
-I did not look behind me, 'till I got to St. Omer's & thence fled to America;
-here I offer'd to become a Spy for the English Government which was scornfully
-rejected; I then turned to Plunder & Libel the Yankees, for which I was fined
-5000 Dollars & kicked out of the Country! I came back to England (after
-absconding for Seven years) & set up the Crown & Mitre to establish my Loyalty!
--- accepted from the Doctor L400 to print & disperse a pamphlet against "the
-Hellfire of Reform" ... but applied the Money to purchase an estate at Botley,
-& left ye Doctor to pay the Paper & Printing! Being now Lord of the Manor, I
-began by sowing the seeds of discontent through Hampshire; I oppressed the
-Poor, sent the Aged to Hell, & damned the eyes of my Parish Apprentices before
-they were open'd in the morning! ... and being now supported by a Band of
-Reformers, I renewed my old favorite Toast of Damnation to the House of
-Brunswick! & being exalted by the sale of 10,000 Political Registers every
-week, I find myself the greatest Man in the World! except that Idol of all my
-Adorations, his Royal and Imperial Majesty, NAPOLEONE!
- -- William Cobbett, British journalist
-%
-I dined with Lord Hughing Fitz-Bluing
-Who said, "Do you squirm when you're screwing?"
- I replied, "Simple shagging
- Without any wagging
-Is only for screwing canoeing."
-%
-"I do love a lay every day,
-So whenever you're coming this way
- Just phone in advance
- And I'll jerk off my pants,
-And we're set for a sexy soiree!"
-%
-I don't care who you are, Fatso. Get those reindeer off my roof.
-%
-I don't discriminate on the basis of sex.
- -- Bisexuality, 101
- [An equal opportunity lover? Ed.]
-%
-I don't give a shit what happens. I want you all to stonewall it. Let
-them plead the Fifth Amendment, cover up, or anything else if it'll save
-the plan.
- -- Richard M. Nixon
-%
-I don't know why women get so upset, they have half the
-money and all the pussy.
- -- Gary Bussy, "DC Cab"
-%
-I don't love you, asshole, I love your daughter.
- -- The Undergraduate
-%
-I Don't Mind If You Lie to Me, As Long As I Ain't Lyin' Alone
-I Wouldn't Take You to a Dog Fight Even If I Thought You Could Win
-If You Leave Me, Walk Out Backwards So I'll Think You're Comin' In
-Since You Learned to Lip-Sync, I'm At Your Disposal
-My John Deere Was Breaking Your Field, While Your Dear John Was
- Breaking My Heart
-Don't Cry, Little Darlin', You're Waterin' My Beer
-Tennis Must Be Your Racket, 'Cause Love Means Nothin' to You
-When You Say You Love Me, You're Full of Prunes, 'Cause Living
- With You Is the Pits
-I Wanted Your Hand in Marriage but All I Got Was the Finger
- -- proposed Country-Western song titles from "Wordplay"
-%
-"I don't really mind her being unfaithful," sighed the man to his
-marriage counselor, "but I just can't sleep three in a bed."
-%
-I don't remember ever having had the itch, and yet scratching is
-one of nature's sweet pleasures, and so handy.
-%
-I don't understand what all the fuss was about in Los Angeles.
-It's not like we looted Brooks Brothers when Oliver North got off.
- -- P.J. O'Rourke
-%
-I don't want to say that she had big tits, but one day I asked her
- just how big they was, and she said, "7 and 7/8".
-I said, "7 and 7/8?! What did you measure 'em with?"
-And she replied, "A Stetson."
-%
-"I finally found out what my ranch foreman husband really meant,"
-sobbed the recent bride, "when he told me he'd love me 'til the
-cows came home."
-%
-I grew up in an Italian family, you know, the strange thing about
-Italians -- they're so Jewish.
- -- Kay Ballard
-%
-I had a dream that all the victims of The Pill came back...
-boy, were they mad!
- -- Steven Wright
-%
-I had a virgin once. I had to go to Florida for her. She was twelve
-years old, blind in one eye, and carried a stuffed alligator labeled
-"Made in Taiwan".
- -- The Stunt Man
-%
-I have a funny daddy
-Who goes in and out with me
-And everything that baby does
-Daddy's sure to see,
-And everything that baby says,
-My daddy's sure to tell.
-You _m_u_s_t have read my daddy's verse.
-I hope he fries in Hell.
- -- Ogden Nash
-%
-"I have credit with this madam who runs a string of super callgirls,"
-the executive reminisced at his club bar, "but when I got the bill for
-the great head session one of them pleasured me with, I must say that
-it was enough to make a blown man cry."
-%
-I have just enough white in me to make my honesty questionable.
- -- Will Rogers
-%
-I have perfumed my bed with myrrh, aloes, and cinnamon. Come, let us
-take our fill of love until the morning.
- -- Proverbs 7:17-18
-%
-I heard there was a lot of sex on television these days,
-but when I tried it I kept falling off.
-%
-I knew Leo G. Carrol
-Was over a barrel
-When Tarantula took to the hills. ["Lick it!"]
-And I really got hot
-When I saw Jeanette Scott
-Fight a triffid that spits poison and kills.
-
-Science fiction, double feature
-Doctor X will build a creature.
-See androids fighting Brad and Janet
-Anne Francis stars in Forbidden Planet
-Oh Oh Oh Oh Oh
-At the late night, double feature, picture show.
- -- The Rocky Horror Picture Show
-%
-I know a Polack his name is Cliff,
-Hey-la-de-la-de-la.
-He sticks it in the freezer to get it stiff,
-Hey-la-de-la-de-lo.
-
-I know a girl, her name is Serafina,
-Hey-la-de-la-de-la.
-She'll get down on all fours for a bowl of Purina,
-Hey-la-de-la-de-lo.
-
-I know a girl, her name is Cuffy,
-Hey-la-de-la-de-la.
-She douches with Tide and makes her pubes fluffy,
-Hey la-de-la-de-lo.
- -- Doctor Dirty
-%
-I know of a fortunate Hindu
-Who is sought in the towns that he's been to
- By the ladies he knows,
- Who are thrilled to the toes
-By the tricks that he makes his foreskin do.
-%
-I know what you're up to, you white-feathered fiend!
-Go release your bowels on some lesser personage!
- -- W. C. Fields, upon seeing a bird overhead
-%
-I know why the sun never sets on the British Empire -- God wouldn't trust
-an Englishman in the dark.
- -- Duncan Spaeth
-%
-I love this fucking University, and this University loves fucking me.
-%
-I married an Italian girl; the way you marry an Italian girl in my family
-is to bring a New Yorker home first.
-%
-I met a young man in Chungking
-Who had a very long thing --
- But you'll guess my surprise
- When I found that its size
-Just measured a third-finger ring!
-%
-I never believed in Santa Claus because I knew no white dude would come
-into my neighborhood after dark.
- -- Dick Gregory
-%
-I never did give anybody hell. I just told the truth and they thought
-it was hell.
- -- Harry S. Truman
-%
-I never had Miss Defauw,
-But it wouldn't have been quite so raw
- If she'd only said "No"
- When I wanted her so;
-But she didn't -- she laughed and said "Naw!"
-%
-I never met a woman I couldn't drink pretty.
-%
-I never trust a man unless I've got his pecker in my pocket.
- -- Lyndon B. Johnson
-
-I've got Hubert's pecker in my pocket.
- -- Lyndon B. Johnson
-%
-I once had the wife of a Dean
-Seven times while the Dean was out skiin'.
- She remarked with some gaiety,
- "Not bad for the laiety,
-Though the Bishop once managed thirteen."
-%
-I once met a lassie named Ruth
-In a long distance telephone booth.
- Now I know the perfection
- Of an ideal connection
-Even if somewhat uncouth.
-%
-I once was annoyed by a queer
-Who made his intentions quite clear.
- Said I, "I'm no prude,
- So don't think me rude,
-But I'm already stewed, screwed, and tattooed."
-%
-I only date queers.
- -- Bisexuality, 101
- [I'm not queer, but my boyfriend is! Ed.]
-%
-I own my own body, but I share.
-%
-I played over the music of that scoundrel Brahms. What a giftless
-bastard! It annoys me that this self-inflated mediocrity is hailed
-as a genius. Why, in comparison with him, Riff is a genius.
- -- Tchaikovsky, October 9, 1886, diary entry
-%
-I realize that today you have a number of top female athletes such as
-Martina Navratilova who can run like deer and bench-press Chevrolet
-trucks. But to be brutally frank, women as a group have a long way to
-go before they reach the level of intensity and dedication to sports
-that enables men to be such incredible jerks about it.
- -- Dave Barry, "Sports is a Drag"
-%
-I regret to say that we of the F.B.I. are powerless to act in cases of
-oral-genital intimacy, unless it has in some way obstructed interstate
-commerce.
- -- J. Edgar Hoover
-%
-I shot a query into the net.
-I haven't got an answer yet, A posted message called me rotten
-But seven people gave me hell For ignoring mail I'd never gotten;
-And said I ought to learn to spell; An angry message asked me, Please
- Don't send such drivel overseas;
-A lawyer sent me private mail
-And swore he'd slap my ass in jail -- One netter thought it was a hoax:
-I'd mentioned Un*x in my gem "Hereafter, post to net dot jokes!";
-And failed to add the T and M; Another called my grammar vile
- And criticized my writing style.
-Each day I scan each Subject line
-In hopes the topic will be mine;
-I shot a query into the net.
-I haven't got an answer yet...
- -- Ed Nather
-%
-I think any man in business would be foolish to fool around
-with his secretary. If it's somebody else's secretary, fine.
- -- Barry Goldwater
-%
-I think every good Christian ought to kick Falwell right in the ass.
- -- Barry Goldwater
-%
-I think pop music has done more for oral intercourse than anything else
-that has ever happened, and vice versa.
- -- Frank Zappa
-%
-I think the Mormon prophet
-Was a very funny man.
-I wonder how his wives enjoyed
-His Prophet Sharing Plan.
-%
-I thought Jackie O. was something you did in the bathroom.
- -- Strange de Jim
-%
-I walked on toward Ploughwright, thinking about feces. What a lot we
-had found out about the prehistoric past from the study of fossilized
-dung of long-vanished animals. A miraculous thing, really; a recovery
-from the past from what was carelessly rejected. And in the Middle
-Ages, how concerned people who lived close to the world of nature were
-with the feces of animals. And what a variety of names they had for
-them: the Crotels of a Hare, the Friants of a Boar, the Spraints of
-an Otter, the Werderobe of a Badger, the Waggying of a Fox, the Fumets
-of a Deer. Surely there might be some words for the material so near
-to the heart of Ozy Froats [an academic studying feces] than shit?
-What about the Problems of a President, the Backward Passes of a
-Footballer, the Deferrals of a Dean, the Odd Volumes of a Librarian,
-the Footnotes of a Ph.D., the Low Grades of a Freshman, the Anxieties
-of an Untenured Professor?
- -- Robertson Davies, "The Rebel Angels"
-%
-I want a girl that can swallow my pride.
- -- Frank Zappa, "Jewish Princess"
-%
-I want the same things all men do, Rice Krispies and some sucking.
- -- Dudley Moore
-%
-I was 15 years old before I found out that "damn yankee" was two words.
-%
-I was a cock-teaser at Rooster Rama.
-I used to enrage the bantams before the big bouts.
- -- The Firesign Theatre
-%
-I was having sex just the other night, but she hung up.
-%
-I was on vacation in Greece last summer, and was being driven round an island
-by a Greek cab-driver. He was a friendly man, and as we drove, he told me
-about various historic and scenic places he had been involved with.
- "See the entrance to that church over there? I built that with my
-two sons. But do they call me `Dimitri the church builder?' Do they hell!"
- As we passed a dam, he said, "See that dam? Four of us built that
-dam by ourselves! But do they call me `Dimitri the dam builder?' Hell, no!"
- As we passed a beautiful cottage, Dimitri started up again -- "See
-that house? I built that for my wife with my own two hands! But do they
-call me `Dimitri the home builder?' No! But just one little sheep!"
-%
-I went to a wild party last night. I tell ya, it was so wild, we played
-a new version of Russian roulette. We passed around six girls and one
-of them had V.D.
- -- Rodney Dangerfield
-%
-I wish I was a fascinating lady
-With a past that was cheap and a future that was shady
-I'd sleep all day and I'd work all night
-I'd live in a house with a little red light
-And once a month I'd take a small vacation
-And leave all the men to their imagination
-And once in a while I'd go all wild
-And have myself an illegitimate child
-I wish I were a fascinating lady
-Instead I'm the minister's child
-%
-I wish that my room had a floor;
-I don't so much care for a door,
- But this walking around
- Without touching the ground
-Is getting to be quite a bore!
- -- Gelett Burgess
-%
-I wonder what my wife will want tonight;
-Wonder if the wife will fuss and fight?
- I wonder can she tell
- That I've been raising hell;
-Wonder if she'll know that I've been tight?
-
-My wife is just as nice as can be,
-I hope she doesn't feel too nice toward me.
- For an afternoon of joy,
- Is hell on the old boy,
-I wonder what the wife will want tonight!
-%
-I wooed a stewed nude in Bermuda,
-I was lewd, but my God! she was lewder.
- She said it was crude
- To be wooed in the nude--
-I pursued her, subdued her, and screwed her!
-%
-I would like to say, Mister Bunce,
-I'm a great connoisseur of hot cunts.
- And in all my lewd life
- I've met none like your wife,
-So why leave her to me, you big dunce?
-%
-I would like to suggest that you not use speed, and here's why: it is
-going to mess up your heart, mess up your liver, your kidneys, rot out
-your mind. In general this drug will make you just like your mother
-and father.
- -- Frank Zappa
-%
-I wouldn't fuck her with your prick.
-%
-I wouldn't mind dying -- it's that business of having to stay dead that
-scares the shit out of me.
- -- R. Geis
-%
-I'd like to give the world a hug
-And tell it jokes and stuff
-And pull its pants down to its knees
-And chase it through the rough
-
-Then tie it up with bonds and straps
-And search its purse for change
-Then leave it out at Moose Grin Hall
-With our cousin who's deranged ...
- -- National Lampoon, to an old Coke commercial
-%
-I'd like to meet the man who invented sex and see what he's working on
-now.
-%
-I'd like to start a new religion. One that doesn't use a dead young
-man as its logo.
- -- Bill Cain, "Stand Up Tragedy"
-%
-I'd rather have fingers than toes,
-I'd rather have ears than a nose,
- And a happy erection
- Brought just to perfection
-Makes me terribly sad when it goes.
-%
-I'd walk a mile for a Camel, two for a hump.
-%
-If a child annoys you, quiet him by brushing his hair. If this doesn't
-work, use the other side of the brush on the other end of the child.
-%
-If all these sweet young things were laid end-to-end, I wouldn't be a
-bit surprised.
- -- Dorothy Parker
-%
-If anyone wants to trade a couple of centrally located, well-cushioned
-showgirls for an eroded slope 90 minutes from Broadway, I'll be on this
-corner tomorrow at 11 with my tongue hanging out.
- -- S. J. Perelman
-%
-If being bi increases your chance of getting a date,
-does being poly increase your chance of getting dumped?
-%
-If clear thinking created sparks, we could safely store dynamite in
-James Watt's office.
- -- Wayne Shannon, KRON-TV
-%
-If continence causes neurosis
-And intercourse causes thrombosis
- I'd rather expire
- Fulfilling desire
-Than live in a state of psychosis.
-%
-If girls are all sugar and spice, why do they taste like anchovies?
-%
-If God doesn't destroy San Francisco,
-He should apologize to Sodom and Gomorrah.
-%
-If God had meant for Texans to ski he would have made bullshit white.
-%
-If God had meant for us to have group sex, he'd have given us more organs.
- -- Malcolm Bradbury
-%
-If God had wanted people to give blow
-jobs, he wouldn't have given them teeth.
-%
-If God had wanted us to use the metric system, Jesus would have had 10
-apostles.
-%
-If God hadn't intended man to eat pussy,
-would He have made it look like a taco?
-%
-If guns are outlawed, how will we shoot the liberals?
-%
-If Helen Keller is alone in a forest and falls, does she make a sound?
-%
-If I could reach, I'd never leave the house.
- -- George Carlin
-%
-If I had a penis I'd wear it outside,
-In cafes and car lots, with pomp and with pride.
-If I had a penis I'd pamper it proper
-I'd stay in the tub and use me as the stopper.
-If I had a penis I'd take it to parties
-Stretch it and stroke it and shove it at smarties.
-I'd take it to pet shows and teach it to stay.
-I'd stuff it in turkeys on Thanksgiving Day.
-
-I'd rival my buddies in sportscars and stick shifts.
-I'd shower my spire with girlies and gifts.
-I'd peek around corners; I'd aim at my toilet;
-I'd poke it at foreigners and soap it and oil it.
-If I had a penis I'd run to my mother;
-Comb out the hair and compare it to brother.
-I'd lance her, I'd knight her, my hands would indulge...
-Pants would seem tighter and buckle and bulge.
-[Chorus]
- A penis to plunder, a penis to push
- 'Cause one in the hand is worth one in the bush.
- A penis to love me, a penis to share,
- To pick up and play with when nobody's there.
- -- Uncle Bonsai, "Penis Envy"
-%
-If it flies, floats or fucks, rent it, don't buy it.
- -- Tommy Earl Bruner
-%
-If it weren't for pickpockets, I'd have no sex life at all.
- -- Rodney Dangerfield
-%
-If it's not one thing, it's a mother.
-%
-If Jesus Christ came to this town, people would say, great guy; terrible
-carpenter.
- -- Gene Kirkwood, on Hollywood
-%
-If life's a piece of shit, Calculus III is the spoon.
-%
-If men could get pregnant, abortion would be a sacrament.
-%
-If men couldn't fuck there'd be a bounty on their heads.
-%
-If only is was as easy to banish hunger by rubbing the belly as it is to
-masturbate.
- -- Diogenes the Cynic
-%
-If Presidents don't do it to their wives, they do it to the country.
- -- Mel Brooks
-%
-If Reagan is the answer, it must have been a VERY silly question.
-%
-If someone were to ask me for a short cut to sensuality, I would
-suggest he go shopping for a used 427 Shelby-Cobra. But it is only
-fair to warn you that of the 300 guys who switched to them in 1966,
-only two went back to women.
- -- Mort Sahl
-%
-If the American dream is for Americans only, it will remain our dream
-and never be our destiny.
- -- Ren'e de Visme Williamson
-%
-If they can't take a joke, then fuck 'em.
-If they can, then fuck 'em.
-%
-If thine eye offends thee, pluck it out.
-If thy dick offends thee, whack it off.
-%
-If women ran the military complex, would the missiles be shaped differently?
-%
-If you can believe ten impossible things before breakfast, then you
-should join
-
- THE CHURCH OF COUNTERFACTUAL BELIEF
-
-The Church of Counterfactual Belief has been set up to cater to all who
-don't allow demonstrable truth to get in the way of their beliefs. In
-addition to creation science and the flatness of the earth, the
-following beliefs have been certified by Pope Duane as Church dogma:
-
- -- That there is a hole in the Earth at the North Pole from which
- UFOs come.
- -- That pi equals precisely 3.000.
- -- That sex can be enjoyed only by blacks and homosexuals.
- -- That Billy Joe Wilson (Hoopla, Miss.) has successfully squared
- the circle.
- -- That Harry Truman is still president, and doing a fine job.
- -- That pi equals precisely 22/7.
-
-Several other important counterfactual beliefs are presently being
-studied, including Reaganomics, A.I., and that the moon landings were
-done in a Hollywood special effects studio. These will be the subject
-of a forthcoming Papal Bull ...
-%
-If you could get an erection, you would have no need for Emacs.
-%
-If you don't ride a camel to work, you ain't Sheeite.
-%
-If you find for your verse there's no call,
-And you can't afford paper at all,
- For the true poet born,
- However forlorn,
-There is always the lavat'ry wall.
-%
-If you guys have a beef with her, that's her problem. Don't lay it on
-me. The old lady has to take care of her own weight.
- -- Herbie Sperling, convicted heroin dealer, on being
- arrested for narcotics possession at his mother's house.
-%
-If you live in New York, even if you're Catholic, you're Jewish.
- -- Lenny Bruce
-%
-If you meet somebody who tells you that he loves you more than anybody
-in the whole wide world, don't trust him. It means he experiments.
-%
-If you think sex is a pain in the ass, try a different position.
-%
-If you were attacked by a homosexual, would you beat him off?
-%
-If your thesis is utterly vacuous,
-Employ first-order predicate calculus.
- With sufficient formality,
- The sheerest banality,
-Will be hailed by all as miraculous!
-%
-If you're a real good kid, I'll give you a piggy-back ride on a
-buzz-saw.
- -- W. C. Fields
-%
-If you're Catholic you've only got two choices: periodic
-abstinence and complete continence; (you know, rhythm and blues).
-%
-If you're going to break up with your old lady and you live in a small
-town, make sure you don't break up at three in the morning. Because you're
-screwed -- there's nothing to do ... So make it about nine in the morning,
-... bullshit around, worry her a little, then come back at seven in the
-night.
- -- Lenny Bruce
-%
-If you're gonna sleep with someone whose moral code may be written
-in Fortran for all you know, at least make sure there's an existing
-friendship of some sort to fall back on if things don't work out
-like one or the other of you planned.
-%
-If you're really into astrology, tell me, what happens
-when Mercury is in the Fish, and Jupiter enters the Virgin?
-%
-If you're speaking of actions immoral
-The how about giving the laurel
- To doughty Queen Esther,
- No three men could best her --
-One fore, and one aft, and one oral.
-%
-Ignorance is the Mother of Devotion.
- -- Robert Burton
-%
-Il y a une jeune fille amoureuse
-D'un homme qu'a une conduite honteuse;
- Il la mene chaque soir
- A son caveau noir
-Et la bat avec plaintes crapuleuses.
- -- Edward Gorey
-%
-Il y avait un jeune homme de dijon,
-Qui n'avait que peu de religion.
- Il dit:"quant a' moi,
- Je deteste tous les trois,
-Le pere, et le fils, et le pigeon-"
-%
-Il y avait un plombier, Francois,
-Qui plombait sa femme dans le Bois.
- Dit-elle, "Arretez!
- J'entends quelqu'un venait."
-Dit le plombier, en plombant, "C'est moi."
-%
-Il y avait une madame de Lahore
-Dont la figure n'etait la meilleure,
- Mais la vagine tres forte,
- Toujours ouverte la porte,
-Encore, et encore, et encore.
-%
-I'm a bisexual; I get it maybe twice a year.
- -- Rodney Dangerfield
-%
-I'm a gay man trapped in a lesbian's body!
- -- The Queer Gospels of Madonna the Sloppily Conceived
-%
-I'm a lover not a dancer!
-I'm a lover not a dancer!
-Don't want to be on my feet,
-When I can be on my back,
-Don't want to be on the floor,
-When I can be in the sack!
-I'm a lover not a dancer!
-I'm a lover not a dancer!
-I'm just a little bit tired
-If you know what I mean,
-Don't want to be in a crowd
-When I can be in a dream!
-I'm a lover not a dancer!
-Baby!
-And, baby, let me prove it to you,
-Baby, let me prove it to you!
- -- Jim Steinman, "Dance in my Pants"
-%
-I'm against group sex because I wouldn't know where to put my elbows.
- -- Martin Cruz Smith
-%
-I'm for peace -- I've yet to see a man wake up in the morning and say
-"I've just had a good war."
- -- Mae West
-%
-I'm glad we don't have to play in the shade.
- -- Golfer Bobby Jones on being told that it was 105 degrees
- in the shade.
-
-Very few blacks will take up golf until the requirement for plaid pants is
-dropped.
- -- Franklyn Ajaye
-%
-I'm going to Iowa for an award. Then I'm appearing at Carnegie Hall,
-it's sold out. Then I'm sailing to France to be honored by the French
-government -- I'd give it all up for one erection.
- -- Groucho Marx
-%
-I'm never through with a girl until I've had her three ways.
- -- J.F. Kennedy
-%
-I'm not a pheasant plucker,
-I'm a pheasant plucker's son.
-I'm just a'plucking pheasants
-'Til the pheasant plucker comes.
- -- The Irish Rovers
-%
-I'm not against women. Not often enough, anyway.
- -- NPR
-%
-I'm not laughing behind your back; everything funny is in front!
- -- Rodney Dangerfield's wife
-%
-I'm So Miserable Without You It's Almost Like Having You Here
- -- Song title by Stephen Bishop
-
-She Got the Gold Mine, I Got the Shaft
- -- Song title by Jerry Reed
-
-When My Love Comes Back from the Ladies' Room Will I Be Too Old to Care?
- -- Song title by Lewis Grizzard
-
-I Don't Know Whether to Kill Myself or Go Bowling
- -- Unattributed song title
-
-Drop Kick Me, Jesus, Through the Goal Posts of Life
- -- Unattributed song title
-%
-I'm sorry I'm late folks, I just got out of jail. I tried to change my
-girlfriend's name. Yeah, I went down to the hall of records. I said, "I'd
-like to change it... I'd like to change it to... LYING LITTLE BITCH!"
- -- Sam Kinison
-%
-I'm unbuttoning your shirt, unzipping your jeans ...
-
-Oh, I can feel your fingers on the keys, baby,
- I'm getting WARM ...
-
-I am getting there, oh yes,. Oh, my. OH YES... OHHHH!
- ...!!!rrrrrgh!!!!!
-
-Honey, that was *really* terrific, but, next time,
-couldn't you please input a little SLOWER?
-%
-Immanuel Kant was a real pissant who was very rarely stable.
-Heidegger, Heidegger was a boozy beggar who could think you under the table.
-David Hume could out-consume Schopenhauer and Hegel,
-And Wittgenstein was a beery swine who was just as schloshed as Schlegel.
-There's nothing Nietzsche couldn't teach ya 'bout the raising of the wrist.
-Socrates, himself, was permanently pissed!
-
-John Stuart Mill, of his own free will,
-On half a pint of shandy was particularly ill.
-Plato, they say, could stick it away, half a crate of whiskey every day.
-Aristotle, Aristotle was a bugger for the bottle,
-Hobbes was fond of his dram,
-And Rene Descartes was a drunken fart: "I drink, therefore I am".
-Yes, Socrates, himself, is particularly missed;
-A lovely little thinker but a bugger when he's pissed!
- -- Monty Python, "The Philosopher's Drinking Song"
-%
-Impotent loser, n.:
- Someone who can't even get his hopes up.
-%
-In 1953, Stalin dies. The politburo holds a special meeting to decide
-what to do about the body. Nobody will let it be buried near their home.
-Finally they decide:
- "Aha! Call Israel! Offer them ten million rubels; they'll let us
-bury Stalin in Israel! Off goes the message and the politburo waits...
-Finally a telegram comes back:
- "NO CHANCE STOP ONE RESURRECTION HERE ALREADY"
-%
-In a recent survey on why some men are homosexual, 82 percent of the gay
-chaps responding said that either genetics or home environment was the
-principal factor. The remaining 18 percent revealed that they had been
-sucked into it.
-%
-In bed Dr. Oscar McPugh
-Spoke of Spengler -- and ate crackers too.
- His wife said, "Oh, stuff
- That philosophy guff
-Up your ass, dear, and throw me a screw!"
-%
-In Christianity neither morality nor religion come into contact with
-reality at any point.
- -- Friedrich Nietzsche
-%
-In cosmetics, there's cases of revolutionary Venus Envy Hair Spray;
-Legette Hair Fastener Heat Bags; Lady O' Spain Self-Blinding Eye Shadow
-with Magic Puncture Pencil; Sanitary Napkin Rings in Little Miss, Moon
-Maid and Stuck Pig Strength; and deported Italian Napagel Balls for
-soaking or eating; and they're all slash-priced with the lady in mind...
- -- The Firesign Theatre
-%
-In days of old, when knights were bold,
- And rubbers weren't invented,
-They tied their socks around their cocks
- And babies were prevented.
-%
-In Duluth there's a hostess, forsooth,
-Who doesn't know gin from vermouth,
- But this lubricant lapse
- Isn't noticed, perhaps
-Because nobody does in Duluth.
-%
-In France they piss on Main Street
-(In pissoirs, Mama, not cheap display).
- -- Joni Mitchell
-%
-In light of the New Morality, Playboy Inc. is offering a new version of
-its magazine, for married men. Every month it has the same centerfold.
-%
-In my sweet little Alice Blue gown
-Was the first time I ever laid down,
- I was both proud and shy
- As he opened his fly
-And the moment I saw it I thought I would die.
-
-Oh it hung almost down to the ground,
-As it went in I made not a sound,
- The more that he shoved it
- The more that I loved it,
-As he came on my Alice Blue gown.
-%
-In my sweet little night gown of blue,
-On the first night that I slept with you,
- I was both shy and scared
- As the bed was prepared,
-And you played peekaboo with my ribbons of blue.
-
-As we both watched the break of day,
-And in peaceful submission I lay,
- You said you adored it
- But dammit, you tore it,
-My sweet little night gown of blue.
-%
-In my world, there are people in chains and we can ride them like ponies.
- -- Evil Willow, Buffy the Vampire Slayer, "Doppelgangland"
- Season 3, Episode 16
-%
-In outer space, nobody can hear you fart.
-%
-In regards to Oral Roberts' claim that God told him that he would die unless
-he received $20 million by March, God's lawyers have stated that their client
-has not spoken with Roberts for several years. Off the record, God has stated
-that "If I had wanted to ice the little toad, I would have done it a long time
-ago."
- -- Dennis Miller, SNL News
-%
-In the Garden of Eden sat Adam,
-Massaging the bust of his madam,
- He chuckled with mirth,
- For he knew that on earth,
-There were only two boobs and he had 'em.
-%
-In the romantic days of Warsaw, Viennese whores were known for their
-beauty and delicacy. A gallant officer picked up one such lady of the
-evening, who took him to her apartment. They made delicious love all
-evening before drifting to sleep in each others' arms. In the morning
-the man dressed, staring into a full-length mirror. The lady lay in her
-bed watching him. Finally, she said softly,
- "Didn't you forget something?"
- "What did I forget?" asked the officer.
- "You forgot about the money," said the lady.
- "Oh, no," said the man, standing at ramrod attention.
-"A Polish officer never accepts money."
-%
-In the shade of the old apple tree
-Where between her fat legs I could see
- A little brown spot
- With the hair in a knot,
-And it certainly looked good to me.
-
-I asked as I tickled her tit
-If she thought that my big thing would fit.
- She said it would do
- So we had a good screw In the shade of the old apple tree
-In the shade of the old apple tree. I got all that was coming to me.
- In the soft dewy grass
-I could hear the dull buzz of the bee I had a fine piece of ass
-As he sunk his grub hooks into me. From a maiden that was fine to see.
- Her ass it was fine
- But you should have seen mine
-In the shade of the old apple tree.
-%
-In the stands here I see a young couple who must be in love -- they're
-kissing on every pitch. He's kissing her on the strikes, and she's
-kissing him on the balls.
- -- Harry Caray, a Chicago sportscaster
-%
-Incest, n.:
- Sibling revelry; a sport the whole family can enjoy.
-%
-Infatuation, n.:
- When you're in love, there's a lump in your throat.
- When you're infatuated, there's a lump in your pants.
-%
-====================
-Inter-Dwarf Memo
-To: Dwarf-list
-From: Doc
-Re: S. White
-
- If that bitch cleans one more thermometer with Ajax, I'm gonna kill
-her. I'll give her apples, nice big apples. With surprises inside. Yeah,
-surprises.
-%
-====================
-Inter-Dwarf Memo
-To: Dwarf-list
-From: Happy
-Re: S. White
-
- Let it be noted that if she whistles that goddamned song one
-more time I'm gonna rip her fuckin' lips off. Have a nice day.
-%
-Is it just me, or does anyone else read "bible humpers" every time
-someone writes "bible thumpers?"
- -- Joel M. Snyder, jms@mis.arizona.edu
-%
-Isn't it odd that people who object to "foul" language are always the
-fucking dickheads that need swearing at?
-%
-Israeli prime minister Shamir invited the Pope to play a round of golf. Since
-the Pope hadn't the faintest of an idea how to play, he convened the college of
-cardinals to ask their advice. "Call Arnold Palmer," they suggested, "make him
-a cardinal and let him play in your place. Tell Shamir you couldn't make it."
- Honored by His Holiness' request, Palmer agreed to represent him.
-When he returned from the match, the Pope asked him how he had done. "I came
-in second," Palmer replied.
- "You mean to tell me Shamir beat you?"
- "No, Your Holiness. Rabbi Nicklaus did."
-%
-It is a sad commentary on today's society that this fortune has to be
-classified as "offensive" simply because it contains the word "fuck".
-%
-It is amusing that a virtue is made of the vice of chastity; and
-it's a pretty odd sort of chastity at that, which leads men straight
-into the sin of Onan, and girls to the waning of their color.
- -- Voltaire
-%
-It is better to have a positive Wasserman than never to have loved at all.
-%
-It is better to have Uranus in Cancer than to have Cancer in Uranus.
-%
-It is considered normal to consecrate virginity in the
-general and lust for its destruction in the particular.
-%
-It is far better to sleep with an old hen than pullet.
-%
-It is impossible to obtain a conviction for sodomy from an English jury.
-Half of them don't believe that it can physically be done, and the other
-half are doing it.
- -- Winston Churchill
-%
-It is not true that life is one damn thing after another -- it is one
-damn thing over and over.
- -- Edna St. Vincent Millay
-%
-It is not wise to make love more than once in the morning.
-You never know who you'll meet later in the day.
-%
-It is one of the superstitions of the human mind
-to have imagined that virginity could be a virtue.
- -- Voltaire
-%
-It is only the man whose intellect is clouded by his sexual impulse that
-could give the name of the fair sex to that undersized, narrow-shouldered,
-broad-hipped, and short-legged race.
- -- Schopenhauer
-%
-It is recounted that at King's College in the Strand around the time of the
-war, the Chief of Services would inevitably begin the year's rounds by
-teaching "a singularly important principle of medicine." He asked a nurse
-to fetch him a sample of urine. He then talked at length about Diabetes
-mellitus. "Diabetes," he said, "is a greek name; but the Romans noticed that
-the bees like the urine of diabetics, so they added the word mellitus which
-means sweet as honey. Well, as you know, you may find sugar in the urine
-of a diabetic ..."
- By now the nurse had returned with a sample of urine which the
-registrar promptly held up like a trophy. We stared at that straw-colored
-fluid as if we had never seen such a thing before. The registrar then
-startled us. He dipped a finger boldly into the urine, then licked his
-finger with the tip of his tongue. As if tasting wine, he opened and closed
-his lips rapidly. Could he perhaps detect a faint taste of sugar? The sample
-was passed on to us for an opinion. We all dipped a finger into the fluid,
-all of us foolishly licked that finger.
- "Now," said the Registrar grinning, "You have learnt the first
-principle of diagnosis. I mean the power of observation." We were baffled.
-We stood near the sluice room outside the ward, and in the distance, some
-anonymous patient was explosively coughing. "You see," the registrar said
-continuing triumphantly, "I dipped my MIDDLE finger into the urine, but
-licked my INDEX finger -- not like all you chaps.
-%
-It is very difficult to look at the possibility of lesbian sheep because
-if you are a female sheep, what you do to solicit sex is to stand still.
-Maybe there is a female sheep out there really wanting another female,
-but there's just no way for us to know it.
- -- Anne Perkins, in her study of sexuality in sheep.
-%
-It may not be funny, but it's damned amusing!
-%
-It must be admitted that we English have sex on the brain, which is a
-very unfortunate place to have it.
- -- Malcolm Muggeridge
-%
-It says he made us all to be just like him. So if we're dumb, then
-god is dumb, and maybe even a little ugly on the side.
- -- Frank Zappa
-%
-It seems that a rabbi, a priest and a minister decided to go fishing one
-sunny afternoon. All three climbed into the boat and headed for the middle
-of the lake. After several hours of relaxation, the minister decided that
-"nature was calling", and climbed out of the boat and walked ashore. In
-a few moments, he walked back out to the boat and climbed back in.
- The rabbi was absolutely astonished, but decided not to mention
-the apparent miracle.
- A few minutes later, the priest also decided to go ashore for a
-moment, and climbed out of the boat, walked to shore, and a few minutes
-later came back.
- By now the rabbi was in great distress and had begun to doubt his
-beliefs and wonder if there might be some validity to the Christian
-teachings. But he immediately reaffirmed the fact that his faith WAS JUST
-AS STRONG as either the priest's or the minister's and decided that anything
-they could do, with God's help, he could do as well.
- The rabbi then announced that he needed relief and would walk to
-shore. He climbed out of the boat and went straight to the bottom of the
-lake. While the rabbi was thrashing about in the water, the priest turned to
-the minister and said, "So... do you think we ought to tell him where the
-rocks are?"
-%
-It seems that a Scotsman and an Irishman walked into a bar. The Scot
-immediately singled out the bartender and proclaimed that drinks were
-on the house, and that he expected him to serve only his best. The next
-day, the headlines read: Irish Ventriloquist Beaten to Death Behind Bar.
-%
-It seems that John gets this phone call:
- "Hello," he answers. The voice on the other end of the line
-is hard and cold.
- "This is Susan," he hears. "We met at a party a few months
-ago.
- "Of course, Susan!", John replies. "How are you?"
- "Not very well. Remember how after the party you took me home and
-we parked? And you told me that I was a 'good sport'? Well, I'm pregnant
-and I'm going to kill myself tonight."
- John is silent for a few moments, collecting his thoughts. "Well,"
-he finally replies, "you sure *are* a good sport."
-%
-It seems that there was this Christian about to be thrown to the lions. He
-was shoved into the middle of the arena and the lion was released. Being
-a good Christian, as the lion approached he knelt and prayed, asking God for
-forgiveness for his (few) sins, and begging that the lion might be dissuaded
-from eating him for its breakfast. Much to his dismay, the lion didn't stop
-but kept coming, getting faster and faster, now almost running, so the
-Christian took off too. There they were, running around and around the arena,
-the lion getting closer and the Christian praying harder and harder between
-gasps for breath. The lions breath was now hot upon his heels and he could
-even feel droplets of the lions saliva splashing on his bare feet. So he
-pulled out all the stops, promising God that if the lion will only spare him,
-he will devote the rest of his life to spreading the Christian faith,
-forsaking all temptation and possessions. Suddenly he no longer felt the
-lions breath, no longer heard the great beast's snarls close behind him.
-Slowing to a stop, he turned around and saw the lion on its knees, eyes rolled
-upward, paws held together. The lion appeared to be muttering something so
-the Christian approached until he could make out what the lion was saying.
- "Dear Lord, for what I am about to receive..."
-%
-It takes a brave man to admit his mistakes.
-Especially in a paternity hearing.
-%
-It takes leather balls to play rugby.
- (Blood makes the grass grow!)
-%
-It takes little strain and no art
-To bang out an echoing fart.
- The reaction is hearty
- When you fart at a party,
-But the sensitive persons depart.
-%
-It used to be a man's world, and the woman's place was in the home.
-They can kiss that shit goodbye.
-%
-It was a female that drove me to drink
-and I didn't even have the kindness to thank her.
- -- R.E. Baber
-%
-It was a Roman who said it was sweet to die for one's country. The
-Greeks never said it was sweet to die for anything. They had no vital
-lies.
- -- Edith Hamilton, "The Greek Way"
-%
-It was a warm, sunny Sunday, and a man and his wife decided to take in the zoo.
-They spent the day, and at closing time they walked past the gorilla cage, and
-the man noticed the gorilla looking at his wife. "That gorilla is getting
-excited just looking at your tits," he said. "Why don't you take your blouse
-off and we'll see what he does?"
- At first she refused. But finally persuaded by her husband, she took
-off her blouse and bra. The gorilla went nuts. He started grunting and
-jumping up and down.
- "Hey," the husband said, "let's really blow his mind. Take off all
-your clothes and we'll see what he does."
- Again she said no and again he persuaded her. This time the ape
-really went bananas! He climbed up and down the bars, did flips, ran around
-in circles and tossed his food all over the cage. The husband went over to
-the cage, opened the door and pushed his wife in.
- "Now," said the husband, "tell that motherfucker you have a headache!"
-%
-It was almost closing time when a male patron who had been getting the
-frosty treatment from a girl at the end of the bar called to the
-bartender and said, "Give that bitchy douche bag over there one on me."
- "We discourage that sort of language here, sir," the bartender
-answered sternly.
- "OK, OK. Serve the lady a cocktail with my compliments."
- The bartender approached the female in question. "The, uh, gentleman
-at the other end of the bar would like to buy you a drink, miss. What would
-you like?"
- "Vinegar and water."
-%
-It was at the eighth annual mouse convention and mice from near and far had
-gathered for the ball. A pretty little female mouse waltzed by the stag
-line and one of the males whistled a low, dirty whistle to himself.
-Turning to another mouse he said, "Look at the legs on that bitch, aren't
-they beautiful?"
- "Just fair," was the answer.
- "You're crazy," said the first mouse and then turning to another,
-asked his opinion.
- "They're nice," said the third mouse, "but nothing to get excited
-about."
- "Some mice have no appreciation," exclaimed the first mouse. "Now
-you," he said to a fourth mouse, "what did you think?"
- "To tell you the truth," was the reply, "I'm no authority on legs;
-I'm a tit mouse myself."
-%
-It was his third marriage and her fourth. He was quite surprised when on
-their honeymoon she pleaded, "Please be gentle, I'm still a virgin."
- "Darling, what do you mean you're still a virgin? You've been
-married three times."
- "Yes, but they all worked for DEC. The first was a salesman,
-and all he ever did was promise how good it would be. The second was one
-of their software hacks, he told me to take care of it myself. And the
-third was a field service representative, and he kept promising that it
-would be up in 15 minutes.
-%
-It was New Year's Eve and the house was brightly decorated with holiday
-trappings. The only sound that broke the quiet was the click of Grandma's
-knitting needles. The children; Jane, eight and Mary, five, were seated
-in front of a cheerily burning fire, leafing through a picture book.
-Tiring of this, they went over to Grandma's rocker. Jane climbed up on
-the arm of the chair and Mary snuggled into Grandma's cozy lap.
- "Tell us a story," begged Mary.
- "Oh," said the old lady, laying aside her knitting and wrapping
-her arms around the children. "What story should I tell you?"
- "Tell us our favorite story," whispered little Jane eagerly.
-"About the time you were a hooker in Chicago."
-%
-It was on the tip of my tongue to tell them about the deer, but I ended up
-not doing it. That was one thing I kept to myself. I've never spoken or
-written of it until just now, today. And I have to tell you that it seems
-a lesser thing written down, damn near inconsequential. But for me it was
-the best part of that trip, the cleanest part, and it was a moment I found
-myself returning to, almost helplessly, when there was trouble in my life --
-my first day in the bush in Vietnam, and this fellow walked into the clearing
-where we were with his hand over his nose and when he took his hand away there
-was no nose there because it had been shot off; the time the doctor told us
-our youngest son might be hydrocephalic (he turned out just to have an
-oversized head, thank God); the long crazy weeks before my mother died. I
-would find my thoughts turning back to that morning, the scuffed suede of
-her ears, the white flash of her tail. But eight hundred million Red Chinese
-don't give a shit, right? The most important things are the hardest to say,
-because words diminish them. It's hard to make strangers care about the
-good things in your life.
- -- Stephen King, "The Body"
-%
-It was the first day of a new term at Princeton, and a Texas A&M freshman
-was learning his way around the campus. Stopping a distinguished looking
-upperclassman, he inquired,
- "Say, buddy, can you tell me where the library is at?"
- "My good fellow," came the reply, "at Princeton we do not end our
-sentences with a preposition."
- "All right," said the freshman, "can you tell me where the library
-is at, asshole?"
-%
-It was this guy's first day in the penitentiary; he was in a cell with a
-huge burley inmate, and he was pretty nervous. At lights-out, the inmate
-jumped out of his bunk, and, turning to our hero, said, "We're going to
-have sex! You want to be the Mommy or the Daddy?"
- A very terrified hero managed to squeak out, "Uh, well, uh, I guess
-I'll be the Daddy."
- "OK," smiled his roommate, "get down here and suck your Momma's dick!"
-%
-It's a bit hard to bullshit the ocean. It's not listening, you know
-what I mean.
- -- David Crosby
-%
-It's a bitch being butch.
-%
-It's a funny thing that when a woman hasn't got anything
-on earth to worry about, she goes off and gets married.
-%
-It's a question of Napoleon brandy versus Ripple.
-I am mellow and amber and I go down real smooth.
- -- Rita Moreno, commenting in Newsweek on the sex appeal
- of older women versus younger women
-%
-"It's always the same," the girl sighed to her roommate after returning
-in the wee, small hours. "Afterward, I feel so compromised, so cheap, so
-soiled... so absolutely wonderful from head to toe!"
-%
-It's been so long since I made love I can't even remember who
-gets tied up.
- -- Joan Rivers
-%
-It's better to be pissed off than pissed on.
-%
-It's hard to keep a good girl down -- but lots of fun trying.
-%
-It's midnight. The old man is awake, nervously pacing the floor, as his
-20-year-old son comes in.
-
- "Whatta you mean? You staya out alla night, you runna around widda
-bums. Whatta you trying to do?"
- "Papa, don't talk like that," replies the boy.
- "Who-a you, tella me notta talka like that? You no work, you
-chase-a bad women, whatta become of you?"
- "Papa, *please* don't talk like that."
- "Don'ta talka like that? Whatta you mean? Why shouldn't I talka
-likka that?"
- "Papa, we're not Italian."
-%
-It's not a sin not to be Irish, but it is a great shame.
- -- Sean O'Huiginn
-%
-It's not pretty being easy.
-%
-It's not the ups and downs of love, it's the ins and outs.
-%
-It's so fuckin' great to be alive!
-%
-It's the sighs that count.
-%
-I've been feeling kind of jealous,
-Of all them well-hung fellas,
-Like Michael, Rod, and Mick. It would have to be a big one,
-Tell me, Doctor can you mend me? A giant, horny love gun,
-I've a case of penis envy -- To let me be a jock.
-If I only had a dick. Girls would never beg my pardon,
- They would turn on to my hardon --
- If I only had a cock.
-Oh, I can tell you now,
-The number of times I'd score,
-I could fuck girls like I would not be just a housewife,
- I never have before, Living a little mouse-life
-And then I'd cum (wee!) In days that drag out long.
-And fuck some more! I would dance and I'd be merry
- Life would be a ding-a-derry
- If I only had a dong!
- -- to "If I Only Had A Brain", The Wizard of Oz
-%
-I've been told that it's far more sensuous to have a woman leave something
-on rather than being totally nude. Myself, I've always felt that the lights
-were more than enough.
-%
-I've been watching you closely to see if you have been good this year;
-and since you have, I will be telling my elves to make some goodies for me
-to leave under your tree on Christmas. I was going to bring you all the
-gifts from the twelve days of Christmas, but we had a little problem up here.
-The twelve fiddlers fiddling have all come down with V.D. from fiddling with
-the ten ladies dancing, the eleven lords-a-leaping have knocked up the eight
-maids-a-milking, and the nine pipers piping have been arrested for doing
-weird things to the seven swans-a-swimming and the six geese-a-laying. The
-four calling birds, three French hens, two turtle doves, and the partridge
-in the pear tree have me up to my ass in birdshit. On top of all this, Mrs.
-Claus is going through menopause, eight of my reindeer are in heat, the elves
-have joined gay liberation, and those dumb ass Polacks have scheduled
-Christmas for the fifth of February. I'll do what I can.
- Sincerely,
- Santa
-%
-I've finally found the perfect girl,
-I couldn't ask for more,
-She's deaf and dumb and over-sexed,
-And owns a liquor store.
-%
-I've got my ANSI C Reference book right here but it doesn't say anything
-about getting raped in the ass as part of the official C language (maybe
-I should get a C++ reference manual).
- -- Deuce, Jerk City
-%
-I've had one child. My husband wants to have another. I'd like to
-watch him have another.
- -- Rita Rudner
-%
-Jack an Jill went up the hill.
-Jill went down,
-Jack came.
-%
-Jack and Jill went up a hill
-To fetch a pail of water.
-Jack fell down and broke his crown Jack on Jill produced a thrill
-And Jill came tumbling after. When on the ground he got her,
- Then went down and told the town
- He tumbled Jill and gaffed her.
-Jack to Jill thus did such ill
-That Jill, to pay the rotter,
-Told the town Jack's crown broke down Jack and Jill have split the bill
-When he set out to shaft her. Since Jack led Jill to totter.
- Half the town deals Jill a frown
- And half greets Jack with laughter.
-%
-Jack and Jill went up the hill
-Each had a buck and a quarter.
-Jill came down with two-fifty
-That fuckin' whore.
- -- Andrew "Dice" Clay
-%
-Jack be nimble, Jack be quick.
-Jack jumped over the candle stick,
-And burnt his balls.
-%
-Jack be nimble, Jack be quick,
-Jack jumped over the candle stick.
-But Jack wasn't so nimble,
-Jack wasn't so quick,
-So Jack's in the hospital, with a burned up dick!
-%
-Jehovah is an alien and still threatens this planet!
-%
-Jesus died for your sins. Make it worth his time.
-%
-Jesus has just stopped the crowd from stoning Mary Magdalene to death
-and is berating the self-pious with the famous speech, "Let the one
-among you who is without sin cast the first stone..."
- Right about then, a rock comes winging through the air and hits
-Jesus upside the head. He whirls around and shouts "Alright, Mom, c'mon!
-I'm trying to make a point, here!"
-%
-Jesus loves you, but everybody else thinks you're a dork.
-%
-Jesus may love you, but I think you're garbage wrapped in skin.
- -- Michael O'Donohugh
-%
-Jesus Never Fails
-
-(He's never taken the Massachusetts Bar Exam, either.)
-%
-Jesus saves... but Gretzky gets the rebound!
- -- Daniel Hinojosa
-%
-Jesus Saves,
-Moses Invests,
-But only Buddha pays Dividends.
-%
-Jesus was killed by a Moral Majority.
-%
-Jews always know two things: suffering and where to find great Chinese food.
- -- From the movie "My Favorite Year"
-%
-Jimmy Carter, Ted Kennedy, Gary Hart, Joseph Biden and Michael Dukakis were
-on a cruise down the Potomac when the ship struck a rock and began to sink.
- "Gentlemen," Carter said, "as good Christians, we should let the
-women and children aboard the lifeboats first."
- "Fuck the women!" Kennedy shouted.
- "Do we have time?" Hart asked.
- "Do we have time?" Biden asked.
- "Did everyone hear that?" Dukakis asked.
-%
-Joan of Arc is alive and medium well.
-%
-John Birch Society:
- That pathetic manifestation of organized apoplexy.
- -- Edward P. Morgan
-%
-John Paul II is famous for his touring, and his quaint habit of pressing
-his lips to foreign soil on his arrival. This sparked some wit to remark:
- "The Pope has it backwards: he kisses the ground, and walks on
-the women!"
-%
-Johnny Carson's Observation on Geriatrics:
- Sex in the sixties is great, but it improves if you pull
- over to the side of the road.
-%
-Just go with the flow control, roll with the crunches, and, when you get
-a prompt, type like hell.
-%
-Just once I would like to persuade the audience not to wear any article of
-blue denim. If only they could see themselves in a pair of brown corduroys
-like mine instead of this awful, boring blue denim. I don't enjoy the sky
-or sea as much as I used to because of this Levi character. If Jesus Christ
-came back today, He and I would get into our brown corduroys and go to the
-nearest jean store and overturn the racks of blue denim. Then we'd get
-crucified in the morning.
- -- Ian Anderson, of Jethro Tull
-%
-Kansas, where the men are men, the sheep
-are scared and the women are grateful.
-%
-Kasha, n.:
- Kasha is always defined as "buckwheat groats". There's only
- one problem with this definition: what the fuck are "buckwheat
- groats"? *_I* know what they are -- they're kasha. But that
- doesn't help *_y_o_u* much.
- -- Arthur Naiman, "Every Goy's Guide to Yiddish"
-%
-Kerr's Three Rules for a Successful College:
- Have plenty of football for the alumni, sex for the students,
- and parking for the faculty.
-%
-Kill a commie for Christ!
-%
-King Louis gave a lesson in class,
-One time while enjoying a lass.
- When she used the word "Damn"
- He rebuked her: "Please ma'am,
-Keep a more civil tongue in my ass."
-%
-Kissing, petting, and even intercourse are all right as long as they are
-sincere. I have never given a kiss in my life that wasn't sincere. As
-for intercourse, I'd say three times a day was about right.
- -- Margaret Sangor
-%
-Kitten with a whip, Teddy bear in chains, Puss in leather boots,
-tail, swish swish, spread on a bed; rising thigh high;
-take what you will, fantasy games, black rubber suits;
-get what you wish. deep in your head. making him cry.
-
-Squirm from the blows, Now pussy's all hot, Teddy bear sighs;
-writhe from the pain; from the power trip; kitty's on top;
-but teddy bear knows, ready or not, there's fire in her eyes,
-that he wants it again. next swing's from and the cat won't stop.
- the hip.
-
-The world explodes, Teddy's still tied; Kitten with a whip,
-her claws dig in; lying all alone; tail, swish swish,
-then kitty cat goes, even if he tried, take what you will,
-cause she's through he couldn't go home. get what you wish.
- with him.
- -- Kitten With A Whip
-%
-Knowledge Engineering:
-
-A combination of:
-
-Engineering, n.:
- The application of science and mathematics by which the properties
-of matter and the sources of energy in nature are made useful to man in
-structures, machines, products, systems and processes.
-
-and
-
-Knowledge, n.:
- Sexual intercourse.
-
-See also: Prostitution, Grantsmanship.
-%
-Konrad Lorenz, the great animal behaviorist, was scrupulous about cultivating
-fruitful confusion. Lorenz lived among his research subjects: dozens of
-species of mammals, birds, reptiles, and fishes. He did not quantify, control,
-or consciously experiment. He got to know each creature individually, then
-threw them together, watching for the unexpected, the unusual, or the bizarre
-in the chaos that followed. For example, his interest in one of ethology's
-most important concepts, that of intention movements (motions with meaning,
-such as the head bobbing in birds that serves as an alarm signal before
-flight), derived from an inadvertent experiment. He had trained a free-flying
-raven to eat raw meat from his hand and had been feeding the bird for several
-hours one day. He would reach into his pants pocket and take out a piece of
-meat, and the raven would swoop down to grab it in its bill. By and by, Lorenz
-went to relieve himself near a hedge. When the raven saw him put his hand
-into his pants and pull out another morsel of meat, it swooped down, hungrily
-grasping the new mouthful in its bill. Lorenz howled in pain. But the event
-left a deep impression on him -- about how faithfully animals respond to
-intention movements, that is.
- -- The Sciences, May/June, 1988, N.Y. Academy of Science
-%
-Kotex, n.:
- Not the best thing on earth, but next to the best.
-%
-Kumquat, n.:
- Any of several small citrus fruits with sweet spongy rind and
- somewhat acidic pulp that are used chiefly for preserves.
- Extremely popular in some forms of sexual intercourse. In fact,
- an early indication that your partner is willing to experiment
- sexually may be a rather insistent moaning of "kumquat, kumquat"
- during orgasm.
-
- Note: this is *not* to be confused with a warning from your
- partner that his/her parents are upstairs and probably awake.
-%
-Labia majora, n.:
- The curly gates.
-%
-Lady to Golf Pro: "I was stung by bees on your golf course!"
-Pro: "Ummm, well, where?"
-Lady: "Between the 1st and 2nd holes."
-Pro: "That's going to real tough to treat."
-%
-Lagnaf, n.:
- Let's All Get Naked And Fuck!
-%
-Laissez Faire Economics is the theory that if each acts like a vulture,
-all will end as doves.
-%
-Large cats can be dangerous, but a little pussy never hurt anyone.
-%
-"Last night," said a lassie named Ruth,
-"In a long-distance telephone booth,
- I enjoyed the perfection
- Of an ideal connection --
-I was screwed, if you must know the truth."
-%
-Last week I saw a girl in a sweater so tight I could hardly breathe.
-%
-Lawyer, n.:
- Someone who can get a sodomy charge changed to "following too
- closely."
-%
-Lawyers do it to everyone.
-%
-Left a good broad by the river,
-Traveled back into town just to get some rest!
-Waited for 10 hours,
-Went back to the river,
-But I couldn't get her out of that mess!
-
-chorus:
- Poor Mary Jo Kopechne,
- Dead Mary Jo Kopechne,
- Rollin'... rollin'... rollin' down the window!
-
-If you're gonna run for office,
-And you know that it's an election year.
-Don't go in the river,
-'Specially by way of bridges,
-It could put an end to your political career!
-(chorus)
- -- Poor Mary Jo, to the tune of "Proud Mary"
-%
-Lemme show ya the odds, Sparky... In yer country, ya got 14 million
-black people, and 3 million white people. Now, does the name "Custer"
-mean anything to you?
- -- Robin Williams, portraying Lester Maddox talking to
- Prime Minister Botha of South Africa.
-%
-Les salons de la ville de Trieste
-Sont vaseux, suraigus, at funestes;
- Parmi les grandes chaises
- On cause des malaises,
-Des estropiements, et des pestes.
- -- Edward Gorey
-%
-Let a Field Service Engineer put it in.
-%
-LET Jesus be YOUR anchor!
-
-So when Satan rocks your boat, THROW Jesus overboard!
-%
-Liberace was at heaven's gate when Saint Peter told him that he'd been
-disqualified from entering.
- Stunned, Liberace asked, "Why?"
- "Our records show that you once ate a parakeet," Saint Peter answered.
- "I never did that," Liberace replied. "Can't you check your records?
-They *must* be wrong!"
- "It says right here that on August 15, 1981, you ate a chartreuse
-parakeet with black trim."
- "Hey, listen, you must be thinking of Ozzy Osbourne, " Liberace
-replied. "Now, I might have had a cockatoo..."
-%
-LIBRA (Sept 23 - Oct 22)
- You are the artistic type and have a difficult time with
- reality. If you are a man, you are more than likely gay.
- Chances for employment and monetary gains are excellent. Most
- Libra women are prostitutes. All Libra people die of venereal
- disease.
-%
-Lick-a-dee-clit!
-%
-Life is a bitch, but the puppies can be cute.
-%
-Life is a shit sandwich, and every day you get to take another bite.
-It's just that some days are TWO BITE days ...
-%
-Life is having a mother-in-law that sucks and a wife that don't.
- -- Rodney Dangerfield
-%
-Life is like a cucumber -- one moment it's
-in your hand, the next it's up your ass.
-%
-Life is like a penis: when it's soft you can't beat it, and when it's
-hard you get fucked.
-%
-Life is like a shit sandwich. The more bread
-you have, the less shit you have to eat.
-%
-Life is not a cabaret.
-It's a fucking circus.
-%
-Life isn't a bitch. Life is a virgin. A bitch is easy.
-%
-Like private parts to the Gods are we,
-they play with us for their sport.
- -- Lord Melchett (Blackadder 2)
-%
-Limericks are art forms complex,
-Their topics run chiefly to sex.
- They usually have virgins,
- And masculine urgin's,
-And other erotic effects.
-%
-Lipstick on your dipstick told a tale on you,
-Lipstick on your dipstick said you were untrue.
-Bet your bottom dollar you and I are through,
-'Cause lipstick on your dipstick told a tale on you.
- -- To the tune of "Lipstick On Your Collar"
-%
-Lisp hackers
- ... do it in CARS.
- ... do it with tail recursion.
- ... first do it in the front, then do it in the back.
- ... have DEFUN while doing it.
- ... have Moby dicks.
-%
-Lisp hackers have to be bound (to-do 'it) ...
-%
-Lisp programmers do it deeper and deeper and deeper.
-%
-Little Boy Blue -- He needed the money.
- -- Andrew "Dice" Clay
-%
-LITTLE DEATH: (la petite mort) Some women do indeed pass right out, the
-'little death' of French poetry. Men occasionally do the same. The
-experience is not unpleasant, but it can scare an inexperienced partner
-cold. A friend of ours had this happen with the first girl he ever slept
-with. On recovery she explained, "I am awfully sorry, but I always do that."
-By then he had called the police and an ambulance. So there is no cause
-for alarm, any more than over the yells, convulsions, hysterical laughter,
-or sobbing, or any of the other quite unexpected reactions that go along
-with complete orgasm in some people. By contrast others simply shut their
-eyes, but enjoy it no less. Sound and fury can be a flattering testimony
-to a partners skills, but a fallacious one, because they don't depend on the
-intensity of feeling, nor it upon them.
- -- The Joy of Sex
-%
-Little Herbie had been blind since birth. One day at bedtime, his mother
-told him that the next day was a very special one. If he prayed extra
-hard, he'd be able to see when he woke up the next morning. The next
-morning she came into Herbie's room and asked him if he'd prayed hard
-the night before.
- "Yes, Mommie," was his reply, "all night long!"
- "Well, then," she said, "open your eyes and you'll know that
-your prayers have been answered."
-Little Herbie opened his eyes, only to cry out,
- "Mother! Mother! I still can't see!"
- "I know, dear," said his mother, "April Fool."
-%
-Little Johnny with a grin,
-Drank up all of daddy's gin,
-Mother said, when he was plastered,
-Go to bed, you little love-child.
-%
-Little known facts: the dirtiest words used on television during the
-1950's were uttered by June Cleaver.
- "Gee, Ward, weren't you a little hard on the Beaver last night?"
-%
-Little Miss Muffet sat on a tuffet,
-Eating her curds and whey.
-Along came a spider,
-And bit her right in the snatch.
-%
-Little Miss Muffet, sat on a tuffet,
-Eating her curds and whey.
-Along came a spider,
-Who sat down beside her,
-And said, "Hey, what's in the bowl, bitch?"
- -- Andrew "Dice" Clay
-%
-Little Miss Muffet sat on a tuffet,
-Her knickers all tattered and torn.
-For it wasn't a spider that sat down beside her,
-But Little Boy Blue with his horn!
-%
-Little Miss Muffet,
-Sat on her tuffet,
-Smoking some THC.
-Along came a narc'er who sat down beside her
-And said, "So... what's in the bag, bitch?!"
-%
-Little Red Riding Hood was walking through the woods on her way to visit
-her grandmother when a wolf jumped out from behind a tree.
- "Aha!" the wolf said, "Now I've got you, and I'm going to eat you."
- "Eat, eat, eat," said Little Red Riding Hood angrily,
-"Damn it, doesn't anybody fuck anymore?"
-%
-Living in Hollywood is like living in a bowl of granola. What ain't
-fruits and nuts is flakes.
-%
-Long, long ago, in the Old West, a rancher rode into town to buy supplies.
-When he returned, he found that his whole family had been killed, his wife
-raped, his house burned, and all his cattle rustled. When he told his
-distant neighbors about the tragedy, a few of them reported that the only
-stranger they had seen in the area for weeks was a tall desperado wearing a
-black hat and a red neckerchief.
- The cowboy saddled his fastest horse and set out to find the villain.
-He searched for months but couldn't catch up with the culprit; in town after
-dusty town he was told that a man fitting the description had been there but
-had just departed; usually after some heinous crime.
- One evening after a hard day's ride he came into a town, tied his
-horse, and entered the saloon. At a table in the corner sat an ugly man,
-with a black hat and a red neckerchief! Slowly the cowboy stalked up to
-this man, his hands resting upon his guns.
- "Are you the man who killed my family, raped my wife, burned my
-house and rustled my cattle?"
- "Probably; after so many, how can I be sure?" snarled the bandit.
- "You better cut that shit out!"
-%
-Look out for yourself -- or they'll pee on your grave.
- -- Louis B. Mayer
-
-The reason so many people showed up at Louis B. Mayer's funeral
-was because they wanted to make sure he was dead.
- -- Samuel Goldwyn
-%
-Love comes in spurts.
- -- Devo, "Please Please"
-%
-Love does not make the world go around, just up and down a bit.
-%
-Love is blind but desire doesn't give a good goddam.
- -- James Thurber
-%
-Love is eating her even when she's not having her period.
-%
-Love is just for now ... herpes lasts forever.
-%
-Love is not the dying moan of a distant violin -- it's the triumphant
-twang of a bedspring.
- -- S.J. Perelman
-%
-Love is two minutes and fifty-two seconds of squishy sounds.
- -- Johnny Rotten
-%
-Love letters no longer they write us,
-To their homes they so seldom invite us.
- It grieves me to say,
- They have learned with dismay,
-We can't cure their "vulva pruritus."
-%
-Luser, n.:
- Someone who picks up a female
- hitch-hiker walking home from a date.
-%
-Ma Bell runs a baudy house.
-%
-Macho, adj.:
- Jogging home from a vasectomy.
-%
-Male, n.:
- Life support system for a cock.
-%
-Man in stall:
- Hey, buddy? Is there any toilet paper out there?
-Man at sink:
- No, I don't see any. Just a second... Nope, none in
- any of the other stalls either.
-A minute passes.
-Man in stall:
- Say, buddy?
-Man at sink:
- Yeah?
-Man in stall:
- You got change for a ten?
-%
-Man who dance in crowded ballroom
-dance cheek to cheek with woman behind him.
-%
-Man who keep money in jockstrap has financial matters all balled up.
-%
-Man's lust for a bust is hardly recent,
-Some say not even indecent.
-But if you lust,
-It's a must!
-%
-Many a bachelor feels the need to insert his masculinity.
-%
-Many a man has decided to stay alive not because of the will to live, but
-because of the determination not to give assorted surviving bastards the
-satisfaction of his death.
- -- Brendan Francis
-%
-Many a man has fallen in love with a girl in a light so dim he would
-not have chosen a suit by it.
- -- Maurice Chevalier
-%
-Many a man in love with a dimple makes the mistake of marrying the
-whole girl.
- -- Stephen Leacock
-%
-Many a man who thinks he's going on a maiden voyage with
-a woman finds out later that it was just a shake-down cruise.
-%
-Many a sober Christian would rather admit that a wafer is God than that God
-is a cruel and capricious tyrant.
- -- Edward Gibbon
-%
-Many a wife thinks her husband is the world's greatest lover.
-But she can never catch him at it.
-%
-Many a woman hasn't realized that she was raped until the check bounced.
-%
-Many nice things suck.
-%
-Marijuana is like Coors beer. If you could buy the damn stuff
-at a Georgia filling station, you'd decide you wouldn't want it.
- -- Billy Carter
-%
-Marlene wanted Joy to relent,
-She said, "AIDS is so hard to prevent.
- If you want to get laid,
- Then we'll have to tribade!"
-(But Joy didn't know what she meant.)
-%
-Marriage has driven more than one man to sex.
- -- Peter De Vries
-%
-Marriage is like a bank account. You put it in, you take it out,
-you lose interest.
- -- Professor Irwin Corey
-%
-Mary had a little lamb,
-boy was the doctor surprised!
-%
-Mary had a little lamb,
-It's fleece as white as snow.
-It followed her to school one day,
-And got fucked by a big black dog.
-%
-Mary had a little lamb,
-She kept it in a bucket.
-And every time she let it out,
-The bulldog used to
-Chase it around the garden.
-%
-Mary had a little sheep,
-And with the sheep she went to sleep,
-The sheep turned out to be a ram,
-And Mary had a little lamb.
-%
-Mary had a little watch;
-She swallowed it one day.
-And so she took some Ex-Lax
-To pass the time away.
-
-But when she took the Ex-Lax
-The time it did not pass.
-So when you want to know the time,
-Just look up Mary's ...
- Uncle, he has a watch, too.
-%
-Masturbation! The amazing availability of it!
- -- James Joyce
-%
-Masturbation, n.:
- A self-service elevator.
-%
-Masturbation, n.:
- Coming unscrewed.
-%
-Math is to physics like masturbation is to sex.
-%
-Mathematicians do it in groups.
-%
-Mathematicians do it in theory.
-%
-Mathematicians do it with a small, imaginary part.
-%
-Mathematicians take it to the limit.
-%
-May a deranged midget on a pogo stick
-take refuge in your sister's hoop skirt.
-%
-May a diseased yak take a liking to your sister.
-%
-May all the boys you fall in love with fall in love with boys themselves.
-%
-May all the girls you fall in love with fall in love with girls themselves.
-%
-May Allah blow sand in your Preparation H.
-%
-May the fairy god-camel leave a lump on your pillow!
-%
-Maybe if the guy who developed Twinkies hadn't had such a low
-opinion of himself they would have been an inch or two longer!
-%
-McCoy's a seducer galore,
-And of virgins he has quite a score.
- He tells them, "My dear,
- You're the Final Frontier,
-Where man never has gone before."
-%
-McGowan's Madison Avenue Axiom:
- If an item is advertised as "under $50",
- you can bet your ass it's not $19.95.
-%
-McQuillan was on the stand. The case involved a railroad and several of
-the passengers who were injured.
- "You say," thundered the counsel for the railroad, "that you saw
-the two trains crash head on while doing sixty miles an hour. What did you
-think when you saw this happen?"
- "I thought," replied the Irishman, "this is one *helluva* way to run
-a railroad."
-%
-Me father makes book on the corner,
-Me mother makes second hand gin,
-Me sister makes love for a dollar,
-And that's how the money rolls in!
-
- Rolls in, rolls in, just look how the money rolls in!
- (Rolls in!)
- Rolls in, rolls in, just look how the money rolls in!
-
-Me father sells cheap prophylactics,
-Me mum pokes the tips with a pin,
-Me sister performs the abortions,
-And that's how the money rolls in!
-
-Me uncle's a poor missionary,
-He saves fallen women from sin.
-He'll save you a blonde for five dollars,
-And that's how the money rolls in.
-%
-Me, I love the rich. *Somebody* has to love them. Sure, a lot
-of rich people are assholes, but believe me, a lot of poor people
-are assholes too. And an asshole with money can at least pay
-for his own drinks.
- -- Tom Robbins, "Jitterbug Perfume"
-%
-Meanwhile back at the oasis, the Ay-rabs wuz busy a-eatin' their dates!
-%
-Meanwhile, back at the ranch, Granny was a-beating off the Indians, but
-they jus' kept on a-comin'. Back at the outhouse, things were a-pilin' up.
-And, as the U.S. Fourth Calvary mounted the hill, Tonto, cleverly disguised
-as a doorknob, came off in the Lone Ranger's hand.
-%
-Meet Elmer, young son of the Thorpes,
-Afflicted with psychotic warps.
- His idea of fun
- Is to bugger a nun,
-And then vomit all over the corpse.
-%
-Megaton Man: "LOOK at them! Helpless, tender creatures, relying on
- ME, waiting for ME to make my move!"
-
-(from below): "Move your ASS, Fat-head!"
-
-Megaton Man: "It is a MANDATE, and I am DUTY BOUND to OBEY!"
-%
-Men -- can't live with 'em, can't leave
-'em by the curb when you're done.
-%
-Men have many faults,
- Women only two:
-Everything they say,
- And everything they do!
-%
-Men will fuck mud.
- -- Lenny Bruce
-%
-Menage a trois, n.:
- Using both hands to masturbate.
-%
-Men's magazines often feature pictures of naked ladies. Women's magazines
-also often feature pictures of naked ladies. This is because the female
-body is a beautiful work of art, while the male body is hairy and lumpy and
-should not be seen by the light of day.
- -- Richard Roeper, "Men and Women Are Different"
-%
-Men's skin is different from women's skin. It is usually bigger, and it
-has more snakes tattooed on it. Also, if you examine a woman's skin very
-closely, inch by inch, starting at her shapely ankles, then gently tracing
-the slender curve of her calves, then moving up to her ...
-
- [EDITOR'S NOTE: To make room for news articles about important
- world events such as agriculture, we're going to delete the
- next few square feet of the woman's skin. Thank you.]
-
-... until finally the two of you are lying there, spent, smoking your
-cigarettes, and suddenly it hits you: Human skin is actually made up of
-billions of tiny units of protoplasm, called "cells"! And what is even more
-interesting, the ones on the outside are all dying! This is a fact. Your
-skin is like an aggressive modern corporation, where the older veteran cells,
-who have finally worked their way to the top and obtained offices with nice
-views, are constantly being shoved out the window head first, without so
-much as a pension plan, by younger hotshot cells moving up from below.
- -- Dave Barry
-%
-Meteorologist, n.:
- A man who can look in a woman's eyes and predict whether.
-%
-Mickey Mouse has a long talk one day with a psychiatrist, after which
-the psychiatrist interviews Minnie Mouse. A few days later Mickey meets
-with the psychiatrist, and the following conversation ensues:
-
-Sigmund: I talked with Minnie after talking with you.
-Mickey: Oh?
-Sigmund: I couldn't find anything wrong with her -- she isn't insane.
-Mickey: Idiot! I didn't say she was insane -- I said she was
- fuckin' Goofy.
-%
-Miguel Cervantes wrote Donkey Hote. Milton wrote Paradise Lost, then his
-wife died and he wrote Paradise Regained.
-%
-Mind you, not as bad as the night Archie Pettigrew ate some sheep's
-testicles for a bet... God, that bloody sheep kicked him!
- -- Ripping Yarns
-%
-Miss Mona: You know what burns my ass?
-Ed Earl: What?
-Miss Mona: A flame about three feet high!
- -- Dolly Parton and Burt Reynolds,
- "The Best Little Whorehouse in Texas"
-%
-Missed the train at the railway station
-Oh hell, blast, and damnation!
-Asked a lady in there if she had the time,
-She said "Yes", and a strong inclination.
-%
-Missionary Position:
- The missionary on top.
-%
-Mistress Mary, quite contrary,
-How does your garden grow?
-With silver bells and cockle shells,
-And one really fucked-up petunia.
-%
-Mistress, n.:
- Something between a mister and a mattress.
-%
-Mixed emotions:
- Watching your mother-in-law back off a cliff...
- in your brand new Mercedes.
-%
-Montana:
- Where men are men and women are sheep.
-%
-Moody bitch in search of...
- kind, considerate, loving man. Objective, love-hate relationship.
-%
-Moody bitch with attitude, seeks nice,
-good-looking guy to dump on.
-%
-Morris left for a two-day business trip to Chicago. He was only a few
-blocks from his house, when he realized that he had left the airplane
-tickets on his bureau top. He returned and quietly entered the house.
-His wife, in her skimpiest negligee, was standing at the sink washing
-the breakfast dishes. She looked so inviting that he tiptoed up behind
-her, reached out, and squeezed her breast.
- "Leave only one quart of milk," she said. "Morris won't be here
-for breakfast tomorrow."
-%
-Most legislators are so dumb that they couldn't pour piss out of a
-boot if the instructions were printed on the heel.
-%
-Most men would never get laid if it weren't for the pity fuck.
-%
-Most people wouldn't know music if it came up and bit them on the ass.
- -- Frank Zappa
-%
-Most plain girls are virtuous because of the scarcity of opportunity
-to be otherwise.
- -- Maya Angelou, "I Know Why the Caged Bird Sings"
-%
-Most women look for a man who is tall, dark and hung some.
-%
-Motto of the Electrical Engineer:
- Working computer hardware is a lot like an erect penis: it
- stays up as long as you don't fuck with it.
-%
-Moustache rides, 50 cents.
-%
-Mr. Rection, Mr. Hugh G. Rection, please pick up a white courtesy telephone!
-%
-Mrs. Johnson had a very beautiful and intelligent parrot. He had just one
-problem: He liked to fuck Mr. Hawkins' chickens. Mrs. Johnson scolded him
-time and time again, but he would just laugh at her. Finally, she told him
-that if he did it again, she would cut off all of the feathers on the top of
-his head. Well, he resisted the urge for a week, but one day, he just
-couldn't resist going next door. Besides, he figured she was bluffing.
- Well, Mr. Hawkins came over, ranting and raving about how the parrot
-had been fucking his chickens again. Mrs. Johnson didn't say a word, just
-took out her scissors and cut off all of the parrot's head feathers.
- That night, Mrs. Johnson had a big party at her house. Before it
-started, she took the parrot and put him on top of the piano by the front
-door. "Since you disobeyed me today, you have to stay here on the piano
-tonight. Now, don't you dare move."
- Well, the parrot was pretty pissed off about having his head bare,
-and he wasn't too happy about having to spend the whole evening on the piano.
-Still, as he usually did, when the butler would announce the guests as they
-arrived, he would say hello to them. Just then, two bald-headed men came to
-the door.
- Before the butler could say anything, the parrot yelled, "Okay, you
-chicken-fuckers, up here on the piano with me!"
-%
-Mrs. Kelly is partial to cocks;
-Mr. Kelly likes rye on the rocks.
- When he's under the weather
- They can't get together,
-So others get into her box.
-%
-Murphy's Discovery:
- Do you know Presidents talk to the country the way men talk
- to women? They say, "Trust me, go all the way with me, and
- everything will be all right." And what happens? Nine
- months later, you're in trouble!
-%
-Musing on her present and past professions as "dominant/sadomasochism
-fantasy fulfiller" and dental hygienist, Sybil said, "I couldn't really
-understand why I wanted to be a dental hygienist, but years later, after
-being in the SM world a long time, I figured it out: I'm in uniform,
-they're not. I'm standing up, they're lying down. I'm doing painful
-things to them for their own good. This is so ME."
- -- The Daily Cal, September 29, 1992 In an article titled:
- "Kinky sex remains alive and whipping despite threat
- of AIDS, book reveals"
-%
-My advice to the women's clubs of America is to raise more hell and fewer
-dahlias.
- -- William Allen White
-%
-My brother-in-law has found a way to make ends meet. He goes around
-with his head stuck up his ass.
-%
-"My country, right or wrong," is a thing that no patriot would
-think of saying except in a desperate case. It is like saying,
-"My mother, drunk or sober."
- -- G. K. Chesterton
-%
-My daddy's brains was so scrambled he thought he was Jesus. They put him
-in a nut house for 5 years and when he got out, he didn't think he was
-Jesus, he thought he was *God*! ... Which made me Jesus.
- -- T. Bywater
-%
-My father was a creole, his father a Negro, and his father a monkey; my
-family, it seems, begins where yours left off.
- -- Alexandre Dumas, pere
-%
-My girlfriend's favorite erotic position is bending over my credit cards.
-%
-My godda bless, never I see sucha people.
- -- Signor Piozzi, quoted by Cecilia Thrale
-%
-My idea of a wild party is where you throw the girls' panties at the wall
-and they stick.
- -- Johnny Bob
-%
-My mother didn't breast-feed me. She said she liked me as a friend.
- -- Rodney Dangerfield
-%
-My mother was a test tube; my father was a knife.
- -- Friday
-%
-My mother-in-law broke up my marriage. One day my wife
-came home early from work and found us in bed together.
- -- Lenny Bruce
-%
-My mothers are wholly ignorant of the almost universal prevalence of secret
-vice, or self-abuse, among the young. Why hesitate to say firmly and without
-quibble that personal abuse lies at the root of much of the feebleness,
-paleness, nervousness, and good-for-nothingness of the entire community?
- -- Dr. J.H. Kellogg, "The Ladies Guide", Modern Medicine
- Publishing Company, 1895. Dr. Kellogg helped invent
- corn flakes and peanut butter. In addition to denouncing
- masturbation, he believed that smoking caused cancer and
- that certain ailments could be cured by rolling a
- cannonball on the stomach.
-%
-My reaction to porno films is as follows: After the first ten minutes, I
-want to go home and screw. After the first twenty minutes, I never want
-to screw again as long as I live.
- -- Erica Jong
-%
-My sex life hasn't been so good; either fist or famine.
-%
-My travel agent's an Oxford chap
-Who rolls his eyes when he speaks.
-I asked him about the Isle of Man
-For a journey of about six weeks.
-And this is what he said to me
-As he looked me right in the eye,
-"For a far-out trip, try an ice cream dip
-Of Elephant Shit On Rye."
-
-A brand-new store just opened its door
-At the corner of 5th and Vine
-And I happened to be standing right outside
-When they turned on their neon sign.
-I heard a strange sound, I looked around,
-And that's when I almost died,
-They nearly knocked me down to be the first in town
-To get their Elephant Shit On Rye!
-%
-"My trip? It was vile. Balaclava
-I loathed. Etna was crawling with lava.
- The ship was all white
- But it creaked in the night,
-And the band, they did not know la java."
- -- Edward Gorey
-%
-My wife and I only smoke after sex. I've had the same pack since 1967.
-She's up to three packs a day.
- -- Rodney Dangerfield
-%
-My wife has breast cancer. She told me to start dating.
- -- Howard Stern
-%
-Naeser's Law:
- You can make it foolproof, but you can't make it damnfoolproof.
-%
-Naked children are so perfectly pure and lovely. I confess I do not admire
-naked boys. They always seem to me to need clothes -- whereas one hardly
-sees why the lovely forms of girls should ever be covered up.
- -- Lewis Carroll
-%
-Naked couple in bed, woman says to man:
- "When I said I had a foot fetish, I was referring to cocks."
-%
-Nancy Reagan wants to divorce old Ron...
-seems he's making it hard for everyone but her.
-%
-National Sex Week -- don't let your meat loaf.
-%
-Navel, n.:
- A place to stash your gum on the way down.
-%
-Necessity is the mother of strange bedfellows.
-Watch who you sleep with.
-%
-Necrophilia, n.:
- Dead boring.
-
-Incest, n.:
- Relatively boring.
-%
-Necrophilia, n.:
- Dropping in for a cold one.
-%
-Negotiate my ass, let's kill something!
-%
-Never fly under a seagull - they'll shit on your airplane.
- -- Gordon Cooper
-%
-Never try to keep up with the Joneses; they might be newlyweds.
-%
-New book out from Gary Hart; "Six Inches from the White House".
-%
-New Jersey is not the armpit of the nation;
-it's the asshole of the universe.
- -- Jonathan Michael Smith
-%
-New York:
- Where men are men, sheep enjoy it, and lepers laugh their heads off.
-%
-Newlywed groom:
- Honey, I have something to confess to you. I'm a golfer.
- You'll never see me on Tuesday nights, Thursday nights,
- and weekends. I'm sorry.
-Newlywed bride:
- I have something even worse to confess, dear. I'm a hooker.
-Groom:
- Oh, honey, that's no problem! Just keep your head low and follow
- through...
-%
-Newsflash:
- Apparently the rapture did occur last Tuesday as was originally
-predicted. All true believers were transported to heaven while the rest
-of us were left behind to await the Anti-Christ and the end of the world.
- Widespread reports that the rapture had not occurred stemmed from
-expectations that the effect would be more widespread than it turned out
-to be. The definition of "true believer" was apparently more restrictive
-than expected, however, and the only qualifiers were a family of five,
-living in Stenton, North Dakota.
-%
-Next, upon a stool, we've a sight to make you drool.
-Seven virgins and a mule, keep it cool, keep it cool.
- -- ELP, "Karn Evil 9" (1st Impression, Part 2)
-%
-Nice computers don't go down.
-%
-Nine out of ten men who preferred Camels have switched back to women.
-%
-Nine reasons a taco is better than a woman:
- 1: Tacos don't put frilly covers on the toilet seat
- so the lid won't stay up.
- 2: Tacos don't use your razor on their legs.
- 3: Tacos don't say "That's okay, it doesn't have to be good for me."
- 4: Tacos don't get upset if you eat another taco, "Just for fun."
- 5: Tacos will never contest a divorce,
- demand a property settlement or seek custody of anything.
- 6: Tacos won't ask you about your last lover,
- or speculate about your next one.
- 7: A taco will never make a scene because
- there are other tacos in the refrigerator.
- 8: It's easy to drop a taco.
- 9: Tacos don't want to sleep on your chest.
-%
-Ninety percent of everything is crap.
- -- Theodore Sturgeon
-%
-No matter how clever the hardware boys
-are, the software boys piss it away.
-%
-No one born with a mouth and a need is "innocent".
- -- Greg Bear
-%
-No one is listening until you fart.
-%
-No woman can call herself free until she can choose consciously whether
-she will or will not be a mother.
- -- Margaret H. Sanger
-%
-Non Illegitemus Carborundum.
- [Don't let the bastards wear you down.]
-%
-Not everyone has a one-track mind.
- -- From a Bisexuality 101 talk
-%
-Not only is God dead, but just try to find a plumber on weekends.
- -- Woody Allen
-%
-Nothing, adj.:
- A man with an erection who walks into a wall and breaks his nose.
-%
-Nothing is better than Sex.
-Masturbation is better than nothing.
-Therefore, Masturbation is better than Sex.
-%
-Nothing ruins the mood more during foreplay than the image of your
-65-year old home room teacher trying to stretch a condom over a
-cucumber.
- -- Dennis Miller
-%
-Now a Jew, in the dictionary, is one who is descended from the ancient
-tribes of Judea ... but you and I know what a Jew is -- one who killed
-Our Lord ... A lot of people say to me "Why did you kill Christ?" What
-can I say? It was an accident. It was one of those parties that got out
-of hand, you know... We killed him because he didn't want to become
-a doctor, that's why we killed him.
- -- Lenny Bruce
-%
-Now hear this fair lass from Rhode Isle
-Who said with a wink and a smile,
- "Sure, please stick it in,
- Be it thick be it thin,
-But if's rough I won't do as a file."
-%
-Now it is such a bizarrely improbable coincidence that anything so mind-
-bogglingly useful could have evolved purely by chance that some thinkers
-have chosen to see it as a final and clinching proof of the non-existence
-of God. The argument follows: "I refuse to prove that I exist," says God,
-"for proof denies faith, and without faith I am nothing." "But," says Man,
-"the Babel fish is a dead giveaway, isn't it? It could not have evolved
-by chance, thus proving that you exist, therefore by your own arguments,
-you don't. QED." "Oh, dear," says God, "I hadn't thought of that," and
-promptly vanishes in a puff of logic.
- -- Douglas Adams
-%
-Now what would they do if I just sailed away?
-Who the hell really compelled me to leave today?
-Runnin' low on stories of what made it a ball,
-What would they do if I made no landfall?"
- -- Jimmy Buffet, "Landfall"
-%
-Nuke the gay, unborn, baby whales for Jesus.
-%
-Nurse Jones is a regular on the newsgroup [alt.sex.bondage], and
-occasionally has problems with folks harassing her. She came up
-with this in response to one...
-
- Fortunately, my ego isn't as fragile as that woodpecker's wing.
- When fratboy called me a dyke I told him that actually I was
- bisexual, but that he shouldn't feel threatened because he didn't
- meet either of my standards. But if it makes you feel more
- comfortable, I said, my husband tied me to the bedposts this
- morning and screwed the daylights out of me.
-
- "Just think," said
-
- Nurse Jones,
- "... that was four
- hours ago and
- my sperm count
- is probably *still*
- higher than yours."
-%
-Nybble me... Byte me... Unsigned long int me...
-%
-Objectivity is to a newspaper what virtue is to a woman.
- -- Joseph Pulitzer
-%
-Obscene? Obscene is young men being trained to drop fire on people, but
-their commanders not allowing them to write "fuck" on their airplanes
-because it's obscene.
-%
-Obscenity is the crutch of inarticulate motherfuckers.
-%
-Ocean, n.:
- A body of water occupying about two-thirds of a world made for
-man -- who has no gills.
-%
-Oden the bardling averred
-His muse was the bum of a bird,
- And his Lesbian wife
- Would finger his fife
-While Fisherwood waited as third.
-%
-Of course, I speak of nothing else but that classic of understated yet wildly
-exciting eroticism, "The Windflower," by Laura London. Ms. London is the
-author of such other philosophical block-busters as "Bad Baron's Daughter,"
-"A Heart Too Proud," "Moonlight Mist," and most thigh-warming of all, "Gypsy
-Heiress". Well, glasses-steaming scenes are to be found on every page, to
-an extent which overwhelms Your Humble Narrator, and so, in order to save
-himself extreme embarrassment, he brings you... the blurb:
-
- "Every lady of breeding knows: no one has a good time on a pirate
-ship. No one, that is, but the pirates. Yet there she was, Merry Wilding
--- kidnapped in error, taken from a ship bound from New York to England,
-spirited away in a barrel and swept aboard the infamous "Black Joke"...
-There she was, trembling with pleasure in the arms of her achingly handsome,
-sensationally sensual, golden-haired captor -- Devon."
-%
-Of course, most people eventually give up bowling for sex.
-The balls are lighter and you don't have to change your shoes.
-%
-Of his face she thought not very much,
-But then, at the very first touch,
- Her attitude shifted --
- He was terribly gifted
-At frigging and fucking and such.
-%
-Oh, baby, put two fingers here and one finger there and call me bitch.
-%
-Oh give me a home, where the bookmakers roam,
-Where the beer and the whiskey flows free,
-Where never is heard, a discouraging word,
-And the call-girls keep callin' for me!
-%
-Oh, I'm looking over, my dead dog Rover,
-That got run over with my mower.
-One leg is missing, and one other is gone,
-The fourth one is scattered all over the lawn.
-It's no use explain'n, the one remaining,
-It landed by the kitchen door.
-Oh, I'm looking over, my dead dog rover,
-that ain't gonna walk no more...
- -- Tune is something about a four-leaf clover
-%
-Oh John, let's not park here.
-Oh John, let's not park.
-Oh John, let's not.
-Oh John, let's.
-Oh John.
-Oh.
-%
-Oh, pity the Duchess of Kent!
-Her cunt is so dreadfully bent,
- The poor wench doth stammer,
- "I need a sledgehammer
-To pound a man into my vent."
-%
-Oh pity the prince, Montezuma
-He tried to make love to a puma.
- Seems the puma, in play,
- Tore his testes away -
-- An example of animal huma.
-%
-Oh what a tangled web we weave when first we practice to conceive.
- -- Don Herold
-%
-OLD FELLA RED CLARET
- Produce of Australia -- "The Big 69'er"
-
-An unusual "Rough-as-Guts" wine that has the Distinctive Bouquet of old
-and ill-cared for animals. It is best drunk with the teeth clenched to
-prevent ingestion of the seeds and skins. Connoisseurs will savour the
-slight Tannin Taste of burnt shag feathers and soiled medical dressings.
-Possessors of a cultivated Palate admire the initial assault on the taste
-buds which comes from the careful and loving blending of circus hosings
-with perished jock straps. The maturing in Midland Abattoir hogsheads
-gives it a very Definite Nose. With the bouquet like an aborigine's armpit.
-In the United States this wine is marketed as Crow Brand (9 out of 10 people
-who drink it for the first time exclaim "VRAAAARRRRRK").
-
-It won a Bronze at the "Kings Cross Homosexuals Convention" of 1973
-
-Warning: Avoid contact with eyes and open cuts.
- Keep away from open naked flames -- both old and new.
-%
-Old King Cole
-Was a merry old soul,
-A merry old soul was he!
-He called for his pipe,
-And he called for his bowl,
-And he fiddled with his call girls three!
-%
-Old McDonald had a farm,
-E-I-E-I-O!
-And on this farm he had some chicks,
-E-I-E-I-O!
-With a chick-chick here,
-And a chick-chick there,
-Here a chick,
-There a chick,
-Everywhere a chick-chick,
-Old McDonald lost his farm
-'Cause he had too many chicks!
-%
-Old mercenaries never die. They go to hell and regroup.
-%
-Old Mother Hubbard lived in a shoe,
-She had so many children,
-She didn't know what to do.
-So she moved to Atlanta.
-%
-Old Mother Hubbard
-Went to the cupboard
-To get her poor dog a bone.
-When she bent over,
-Her Rover took over
-And she got a bone of her own.
- -- Andrew "Dice" Clay
-%
-Olmstead's Law:
- After all is said and done, a hell of a lot more is said than done.
-%
-On a cannibal isle near Malaysia
-Lives a lady they call Anastasia.
- Not Russian elite-
- She's eager to eat
-Whatever or whoever lays her.
-%
-On a ship wrecked far out at sea,
-The girl said, "I can't seem to pee."
- "Aha!" said the mate,
- "That settles the fate
-Of the captain, the pilot, and me."
-%
-On an isolated stretch of beach near Cannes, a beautiful French girl threw
-herself into the sea and drowned despite a young man's attempt to save her.
-The man dragged the half-nude body ashore and left it on the sand while he
-went to notify the authorities. Upon his return, he was horrified to find
-a man making love to the corpse.
- "Monsieur, monsieur," he shouted, "that woman is dead,
-that woman is dead!"
- "Sacre bleu," exclaimed the man, springing up.
-"I thought she was an American!"
-%
-On Brassieres:
- Russian: Uplifts the masses.
- Salvation Army: Raises the fallen.
- American: Makes mountains out of molehills.
-%
-On day a Monterey daughter
-Did scuba down under the water.
- She later turned up
- The mom of a pup,
-And they say t'was an otter that gotter.
-%
-On one hot dusty day in 1860, a lone Mexican bandit crossed the border into
-Texas. After robbing a small bank and shooting up the town, he led the posse
-on a merry chase through the desert. On the sixth day of the chase he was
-apprehended.
- Sheriff-to-interpreter: "Ask him where the money is."
- Interpreter-to-bandit: "He wants to know where you hid the money."
- Bandit-to-interpreter: "I'll never tell, never!"
- Interpreter-to-sheriff: "He says he'll never tell, senor."
-At this point, the sheriff loses his cool. His town has been shot up, his
-bank robbed, he's spent a week in the desert tracking this guy, and now he
-says he'll never tell. So he takes his pistol, jams it under the bandits'
-chin, and, with the veins standing out on his neck, screams "Tell him to tell
-me where the money is, or I'm gonna blow his brains all over the desert!"
- Interpreter-to-bandit: "He says if you don't tell him where the
- money is right now, he will kill you here."
- Bandit-to-interpreter: "Do not kill me, senor, the money is hidden
- under the big tree at the pass!"
- Interpreter-to-sheriff: "He says you ain't got the balls..."
-%
-On the breast of a lady named Gail,
-Was tattooed the price of her tail.
- And on her behind,
- For the sake of the blind,
-Was the same information -- in Braille.
-%
-On the porch of a dude named Horatio,
-His girl got a yen for fellatio.
- As she sucked on his dingus
- He tried cunnilingus
-But the cops ran 'em off of that patio.
-%
-Ona day Ima gonna to Detroit to a bigga hotel. Ina morning I go down to
-eat breakfast. I tella waitress I wanna two piss's toast. She bringa me
-only one piss. I tella her I wanna two piss ona my plate. She says you
-better no piss on the plate, you sonna bitch. I don't even know the lady
-and she call me sonna bitch. Later I go out to eat at the bigga restaurant.
-The waitress bring me a spoon and a knife but no fock. I tell her I wanna
-fock. She tells me everone wanna fock. I tell her "you no understand", I
-wanna fock on the table. She say you better not fock on the table, you
-sonna bitch. So I go back to my room ina hotel and there isa no shits ona
-my bed. I calla the manager and tella him I wanna shit. He tella me to go
-to the toilet. I say "you no understand", I wanna shit on the bed. He say
-you better no shit ona bed, you sonna bitch. I go to check out and the man
-at the desk say "peace to you". I say piss on you too, you sonna bitch. I
-gonna back to Italy.
-%
-Once a woman has given you her heart you
-can never get rid of the rest of her.
- -- Vanbrugh
-%
-Once I belonged to a group that really had THE WORD. I fought like hell
-for them. But another group came along and exposed the word of my group
-as shallow and degenerate. They had a better word. So I quit the first
-group and lost all the friends I had made and I joined up with this new
-group. I fought like hell for them. But another group came around. They
-exposed the word of my group as false and materialistic. Their word was
-very much better. So I quit the second group and lost all the friends I
-had made. And I joined up with this new group. I fought like hell for them.
-Till this one guy came along and proved that there wasn't any word at all.
-That I should go off as an individual and grow! So I quit the last group
-and lost all the friends I had made. And now I sit home alone all day and
-all I do is grow. It would be nice to join up with some others who feel
-the way I do.
- -- J. Feiffer
-%
-Once upon a girl there was a time...
-%
-Once upon a time there was a farmer who had borrowed a bull to service his
-two cows. He put all three animals on a meadow and sent little Johnny to
-observe and report any success. A short time later, little Johnny came
-running towards the house shouting: "Daddy, Daddy, the bull just fucked the
-white cow!"
- The father took little Johnny aside and said: "Look, kid, it's
-alright if you use that kind of language around me, but the reverend is
-going to be visiting soon. So next time, please use another word; just
-say that the bull "surprised" the cow."
- Johnny agreed and went back to observe any progress. A little
-while later, while the preacher was talking to the farmer, little Johnny
-came a-running again, shouting: "Daddy, Daddy!"
- The father, trying to avoid embarrassing the preacher, said: "I
-know, the bull surprised the brown cow."
- Little Johnny replied: "He sure did, he fucked the white one again!"
-%
-Once upon a time there was a farmer who owned a large number of chickens and
-made money by selling chickens to a local distributing company. The farmer
-wanted to increase his business, and so went to market to buy another rooster.
-"This rooster," assured the vendor, "is my best. He's virile and energetic
-and will take care of all your chickens!" The farmer, delighted at this,
-bought the rooster and returned to his farm. He set the rooster loose among
-his hen houses and, sure enough, the rooster enthusiastically went to work.
-It wasn't too long, however, before the rooster finished off all the hens and
-began on the few geese and ducks that were on the farm. "If you keep up this
-rate," warned the farmer, "you'll screw yourself to death!" The rooster,
-however, scoffed at the farmer and continued at an increased speed. The next
-morning, the farmer was doing his chores when he noticed several buzzards in
-the sky circling over something. He headed out behind the barn, and sure
-enough there was the rooster, flat on his back, with eyes closed. The farmer
-shook his fist at the motionless body and cursed, shouting "I knew it! I told
-you so! I knew you'd screw yourself to death!" The rooster turned his head
-toward the farmer, opened one eye, and winked. "Shhh!" he said, pointing to
-the birds above. "I think they're coming down."
-%
-Once upon a time there was a little girl named Little Red Riding Hood. One
-fine morning she decided to visit her Grandmother, so she put a freshly baked
-cake and a .357 magnum into her basket and set off through the forest. When
-she got there, what should she find but a big black wolf in the bed, who
-jumped up, grabbed her and snarled, "I'm going to fuck you until the sun goes
-down."
- So Little Red Riding Hood whipped out the .357 and said, "Oh, no,
-you're not! You're going to eat me just like the story says!"
-%
-Once upon a time, there was a non-conforming sparrow who decided not to
-fly south for the winter. However, soon after the weather turned cold,
-the sparrow changed his mind and reluctantly started to fly south.
-After a short time, ice began to form his on his wings and he fell to
-earth in a barnyard almost frozen. A cow passed by and crapped on this
-little bird and the sparrow thought it was the end, but the manure
-warmed him and defrosted his wings. Warm and happy the little sparrow
-began to sing. Just then, a large Tom cat came by and hearing the
-chirping investigated the sounds. As Old Tom cleared away the manure,
-he found the chirping bird and promptly ate him.
-
-There are three morals to this story:
-
-(1) Everyone who shits on you is not necessarily your enemy.
-(2) Everyone who gets you out of shit is not necessarily your friend.
-(3) If you are warm and happy in a pile of shit, keep your mouth shut.
-%
-Once upon a time there was a sperm named Stanley. He'd do pushups and
-somersaults and limber up all the time, while the other sperm just lay around
-on their fat asses not doing a thing. One day, one of them became curious
-enough to ask Stanley why he exercised all day. Stanley said,
- "Look, only one sperm gets a woman pregnant and when the right
-time comes, I am going to be that one."
-A few days later, the all felt themselves getting hotter and hotter, and they
-knew that it was getting to be their time to go. They were released abruptly
-and, sure enough, there was Stanley swimming far ahead of all the others.
-All of a sudden, Stanley stopped, turned around, and began to swim back with
-all his might.
- "Go back! Go back!" he screamed. "It's a blow job!"
-%
-Once upon a time there were three coeds -- a big coed, a medium-sized coed,
-and a little, tiny coed. One night they came home from a dance, and the big
-coed said, "Someone's been sleeping in my bed!"
- The medium-sized coed looked in her room and said, "Someone's been
-sleeping in my bed!"
- And the little, tiny coed said, "Well, nighty-night, girls!"
-%
-Once upon a time, when I was training to be a mathematician, a group of
-us bright young students taking number theory discovered the names of the
-smaller prime numbers.
-
-2: The Odd Prime --
- It's the only even prime, therefore is odd. QED.
-3: The True Prime --
- Lewis Carroll: "If I tell you 3 times, it's true."
-31: The Arbitrary Prime --
- Determined by unanimous unvote. We needed an arbitrary prime
- in case the prof asked for one, and so had an election. 91
- received the most votes (well, it *looks* prime) and 3+4i the
- next most. However, 31 was the only candidate to receive none
- at all.
-41: The Female Prime --
- The polynomial X**2 - X + 41 is
- prime for integer values from 1 to 40.
-43: The Male Prime -- they form a prime pair.
-
-Since the composite numbers are formed from primes, their qualities
-are derived from those primes. So, for instance, the number 6 is "odd
-but true", while the powers of 2 are all extremely odd numbers.
-%
-Once was a hooker named Gail,
-Busted and sent-off to jail,
- She liked the jailer,
- He wanted to nail her,
-So Gail made bail with her tail.
-%
-Once you come out as a Pagan bisexual married leatherdyke,
-the rest of life is that much easier.
-%
-Once you've got them by the balls, their hearts and minds will follow.
-%
-One by one the vice-presidents of a large corporation were called into the
-boss's office. Then the junior executives were individually summoned.
-Finally the office boy was brought in.
- "I want the truth, Charles," the boss bellowed. "Have you been
-playing around with my secretary?"
- "N-no, sir," the office boy stammered. "I-I'd never do anything
-like that, sir."
- "All right, all right," sighed the boss, "then you fire her."
-%
-One day a city dweller decided to take a ride in the country. He hopped
-into his sportscar, wandered along the highway for a while and then exited
-to some very rural dirt roads in the middle of farm country. After awhile,
-he came across a farmer who clearly working his fields. The funny thing was,
-the farmer didn't seem to be wearing any pants. The man got out of his car
-and approached the farmer.
- "Hey, buddy," he asked, "how come you're not wearing any clothes?"
- Replied the farmer, "Well, boy, th' other day I was out a-workin'
-in the fields, an' I plum fergot t' wear mah shirt. Got back to th' house
-that night, and mah neck was stiffer than an oak-wood board. This here's
-mah wife's idea."
-%
-One day a little polar bear cub says to his mother, "Mommy, am I really
-a polar bear?"
- "Why of course you are, honey!" his mother replies. "You live at
-the North Pole and you swim under the ice to catch fish. You play on the
-ice floes and you romp through the snow and chase seals. Of *course* you're
-a polar bear. Why do you ask?"
- "Because," says the little cub, "I'm fuckin' freezing!"
-%
-One day a mouse was driving along the road in his Mercedes when he heard an
-anguished roaring noise coming from the side of the road. Stopping the car,
-he got out and discovered a lion stuck in a deep ditch and roaring for help.
-Reassuring the lion, the mouse tied a rope around the axle of the Mercedes,
-threw the other end down to the lion, and pulled the beast out of the ditch.
-The lion thanked the mouse profusely and they went their separate ways.
- Two months later the lion was out for a stroll in the country when
-he heard a panicked squeaking coming from the side of the road. Investigating
-the noise, what should he come across but the mouse stuck in the same hole.
-"Oh, please help me, Mr. Lion," squeaked the terrified mouse. "I saved you
-with my car once, remember?"
- "Course I'll help you, little fellow," roared the lion. "I'll just
-lower my dick down to you, you hold on to it, and we'll have you out of there
-in a jiffy." Sure enough, a few minutes later the mouse was high and dry on
-the roadside, trying to convey his eternal gratitude to the lion.
- "Don't give it another thought," said the lion kindly. "It just goes
-to show that if you've got a big dick, you don't need a Mercedes."
-%
-One day Adam, while wandering around the Garden of Eden, noticed that all
-the animals seemed to come in pairs, male and female. He also noted that
-they seemed to enjoy being together a lot. So, he went to his special
-place and reported to God what he'd noticed.
- God, understanding his need, said, "Adam, the time has come for me
-to provide you with a mate. Go lie down and when you have fallen asleep, I
-will create your mate."
- So Adam wandered off, found a nice patch of soft grass and fell
-asleep. Some time later he awoke, possibly due to a bit of pain in his
-ribs, possibly because of the gorgeous woman leaning over him. Remembering
-the animals he'd seen having such fun, he immediately reached for her.
-Pretty soon Adam's back at his special place.
- "God?"
- "Yes, Adam, what now?"
- "God, what's a headache?"
-%
-One day Father O'Malley was walking through the park when he came upon an
-enchanting scene. A beautiful little girl with long blond hair, deep blue
-eyes, and a dainty white dress was reading under a tree with her adorable
-little dog.
- What a lovely picture, thought the Father to himself. Walking over,
-he asked, "Child, what is your name?"
- "Blossom," she replied.
- "What a fitting name," exclaimed Father O'Malley. "And how did your
-parents come to choose such a pretty name?"
- "Well, one day when I was still in my mommy's tummy she was lying
-under this very tree when a blossom fell and landed on her stomach. She
-thought it was a message from God and decided that I would be a girl and my
-name would be Blossom," explained the little girl sweetly.
- How charming, thought the priest. He started to say good-bye and
-walk away, then turned back. "And the name of your little dog?" he
-inquired.
- "Porky," was the child's reply.
- Again he asked her how the unusual name had been chosen.
- "Because he likes to fuck pigs."
-%
-One day I got on the usual bus, and when I stepped in, I saw the most
-gorgeous blond Chinese girl... I sat beside her... I said "Hi," and she
-said "Hi," and then I said "Nice day, isn't it," and she said "Yeah, I
-guess"... I said "What do you mean 'you guess?'"... she said "I saw my
-analyst today and he says I have a problem."... so I asked "What's the
-problem?"... she replied "I can't tell you, I don't even know you."...
-I said "Well sometimes it's good to tell your problems to a perfect
-stranger on a bus." So she said, "Well, my analyst said I'm a nymphomaniac
-and I only like Jewish cowboys... by the way, my name is Diane." I said,
-"Hello, Diane, my name is Bucky Goldstein."
- -- Steven Wright
-%
-One day, in a bar, a young man walks in with a little dwarf about one foot
-tall on his shoulder and orders a beer. The bartender serves the man a beer;
-to his astonishment, the little guy walks down the man's arm, takes a swallow
-of the brew and spits it in his face. After a few minutes the customer
-orders another beer and the exact same thing happens. Well, by this time,
-the bartender is getting pretty upset; he figures that the man should take
-care of the dwarf. So he asks the guy, "Why are you letting that guy drink
-all your beer and spit it in my face?"
- "Well, sir, when I was on a contract in Saudi Arabia I met this genie
-and he granted me three wishes. I asked for a million dollars, the most
-beautiful woman in the world, and a twelve-inch prick.
-%
-One day on a busy street corner a huge, burly looking man walked up to a police
-officer and asks, "Thcuse me offither, can you tell me where thidee-thid, and
-thacramento ith?"
- The police officer didn't reply at all, but just looked away.
- The large man then asked again, but still no reply. After a few more
-attempts which the police officer studiously ignored, the frustrated man
-walked away. An onlooking pedestrian then walked up to the officer and asked,
-"Officer, why didn't you tell that man where thirty-third and Sacramento was?" The police officer replied,
- "Thure, thure, and dit the thit ticked out of me!"
-%
-One day President Reagan, Chairman Andropov, the Pope, and a boy scout
-were flying together in an airplane. Right out in the middle of
-nowhere the plane developed engine trouble and started to go down.
-Unfortunately, only three parachutes could be found for the four
-passengers! Andropov grabbed one of the parachutes and declared
-"Comrades, as leader of the socialist workers revolution, my life must
-be spared," and he jumped out of the plane. Then Reagan exclaimed "As
-leader of the greatest nation on earth, I must keep the world safe for
-democracy," and with that he too jumped to safety. Now if you are
-following all this (or counting on your fingers) you must see that
-there is only one parachute left for the two remaining passengers. The
-Pope looked kindly upon the boy scout and said "I have had a long and
-productive life, my son. You take the parachute and leave me in God's
-hands." "That's very kind of you," the observant scout replied, "but
-there is no need. Reagan just jumped out with my knapsack."
-%
-One evening a guru had coitus
-With an actress, a whore and a poetess.
- When asked what position
- He used for coition,
-He answered serenely, "the lotus."
-%
-One fall day, two men were out in the woods hunting. Feeling a sudden need
-to relieve himself, George went over to a nearby clump of bushes, unzipped
-his fly, and started in when a poisonous snake lunged out of the bushes and
-bit him on his penis. Hearing George's howl of pain and fright, his friend
-Fred came running up and told him to lie still while he used the radio to
-call a doctor.
- "There's only one way to save your friend's life," said the doctor
-gravely. "If you cut a shallow 'X' over the bite and then suck as much of
-the poison out as you can, he'll probably be okay, but otherwise there's not
-much hope."
- Hearing Fred's footsteps, George rose weakly up on one elbow and
-cried out, "Fred, what'd he say? What did the doctor say?"
- "George, old friend," said Fred sadly, "he said you're gonna die."
-%
-One hundred and one uses for canned peaches.
-One hundred and two if you plan to eat them.
-%
-One man's nightmare is another man's wet dream.
-%
-One morning after an evening of particularly heavy drinking, a man awoke
-and upon rolling over in bed saw one of the ugliest women he had ever
-seen. As he was about to get out of bed, he looked on the floor and saw
-another woman even less appealing than the first. Seeing his look of
-wide-eyed amazement, the woman on the floor snapped, "Don't look at me
-like that, I was only the bridesmaid."
-%
-One of my favorite jokes, a telling commentary on Jewish mothers' capacity
-to lay on guilt, involves the mother who gave her son two neckties on Chanuka.
- "The boy hurried into his bedroom, ripped off the tie he was wearing,
-put on one of the ties his mother had brought him, and hurried back. "Look,
-Mama! Isn't it gorgeous?"
- "Mama asked, 'What's the matter? You don't like the other one?'"
- -- Leo Rosten, "Hooray For Yiddish"
-%
-One of the airlines recently introduced a special half-fare rate for wives
-accompanying their husbands on business trips. Anticipating some valuable
-testimonials, the publicity department of the airline sent out letters to
-all the wives of businessmen who used the special rates, asking how they
-enjoyed their trip. Responses are still pouring in asking,
- "What trip?"
-%
-One of the first things school children in Texas learn is how to
-compose a simple declarative sentence without the word "shit" in it.
-%
-One of the most expensive things in life
-is a girl who is free for the evening.
-%
-One of the regular foursome was sick, so a new member named George filled in.
-He was good and pleasant company so they asked him to join them again the
-following Sunday.
- "9:30 okay?"
- "Fine," George said, "but I may be a few minutes late."
-The following Sunday George showed up right on time. Not only that, he played
-left-handed and beat them. They agreed to meet the following Sunday morning.
-George was eager to come, but again, mentioned that he might be a few minutes
-late. The next Sunday there was George, punctual to the dot. This time he
-played right-handed and beat them again.
- "You on for next Sunday, George?" one of the foursome asked.
- "Sure," George replied, "but I might be a few..."
- Another golfer jumped in. "Wait a minute... You always say you might
-be late, but you're always right on time, and you always win, left-handed
-*or* right-handed."
- "Well," George replied, rather sheepishly, "that's true, but see, I'm
-superstitious. If my wife is sleeping on her right, when I wake up, I play
-right handed. If she's sleeping on her left side, I play left handed."
- "What if she's lying on her back?"
- George said, "That's when I'm late."
-%
-One Saturday afternoon, during the campaign to decide whether or not
-there should be a Coastal Commission, I took a helicopter ride from Los
-Angeles to San Diego. We passed several state beaches, some crowded
-and some virtually empty. They had the same facilities, and in some
-cases the crowded and the empty beach were within a quarter mile of
-each other. Obviously many beach-goers prefer to be crowded together.
-Buying more beaches that people won't go to because they prefer to be
-crowded together on one beach is a ridiculous waste of our natural
-resources and our taxes.
- -- Ronald Reagan
-%
-One should be cherry of virgins.
-%
-One thing I have no worry about is whether God exists. But it has
-occurred to me that God has Alzheimer's and has forgotten we exist.
- -- Jane Wagner, "The Search for Signs of Intelligent
- Life in the Universe"
-%
-One, two, three, four
-What are we fighting for?
-Don't ask me I don't give a damn.
-Next stop is Vietnam.
-Five, six, seven, eight
-Open up the pearly gates.
-Ain't no time to wonder why
-Whoopie! We're all going to die.
- -- Country Joe and the Fish
-%
-One who does not know a burro from a burrow does not know
-his ass from a hole in the ground!
-%
-Ooooooh, nooooooo, not tonite!!
-%
-Ooops. Gotta run. My dog wants sex. Later.
-%
-Operators mount anything!
-%
-Opinions are like assholes -- everyone's got one, but nobody wants to
-look at the other guy's.
- -- Hal Hickman
-%
-OPTIMIST:
- A man who makes a motel reservation before a blind date.
-%
-ORAL CONTRACEPTIVE:
- The word "No".
-%
-Oral sex, n.:
- The taste of things to come.
-%
-O'Riordan's Theorem:
- Brains x Beauty = Constant.
-
-Purmal's Corollary:
- As the limit of (Brains x Beauty) goes to infinity,
-availability goes to zero.
-%
-Other people don't give you orgasms; you have them, and they help you
-cash them in.
-%
-Ouch mosquito, silent by night,
-Why pierce my skin, so white?
-You grow plump, as a leech.
-Stop! I beseech (in vein).
-
-I have no choice.
-Why waste my voice,
-When only a slap will do?
-Ouch, I am bitten!
-What ho, you are smitten!
-Yo mosquito, fuck you.
- -- Mitchell Peck, "Ouch, Mosquito"
-%
-Our government has kept us in a perpetual state of fear -- kept us in
-a continuous stampede of patriotic fervor -- with the cry of grave
-national emergency... Always there has been some terrible evil to
-gobble us up if we did not blindly rally behind it by furnishing the
-exorbitant sums demanded. Yet, in retrospect, these disasters seem
-never to have happened, seem never to have been quite real.
- -- General Douglas MacArthur (1957)
-%
-Our readers ask, "Why don't more WASPs go to orgies?" Well, it's really
-quite simple. They don't want to have to write all those thank-you notes.
-%
-Our [softball] team usually puts the other woman at second base, where
-the maximum possible number of males can get there on short notice to
-help out in case of emergency. As far as I can tell, our second
-basewoman is a pretty good baseball player, better than I am, anyway,
-but there's no way to know for sure because if the ball gets anywhere
-near her, a male comes barging over from, say, right field, to deal
-with it. She's been on the team for three seasons now, but the males
-still don't trust her. They know, deep in their souls, that if she had
-to choose between catching a fly ball and saving an infant's life, she
-probably would elect to save the infant's life, without ever
-considering whether there were men on base.
- -- Dave Barry, "Sports is a Drag"
-%
-Our staff proctologist, Dr. Barr,
-Has invented a new kind of car.
- With a tank full of shit
- There's no stopping it --
-For short trips, two poots take you far.
-%
-Over 5,000 years ago, Moses said to the children of Israel,
- "Pick up your shovels, mount your asses and load your camels,
-and I will lead you to the promised land."
- Not too long ago, Roosevelt said, "Lay down your shovels, sit on
-your asses, light a Camel, this is the promised land."
- Now Nixon is stealing your shovels, kicking your asses, raising
-the price of Camels, and mortgaging the promised land.
-%
-Oz: Guys, take a moment to deal with this. We survived.
-Buffy: It was a hell of a battle.
-Oz: Not the battle. High School.
- -- Buffy the Vampire Slayer, "Graduation Day, Part Two"
- Season 3, Episode 22
-%
-Oz: So, do you guys steal weapons from the army a lot?
-Willow: Well, we don't have cable, so we have to make our own fun.
- -- Buffy the Vampire Slayer, "Innocence"
- Season 2, Episode 14
-%
-Painters do it with even strokes.
-%
-Pardon me, sir, but you've obviously
-mistaken me for someone who gives a shit.
-%
-Passion is that funny feeling that drives a man to
-bite a woman's neck because she has beautiful legs.
-%
-Paying alimony is like pumping gas into another man's car.
-%
-Pee-wee Recommends:
-
-When Pee-wee Herman was arrested that evening in Sarasota, Florida,
-the bill at the XXX South Trail Cinema featured:
-
- + Nurse Nancy, starring Sandra Scream
- + Turn Up the Heat, starring Savannah
- + Tiger Shark, starring Raven
-%
-Penis envy, n.:
- The desire to be pink and wrinkled and about four inches long.
-%
-People humiliating a salami!
-%
-People who develop the habit of thinking of themselves as world
-citizens are fulfilling the first requirement of sanity in our time.
- -- Norman Cousins
-%
-People who live in glass houses should ball in the basement.
-%
-People will swim through shit if you put a few bob in it.
- -- Peter Sellers
-%
-Perhaps at fourteen every boy should be in love with some ideal woman to put
-on a pedestal and worship. As he grows up, of course, he will put her on
-a pedestal the better to view her legs.
- -- Barry Norman, in "The Listener"
-%
-Perplexed, a shy virgin named Plummer
-Asked, "what's there to do in the summer?"
- She declined and declined
- Till approached from behind...
-When her summer turned out quite a bummer!
-%
-Persistence, like perspiration, is 99 percent of the fine art of love.
-%
-Philadelphia flying fuck, n.:
- Okay, see, he hangs from a chin-up bar with his feet on the arms
- of the rocking chair. She crouches in the rocking chair pleasuring
- him orally.
-
- [Note: Personally, we've never tried this. If you have, or if
- you do, please inform us of the results at Fortune, Box 1597,
- Rockville IL. Thank you. Ed.]
-%
-Philosophy is to the real world as masturbation is to sex.
- -- Karl Marx
-%
-Physicists do it with charm.
-%
-Picking up a man in a bar is like a snowstorm, you never know when
-he's coming, how many inches you'll get or how long he'll stay.
-%
-Pile driver, n.:
- Local drink; two parts vodka, one part prune juice.
-%
-Planned Parenthood:
- The emission Control Center.
-%
-PLATONIC FRIENDSHIP:
- What develops when two people get
- tired of making love to each other.
-%
-Playing poker with busty Ms. Ware,
-He announced as he folded with flair,
- "I had four of a kind,
- But those aces combined,
-Don't stack up, I'm afraid, with your pair."
-%
-PLUNDERER'S THEME
- (to Supercalifragilisticexpialidocius)
-
-Pillage, rape, and loot and burn, but all in moderation.
-If you do the things we say, then you'll soon rule the nation.
-Kill your foes and enemies and then kill your relations.
-Pillage, rape, and loot and burn, but all in moderation.
-%
-Pocket pool, n.:
- Well, for guys, it's two-ball in the side pocket.
- For women, it's playing the slots.
-%
-Polish fly, n.:
- You put it in her drink and she begs you to take her bowling.
-%
-Politicians do it to everyone.
-%
-Pompoir: The most sought-after feminine sexual response of all.
-
-'She must... close and constrict the Yoni until it holds the Lingam as with
-a finger, opening and shutting at her pleasure, and finally acting as the
-hand of the Gopala-girl who milks the cow. This can be learned only by long
-practice, and especially by throwing the will into the part affected, even
-as men endeavor to sharpen their hearing... Her husband will then value her
-above all other women, nor would he exchange her for the most beautiful
-queen in the Three Worlds... Among some races the constrictor vaginae muscles
-are abnormally developed. In Abyssinia for instance, a woman can so exert
-them as to cause pain to a man, and when sitting on his thighs, she can
-induce orgasm without moving any other part of her person. Such an artist
-is called by the Arabs Kabbazah, literally, a holder, and it's not surprising
-that slave dealers pay large sums for her' Thus Richard Burton. It has
-nothing to do with 'race' but a lot to do with practice. See exercises.
- -- The Joy of Sex
-%
-Poor Alice who lived in Corvallis
-Had heard of, but not seen, the male phallus.
- At her first sight of one
- She started to run,
-And last was seen sprinting through Dallas.
-%
-Posterity will ne'er survey
-A nobler grave than this;
-Here lie the bones of Castlereagh;
-Stop, traveler, and piss.
- -- Lord Byron, on Lord Castlereagh
-%
-Pour guerir un acces de fievre
-Un jeune homme poursuivit un lievre;
- Il le prit a son trou,
- Et fit faire un ragout
-Des entrailles et des pattes au genievre.
- -- Edward Gorey
-%
-Pouring out his troubles to his best friend over a couple of triple martinis,
-Brad had to confess that things weren't going too well at home. "My wife and
-I just don't hit it off at night," he was saying to Bart. "I hate to admit
-it, but I'm afraid I just don't know how to make her happy."
- "Hell, boy," said Bart, "there's really nothing to it. Let me
-give you some advice. At bedtime, switch on a new Sinatra platter, turn
-all the lights low and spray some perfume around the room. Next, tell
-your wife to get into her sheerest nightie; then make sure you raise the
-bottom window."
- "Then what do I do?" asked Brad.
- "Just whistle."
- "Whistle?"
- "That's right. I'll be waiting outside the window. When I hear
-you whistle, I'll come right up and finish the job."
-%
-Pregnancy -- the worst sexually transmitted disease of them all.
-%
-Pregnancy begins with a single sell.
-%
-Premature ejaculation, n.:
- A spoilspurt.
-%
-Premature ejaculator, n.:
- Troubled shooter.
-%
-Premenstrual Syndrome:
- Just before their periods women behave the way men do all the time.
-%
-Prince Absalom lay with his sister
-And bundled and nibbled and kissed her,
- But the kid was so tight,
- And it was deep night --
-Though he shot at the target, he missed her.
-%
-Printers do it without wrinkling the sheets.
-%
-Prior to this year's Rock & Roll Hall of Fame ceremony, [Cash] went to
-the bathroom. "I was standing at the urinal, and Keith Richards walked
-in... He said, 'Look at this, I'm pissing with Johnny Cash. We need a
-picture of this.' I said, 'No, Keith, we *don't* need a picture of this.'"
- -- Rolling Stone interview with Johnny Cash
-%
-Procrastinators do it tomorrow.
-%
-Programmers do it bit by bit.
-%
-Programmers do it until it goes down.
-%
-Programmers get overlaid.
-%
-PROMOTION:
- New title, new salary, new office, same old crap.
-%
-Prope mare erat tubulator
-Qui virginem ingrediebatur.
- Dessine ingressus
- Audivi progressus:
-Est mihi inquit tubulator.
-%
-Prostitution is the only business where you can go into the hole and
-still come out ahead.
-%
-Psychiatrists say that one out of four people are mentally ill.
-Check three friends. If they're okay, you're it.
-%
-Psychiatry is quite similar to prostitution, only less honest. They
-both promise to make people feel better, but the prostitute doesn't
-make pretensions that the feelings will last once the client walks
-out the door.
-%
-Pubic hair, n.:
- Organic dental floss.
-%
-Puff the Jewish dragon lived in Palestine,
-And frolicked in the Autumn mist,
-And drank Manishiewitz wine.
-Little Rabbi Jacob loved that rascal Puff,
-And brought him soup and Matzah balls,
-And other kosher stuff.
-
-Then one day it happened, Puff was eating pork.
-Little Rabbi Jacob took that dragon for a walk.
-Gently he explained that dragons don't eat meat,
-That come from little piggies who have dirty filthy feet.
-%
-Q: Do you know how to tell a Polack at a cockfight?
-A: He's the only one with a duck.
-
-Q: Do you know how to tell an Aggie at a cockfight?
-A: He's the only one who bets on the duck.
-
-Q: And do you know how to tell the Mafia is at the cockfight?
-A: The duck wins!
-%
-Q: Have you ever been picked up by the fuzz?
-A: No, but I bet it hurts like hell.
-%
-Q: Heard about the <ethnic> who couldn't spell?
-A: He spent the night in a warehouse.
-%
-Q: How can a real man tell when his girl friend's having an orgasm.
-A: Real men don't care.
-%
-Q: How can you tell if a woman is ticklish?
-A: Give her a couple of test tickles.
-%
-Q: How can you tell the bride at a WASP wedding?
-A: She's the one kissing the golden retriever.
-%
-Q: How can you tell when a Polish girl's been sucking cock?
-A: She has a mouthful of feathers.
-%
-Q: How can you tell when a WASP is sexually aroused?
-A: By the stiff upper lip.
-%
-Q: How can you tell when your girlfriend has had an orgasm?
-A: Who cares?
-%
-Q: How did Hellen Keller burn the side of her face?
-A: She answered the iron.
-
-Q: How did she burn the other side of her face?
-A: They called back.
-%
-Q: How do you fit 1000 dead babies into a phone booth?
-A: Cusinart.
-
-Q: How do you get them back out?
-A: Doritos.
-%
-Q: How do you get a woman to stop having sex with you?
-A: Propose.
-%
-Q: How do you hide an elephant in a cherry tree?
-A: Paint his balls red and his toenails green.
-
-Q: Ever see an elephant in a cherry tree?
-A: No -- so it must work pretty well!
-
-Q: How did Tarzan die?
-A: Picking cherries!!!
-%
-Q: How do you know when it's time to wash the dishes?
-A: Look inside your pants; if you have a penis, it's not time.
-%
-Q: How do you know your elephant had her period?
-A: There's a nickel on your dresser and your mattress is missing.
-%
-Q: How do you make a dead baby float?
-A: With 2 scoops of dead baby and some rootbeer.
-%
-Q: How do you pick up a quarter off of Polk Street?
-A: Kick it over to Van Ness.
-%
-Q: How do you play religious roulette?
-A: You stand around in a circle and blaspheme and see who gets struck
- by lightning first.
-%
-Q: How do you tell if an elephant has been making love in your
- backyard?
-A: If all your trashcan liners are missing ...
-%
-Q: How do you tell if you're making love to a nurse, a schoolteacher,
- or an airline stewardess?
-A: A nurse says: "This won't hurt a bit."
- A schoolteacher says: "We're just going to have to do this over
- and over again until we get it right."
- An airline stewardess says: "Hold this over your mouth and
- nose, and breathe normally."
-
-... and bank tellers say "Substantial penalty for early withdrawal."
-... and saleswomen say "Thank you, come again soon!"
-... and WASPs say "Do you have that in a bigger size?"
-... and piano teachers say "Keep those fingers arched! TEMPO! TEMPO!"
-%
-Q: How do you tell that your roommate's gay?
-A: When his cock tastes like shit.
-%
-Q: How does a girl know she's sleeping with a Computer Scientist?
-A: It isn't hard.
-%
-Q: How does a mink get babies?
-A: The same way babies get minks.
-%
-Q: How does the Polish Constitution differ from the American?
-A: Under the Polish Constitution citizens are guaranteed freedom of
- speech, but under the United States constitution they are
- guaranteed freedom after speech.
- -- being told in Poland, 1987
-%
-Q: How many Aggies does it take to eat an armadillo?
-A: Three, one to eat it, and two to watch for traffic.
-%
-Q: How many Christians does it take to change a light bulb?
-A: Three, but they're really only one.
-%
-Q: How many feminists does it take to screw in a lightbulb?
-A: NONE! AND THAT'S NOT FUNNY!!
-
-Q: How many Radcliffe girls does it take to change a light bulb?
-A: It's "Women"... AND IT'S NOT FUNNY!!
-%
-Q: How many gradual (sorry, that's supposed to be "graduate") students
- does it take to screw in a lightbulb?
-A: "I'm afraid we don't know, but make my stipend tax-free, give my
- advisor a $30,000 grant of the taxpayer's money, and I'm sure he
- can tell me how to do the shit work for him so he can take the
- credit for answering this incredibly vital question."
-%
-Q: How many heterosexual males does it take to screw in a light
- bulb, in San Francisco?
-A: Both of them.
-%
-Q: How many right-to-lifers does it take to change a light bulb?
-A: Two. One to screw it in and one to say that light started when the
- screwing began.
-%
-Q: How many supply-siders does it take to change a light bulb?
-A: None. The darkness will cause the light bulb to change by itself.
-%
-Q: How much money do you give to a 900 foot Jesus?
-A: As much as he wants.
-%
-Q: If Tarzan was Jewish, and Jane was a princess, what would
- Cheetah be?
-A: A fur coat.
-%
-Q: What did Jesus tell the Aggies?
-A: Play dumb until the second coming.
-%
-Q: What did the little ghetto-dweller get for Christmas?
-A: Your bicycle.
-%
-Q: What do a walrus and a tupperware container have in common?
-A: They both like a tight seal.
-%
-Q: What do agnostic, insomniac dyslexics do at night?
-A: Stay awake and wonder if there's a dog.
-%
-Q: What do elephants use instead of tampons?
-A: Sheep. Well, they used to, anyway. There have been so many cases
- of Toxic Flock Syndrome recently that their ewes has been discouraged.
-
-Q: Why do elephants have trunks?
-A: Sheep don't have strings.
-%
-Q: What do two WASPs say after making love?
-A: Thank you very much. It'll never happen again.
-%
-Q: What do you call a blind, deaf-mute, quadriplegic Virginian?
-A: Trustworthy.
-%
-Q: What do you call a nun who has had a sex change operation?
-A: A transistor.
-%
-Q: What do you call a truck load of vibrators?
-A: Toys for twats.
-%
-Q: What do you call a woman who can suck a golf ball through 50 feet
- of garden hose?
-A: Darling.
- [Often? Ed.]
-%
-Q: What do you call couples that use that rhythm method?
-A: Parents.
-%
-Q: What do you do if an Irishman throws a pin at you?
-A: Run like hell, he's got a grenade in his mouth!!
-%
-Q: What do you do with an elephant with three balls?
-A: Walk him and pitch to the rhino.
-%
-Q: What do you get when you cross a lawyer with a sorority girl??
-A: A woman that, when she goes down on you, gets blood.
-%
-Q: What do you get when you cross a computer and a JAP?
-A: A computer that won't go down.
-%
-Q: What do you get when you cross a pit bull with a prostitute?
-A: Your last blowjob.
-%
-Q: What do you get when you cross a rooster with a telephone pole?
-A: A thirty foot cock that wants to reach out and touch someone!
-%
-Q: What do you get when you cross an onion with a donkey?
-A: Well, most of the time you get an onion with big ears, but every
- once in a while you get a piece of ass that will bring tears to
- your eyes...
-%
-Q: What do you get when you cross James Dean with Ronald Reagan?
-A: A rebel without a clue.
-%
-Q: What do you have if you have a moth ball in one hand and a
- moth ball in the other hand?
-A: One hell of a big moth!
-%
-Q: What do you say to a New Yorker with a job?
-A: Big Mac, fries and a Coke, please!
-%
-Q: What do you say to a Puerto Rican in a three-piece suit?
-A: Will the defendant please rise?
-%
-Q: What does friendship among Soviet nationalities mean?
-A: It means that the Armenians take the Russians by the hand; the
- Russians take the Ukrainians by the hand; the Ukrainians take
- the Uzbeks by the hand; and they all go and beat up the Jews.
-%
-Q: What goes
- Click. "Did I get it?"
- Click. "Did I get it?"
- Click. "Did I get it?"
- Click. "Did I get it?"
-A: Stevie Wonder doing the Rubik's Cube.
-%
-Q: What goes green, red, green, red, pink, pink, pink?
-A: A frog in a blender.
-
-Q: What do you get if you add 2 eggs to it??
-A: Frognogg. If you drink it, you croak.
-%
-Q: What goes red, white, red, white, pink, pink, pink?
-A: Baby in a blender.
-
-Q: Why do you put a baby in a blender feet first?
-A: So you can watch the expression on its little face.
-%
-Q: What is green and comes in Brownies?
-A: Boy Scouts.
-%
-Q: What is "SMOORPLAY"?
-A: It's what SMURFS do before they SMUCK, of course!
-%
-Q: What is the difference between snow-men and snow-women?
-A: Snowballs!
-%
-Q: What is the worst story Helen Keller ever read?
-A: A cheese grater.
-%
-Q: What's a JAP's (Jewish American Princess) dream house?
-A: Fourteen rooms in Scarsdale, no kitchen, no bedroom.
-%
-Q: What's a WASP's idea of open-mindedness?
-A: Dating a Canadian.
-%
-Q: What's black and white and red all over and can't go through
- revolving doors?
-A: A nun with a javelin through her head.
-%
-Q: What's black and white and red all over?
-A: Half a nun.
-%
-Q: What's buried in Grant's tomb?
-A: A corpse.
-%
-Q: What's hard going in and soft and sticky coming out?
-A: Chewing gum.
-%
-Q: What's invisible and smells like carrots?
-A: Bunny farts.
-%
-Q: What's Jewish foreplay?
-A: Two hours of begging.
-%
-Q: What's meaner than a pit bull with AIDS?
-A: The guy that gave it to him.
-%
-Q: What's more fearsome than a grizzly bear with AIDS?
-A: The guy he got it from.
-%
-Q: What's red and covered with little dents?
-A: Snow White's cherry.
-%
-Q: What's the contour integral around Western Europe?
-A: Zero, because all the Poles are in Eastern Europe!
-
-Addendum: Actually, there ARE some Poles in Western Europe, but they
- are removable!
-
-Q: An English mathematician (I forgot who) was asked by his
- very religious colleague: Do you believe in one God?
-A: Yes, up to isomorphism!
-
-Q: What is a compact city?
-A: It's a city that can be guarded by finitely many near-sighted
- policemen!
- -- Peter Lax
-%
-Q: What's the difference between a cocker spaniel and a doberman
- pinscher humping your leg?
-A: You let the doberman finish.
-%
-Q: What's the difference between a dog and a fox?
-A: About four drinks.
-%
-Q: What's the difference between a Fairy Tale, and a War Story?
-A: Nothing, except Fairy Tales start off with "Once upon a time".
- War Stories start off with "No shit, this really happened".
-
- [I thought Fairy Tales started off, "Honey, I'm gonna be at the
- office a little late, tonight... Ed.]
-%
-Q: What's the difference between a hold-up and a stick-up?
-A: Age.
-%
-Q: What's the difference between a JAP and a baby elephant?
-A: About 10 pounds.
-
-Q: How do you make them the same?
-A: Force feed the elephant.
-%
-Q: What's the difference between a man and a toilet?
-A: A toilet doesn't follow you around for a week after you flush it.
-%
-Q: What's the difference between a man and the weekend?
-A: The weekend never comes too soon.
-%
-Q: What's the difference between a sorority girl and a fast car?
-A: Not everyone's been in a fast car.
-%
-Q: What's the difference between an oral and a rectal thermometer?
-A: The taste.
-%
-Q: What's the difference between erotic and kinky?
-A: Erotic is when you use a feather. Kinky is when you use
- the whole bird.
-%
-Q: What's the difference between George Washington, Richard Nixon
- and Ronald Reagan?
-A: One always told the truth, one always lied, and one can't tell the
- difference.
-%
-Q: What's the difference between hard and dark?
-A: It stays dark all night.
-%
-Q: What's the difference between "Oooh" and "Aaah"?
-A: About three inches.
-%
-Q: What's the difference between the 1950's and the 1980's?
-A: In the 80's, a man walks into a drugstore and states loudly, "I'd
- like some condoms," and then, leaning over the counter, whispers,
- "and some cigarettes."
-%
-Q: What's the difference between VMS and PMS?
-
-A1: PMS is only a problem for some people.
-A2: PMS is only a problem for part of the month.
-A3: The drugstore has remedies for PMS.
-A4: People with PMS get sympathy.
-A5: People with PMS don't wish they were UNIX.
-%
-Q: What's the last thing that goes through a grasshopper's mind when
- he hits your windshield?
-A: His ass.
-
-Q: What's the second-to-last thing to go through a grasshopper's
- mind when he hits your windshield?
-A: Oh, SHIT!!
-%
-Q: What's white and crawls up your leg?
-A: Uncle Ben's Perverted Rice.
-%
-Q: What's worse than getting raped by Jack the Ripper?
-A: Getting fingered by Captain Hook!
-%
-Q: Where can you buy black lace crotchless panties for sheep?
-A: Fredrick's of Ithaca, New York.
-%
-Q: Where does Catwoman go for a good time?
-A: To the batpoles, Robin!
-%
-Q: Where does virgin wool come from?
-A: Ugly sheep.
-%
-Q: Why are babies born with soft spots on their heads?
-A: So you can pick 'em up five at a time.
-%
-Q: Why are Unix emulators like your right hand?
-A: They're just pussy substitutes!
-%
-Q: Why can't Hellen Keller have children?
-A: Because she's dead.
-%
-Q: Why did Captain Kirk piss on the bridge?
-A: He wanted to boldly go where no man had gone before!
-%
-Q: Why did God invent booze?
-A: So ugly men could get laid too.
-%
-Q: Why did Hellen Keller go all the way on her first date?
-A: She'd never been taught to say no.
-%
-Q: Why did Menachem Begin invade Lebanon?
-A: To impress Jodie Foster.
-%
-Q: Why did Ted Kennedy report the accident 8 hours after Mary
- Jo Kopechne drowned?
-A: Do you have any idea how hard it is to dress a woman underwater?
-%
-Q: Why did the epileptic cross the road?
-A: He couldn't help it.
-
-Q: What do you do if an epileptic has a seizure in the bathtub?
-A: Throw in the dirty clothes and some laundry detergent.
-%
-Q: Why do dogs lick their private parts?
-A: Because they can.
-%
-Q: Why do ducks have webbed feet?
-A: To stamp out forest fires.
-
-Q: Why do elephants have big flat feet?
-A: To stamp out flaming ducks.
-%
-Q: Why do elephants wear springs on their feet?
-A: So they can jump into trees and rape mice.
-
-Q: What is the most fearsome sound in the world to a mouse?
-A: BOING!! BOING!! BOING!!
-%
-Q: Why do men die before their wives?
-A: They want to.
-%
-Q: Why do men marry women?
-A: You can't teach sheep to do housework.
-%
-Q: Why do mice have such small balls?
-A: Very few of them know how to dance!
-%
-Q: Why do Scotsmen wear kilts?
-A: Because a sheep can hear the sound of a zipper from fifty feet away.
- -- Iain MacKintosh, Glasgow folksinger
-%
-Q: Why do WASPs play golf?
-A: So they can dress like pimps.
-%
-Q: Why do women have vaginas?
-A: So when they're drunk, you can carry them like a six-pack.
-%
-Q: Why do women love Pacman?
-A: Only place you can get eaten three times for a quarter.
-%
-Q: Why does an elephant have 4 feet?
-A: Because 8 inches isn't enough.
-%
-Q: Why does Helen Keller masturbate with one hand?
-A: So she can moan with the other!
-%
-Q: Why don't blind people skydive?
-A: It scares the dogs!
-
-Q: How can a blind skydiver tell when he is near the ground?
-A: The leash goes slack.
-%
-Q: Why is it that Mexico isn't sending anyone to the '84 summer games?
-A: Anyone in Mexico who can run, swim or jump is already in LA.
-%
-Q: Why is Poland just like the United States?
-A: In the United States you can't buy anything for zlotys and in
- Poland you can't either, while in the U.S. you can get whatever
- you want for dollars, just as you can in Poland.
- -- being told in Poland, 1987
-%
-Q: Why is Sister Pat the way she is?
-A: Because when she was 16, a group of boys tied her up and
- gang-rejected her.
-%
-Q: Why was Cinderella banished from the Magic Kingdom?
-A: For sitting on Pinocchio's face and screaming, "Tell the truth!
- Tell a lie! Tell the truth! Tell a lie!"
-%
-QOTD:
- "... was it a dream where you see yourself standing in sort-of
- Sun-God robes, on a pyramid, with a thousand naked women screaming
- and throwing little pickles at you? ... Why am I the only one
- who has that dream?"
-%
-QOTD:
- "Are you into casual sex, or should I dress up?"
-%
-QOTD:
- "Do you smell something burning or is it me?"
- -- Joan of Arc
-%
-QOTD:
- "Even the Statue of Liberty shaves her pits."
-%
-QOTD:
- "He's on the same bus, but he's sure as hell got a different
- ticket."
-%
-QOTD:
- "He's so egotistical he yells his own name when he comes."
-%
-QOTD:
- "I don't give a flying fuck at a rolling doughnut."
-%
-QOTD:
- "I get girls because of who I am... a rapist."
-%
-QOTD:
- "I met her [his fiance] over lunch on Thursday. She had a firm
- grip. He's a lucky man."
-%
-QOTD:
- "I never met a man I couldn't drink handsome."
-%
-QOTD:
- "I say, and without apology, hang the bitch."
-%
-QOTD:
- "I used to beat off so much in the shower, I'd get a hard on every
- time it rained."
-%
-QOTD:
- "I was a fifty-four-year-old virgin, but I'm all right now."
-%
-QOTD:
- "I won't say he's unsavory, but for his birthday he bought himself
- a pair of velcro gloves."
-%
-QOTD:
- "I'd crawl a mile over burning desert sand just to kiss the dick of
- the guy who screwed her last."
-%
-QOTD:
- "I'd drag my dick a mile over broken glass just to masturbate in
- her shadow!"
-%
-QOTD:
- "I'd never marry a woman who didn't like pizza... I might play
- golf with her, but I wouldn't marry her!"
-%
-QOTD:
- "It *was* wonderfully polite of me. Usually I call the kind of
- cretinous dipshit that pisses me off a 'fucking asshole.'"
- -- Richard Sexton
-%
-QOTD:
- "Let go of my ears, I know what I'm doing!"
-%
-QOTD:
- "Men come in four sizes -- small, medium, large, and 'You're
- going to put that thing *where*?'"
-%
-QOTD:
- "My penis is better than corn, because corn doesn't squeal when
- you stick those little prongs into it."
- -- Mark-Jason Dominus
-%
-QOTD:
- "No, honey, I've never been circumsized;
- it's simply wear and tear."
-%
-QOTD:
- "One day, I'd like to wake up in the morning to find that every
- gay and lesbian has lavender skin. On that morning, I will be
- -- mauve."
-%
-QOTD:
- "Sex is like everything else. To get it done right, do it yourself."
-%
-QOTD:
- "She began coming, making noises like a small animal in pain.
- Ouch! Ow! My paw! Ouch!!"
-%
-QOTD:
- "She was so tough she rolled her own tampons."
-%
-QOTD:
- "Talk about willing people... over half of them are willing to work
- and the others are more than willing to watch them."
-%
-QOTD:
- "The marines and I have something in common; we're both looking for
- a few good men!"
-%
-QOTD:
- "The only real difference between men and women is that men are
- crabby all month long."
-%
-QOTD:
- "Well, let's say she's friendly. Last year she was the Herpes
- Poster Girl."
-%
-QOTD:
- "What would the world be like without men? A lot of fat,
- happy women."
-%
-QOTD:
- "When she hauled ass, it took three trips."
-%
-QOTD:
- "Whhoooooooeeeeeeeeeee, Elmer! Take a look at that purty young lady
- over thar! Why, I'd walk a mile barefoot over barbed wire and broken
- glass just to drive the truck that takes her panties to the cleaners!"
-%
-QOTD:
- "Whip me, beat me, come all over me, tell me you love me.
- Then get the fuck out."
-%
-QOTD:
- "You might as well say "yes", the sheets are messy already."
-%
-Queensboro president Donald Mannis, charged with receiving bribes in
-exchange for city contracts, resigned on Tuesday. Mannis feels he must
-devote more time to impending litigation, some of which might emanate
-from a recent statement he made comparing New York Mayor Ed Koch to
-Nazi Martin Bormann. A spokesman from the Bormann estate said they are
-weighing the odds of a slander suit. Mayor Koch could naturally be
-reached for comment, but we chose not to listen.
- -- Dennis Miller, "Saturday Night Live"
-%
-Quickie, n.:
- A moment's piece.
-%
-Quickie, n.:
- No sooner spread than done.
-%
-QWERT (kwirt) n. [MW < OW qwertyuiop, a thirteenth] 1. a unit of weight
-equal to 13 poiuyt avoirdupois (or 1.69 kiloliks), commonly used in
-structural engineering 2. [Colloq.] one thirteenth the load that a fully
-grown sligo can carry. 3. [Anat.] a painful irritation of the dermis
-in the region of the anus 4. [Slang] person who excites in others the
-symptoms of a qwert.
- -- Webster's Middle World Dictionary, 4th ed.
-%
-Ralph: Lisa, you have no tits and an awful tight pussy.
-Lisa: Ralph... get off my back!!
-%
-Randel, n.:
- A nonsensical poem recited by Irish schoolboys as an apology
-for farting at a friend.
- -- Mrs. Byrne's Dictionary of Unusual, Obscure, and
- Preposterous Words
-%
-Raquel Welch: 36-24-36
-Bo Derek: 35-24-36
-Ann-Margaret: 37-25-36
-Bette Middler: 37-25-36
-Marilyn Monroe: 37-24-37
-Jane Russell: 39-27-38
-Jayne Mansfield: 40-23-37
-Sophia Loren: 37-25-36
-%
-Rating women on the Budweiser scale; the number
-of Clydesdales it would take to pull you off her.
-%
-Reach out and fuck someone.
-%
-Readers Ask:
- Is it possible to kill a vampire with a gun?
-
-Vampires are a source of great irritation to the average homeowner and it is
-usually to one's advantage to remove these pests as rapidly as possible. If
-a professional exterminator specializing in the undead is unavailable, it is
-possible to handle the situation with common household items. However, much
-of the common folklore of vanquishing the undead needs clarifying. First,
-driving a sharpened Louisville Slugger through a vampire's heart will NOT kill
-it. Since it's not quite alive, why would the heart be any different than
-puncturing it in the, for example, left buttock? Stake driving should be
-avoided at any cost since its effect will be to terribly annoy the vampire,
-and the last thing you want on your hands is an irate Lord of Darkness.
-Handguns are also a definite no-no. Common sense indicates that it requires
-more to defeat an incarnation of evil than hurling lumps of lead or silver
-through its body. One time-honored method is to expose the vampire to the
-sun, sever its head (any power saw should be sufficient), fill its mouth with
-holy wafers (vanilla wafers over which the Lord's prayer has been read will
-do in a pinch), immerse the head in an urn filled with holy water, place the
-urn in consecrated lands and bury the rest of the body underneath a crossroad
-(i.e. the intersection of Broad & Chestnut). Sure, it's a lot of work. But
-you'll never have to worry about those damn bats pestering the neighbors again.
-%
-Reagan can't _a_c_t, either.
-%
-Real buddy, n.:
- Someone who'll go downtown and get two blowjobs, and come back
- and give you one.
-%
-Real class, adj.:
- When you're by yourself, fart, and say "Excuse me."
-%
-Real fur: the ultimate sadist symbol.
-%
-Reformed, n.:
- A synagogue that closes for the Jewish holidays.
-%
-Rejection, n.:
- When you're masturbating and your hand falls asleep.
-%
-Religion is fine, Churchianity sucks.
-%
-Remember, there's a big difference between kneeling down and bending over.
- -- Frank Zappa
-%
-Remember, when preparing a dish for bedtime,
-champagne is the best tenderizer.
-%
-Remember when you were a kid and the boys didn't like the girls? Only
-sissies liked girls? What I'm trying to tell you is that nothing's
-changed. You think boys grow out of not liking girls, but we don't
-grow out of it. We just grow horny. That's the problem. We mix up
-liking pussy for liking girls. Believe me, one couldn't have less to
-do with the other.
- -- Jules Feiffer
-%
-Republicans raise dahlias, Dalmatians and eyebrows.
-Democrats raise Airedales, kids and taxes.
-
-Democrats eat the fish they catch.
-Republicans hang them on the wall.
-
-Republican boys date Democratic girls. They plan to marry Republican
-girls, but feel they're entitled to a little fun first.
-
-Democrats make up plans and then do something else.
-Republicans follow the plans their grandfathers made.
-
-Republicans sleep in twin beds -- some even in separate rooms.
-That is why there are more Democrats.
- -- Paul Dickson, "The Official Rules"
-%
-Republicans tend to keep their shades drawn, although there is seldom
-any reason why they should. Democrats ought to, but don't.
-%
-Returning from the men's room, a bar customer was sadly, shaking his head.
- "What's the matter, buddy?", inquired the bartender.
- "Well," replied the customer, "while I was in the men's room, I saw
-someone had scribbled `Wendy gives really fabulous head; absolutely the best
-blow job in the world!' on the wall."
- "Ahh, hell," said the bartender. "Don't give it a second thought,
-we get jerks in here like anywhere else."
- "I know," snarled the headshaker. "One of them scratched out the
-phone number!"
-%
-Revenge is sleeping with your enemy's wife.
-Sweet revenge is the realization that she's a lousy lay.
-%
-Rodeo fuck, n.:
- When you lean down and whisper in your lover's ear, "Honey, you're
- the worst piece of ass I've ever had!". And then try to stay on
- for seven seconds...
-%
-Rogue players do it with all sorts of different animals.
-%
-Roland was a warrior, from the land of the midnight sun,
-With a Thompson gun for hire, fighting to be done.
-The deal was made in Denmark, on a dark and stormy day,
-So he set out for Biafra, to join the bloody fray.
-Through sixty-six and seven, they fought the Congo war,
-With their fingers on their triggers, knee deep in gore.
-Days and nights they battled, the Bantu to their knees,
-They killed to earn their living, and to help out the Congolese.
- Roland the Thompson gunner...
-His comrades fought beside him, Van Owen and the rest,
-But of all the Thompson gunners, Roland was the best.
-So the C.I.A decided, they wanted Roland dead,
-That son-of-a-bitch Van Owen, blew off Roland's head.
- Roland the headless Thompson gunner...
-Roland searched the continent, for the man who'd done him in.
-He found him in Mombasa, in a bar room drinking gin,
-Roland aimed his Thompson gun, he didn't say a word,
-But he blew Van Owen's body from there to Johannesburg.
-The eternal Thompson gunner, still wandering through the night,
-Now it's ten years later, but he stills keeps up the fight.
-In Ireland, in Lebanon, in Palestine, in Berkeley,
-Patty Hearst... heard the burst... of Roland's Thompson gun, and bought it.
- -- Warren Zevon, "Roland the Headless Thompson Gunner"
-%
-Ronald Reagan -- America's favorite placebo
-%
-Roses on your piano isn't nearly as good as tulips on your organ.
-%
-Roumanian-Yiddish cooking has killed more Jews than Hitler.
- -- Zero Mostel
-%
-Rugby is a game played by men with peculiarly shaped balls.
-%
-Rugby, n.:
- A sport requiring leather balls.
-%
-Rumour has it that the intrepid New Zealanders have finally discovered
-two new uses for sheep. Meat and wool.
-%
-Runners do it alone.
-%
-Said a dainty young whore named Ms. Meggs,
-"The men like to spread my two legs,
- Then slip in between,
- If you know what I mean,
-And leave me the white of their eggs."
-%
-Said a decadent wench of Bombay:
-"This has been a most wonderful day.
- Three cherry tarts,
- At least twenty farts,
-Two shits, and a bloody fine lay."
-%
-Said a girl who upon her divan
-Was attacked by a virile young man:
- "Such excess of passion
- Is quite out of fashion"
-And she fractured his wrist with her fan.
- -- Edward Gorey
-%
-Said a happy young man of Fort Drum:
-"What care I for this shortage of gum?
- My favorite chew
- Is a condom or two,
-With a goodly amount of fresh come."
-%
-Said a horny young girl from Milpitas,
-"My favorite sport is coitus."
- But a fullback from State
- Made her period late,
-And now she has athlete's fetus.
-%
-Said a lecherous fellow named Shea,
-When his prick wouldn't rise for a lay,
- "You must seize it, and squeeze it,
- And tease it, and please it,
-For Rome wasn't built in a day."
-%
-Said a lesbian lady, "It's sad;
-Of all the girls that I've had,
- None gave me the thrill
- Of real rapture until
-I learned how to be a tribade."
-%
-Said a madam named Mamie La Farge
-To a sailor just off of a barge,
- "We have one girl that's dead,
- With a hole in her head--
-Of course there's a slight extra charge."
-%
-Said a modest young miss to de Sade,
-I'm simply too shy and afraid
- To take part in your pranks.
- But to show you my thanks,
-I'd just love to become your first aide.
-%
-Said a pornographistic young poet
-"Although I perhaps do not show it,
- My interest in sin
- Is wearing quite thin,
-And I'll soon tell those fuckers to stow it."
-%
-Said crew girl Angelica Bauer:
-"The captain's withdrawn, cold, and sour."
- Uhura said, "No,
- At night that's not so--
-He doesn't withdraw for an hour."
-%
-Said Einstein, "I have an equation
-Which to some may seem Rabelaisian:
- Let _V be virginity
- Approaching infinity;
-Let _P be a constant persuasion;
-
-"Let _V over _P be inverted
-With the square root of _M_u inserted
- _N times into _V ...
- The result, Q.E.D.,
-Is a relative!" Einstein asserted.
-%
-Said Francesca, "My lack of volition
-Is leading me straight to perdition;
- But I haven't the strength
- To go to the length
-Of making an act of contrition."
- -- Edward Gorey
-%
-Said President Jobcock one day:
-"War's better than love, I should say.
- Instead of a virgin,
- It's murder I'm urgin'--
-You get lots more blood that-a-way."
-%
-Said sneering Mohammed el-Din:
-"Only infidel dogs put it in.
- Back home in Arabia
- We nibble the labia
-Till the juice dribbles off of our chin."
-%
-Said the cunt-lapping Bey of Algiers,
-In a cunt halfway up to his ears:
- "This nautch is delicious,
- And without doubt nutritious.
-She's my best-tasting wife in ten years!"
-%
-Said the Duchess of Danzer at tea,
-"Young man, do you fart when you pee?"
- I replied with some wit,
- "Do you belch when you shit?"
-I think that was one up for me.
-%
-Said the nun as the bishop withdrew,
-"This must be our final adieu,
- For the vicar is slicker,
- And thicker, and quicker,
-And two inches longer than you."
-%
-Saint Peteer was once heard to boast
-That he'd had all the heavenly host:
- The Father and Son,
- And then - just for fun -
-The hole in the Holy Ghost.
-%
-Sam Lefkovitz is having an intimate party to celebrate his thirty
-immensely profitable years in the construction business.
- "You know," he laments to his friends, "over the years I have
-constructed dozens of enormous projects in and around this city, but
-am I known as Sam the Builder? No.
- And over the years I have contributed literally millions of
-dollars to charitable causes of one sort or another, but am I called
-Sam the Philanthropist? No sir!
- But suck one little cock..."
-%
-San Francisco:
- A nice place to visit, but I wouldn't want to tie my shoelaces
- there.
-%
-San Francisco is my kind of city,
-Where the women are strong and the men are pretty.
-%
-Save a forest -- eat a beaver!
-%
-Save a mouse, eat a pussy!
-%
-Save Soviet Jewry -- Win Valuable Prizes!!!!
-%
-Save the whales. Club a seal instead.
-%
-Says an airlining wanton named Vi:
-"I'm a pantyless stew when I fly.
- To a muffer's delight,
- I'll take head on a flight,
-So the guy can have pie in the sky."
-%
-Schnuffel, n.:
- A dog's practice of continuously nuzzling in your crotch in
- mixed company.
- -- Rich Hall, "Sniglets"
-%
-"Scott, baby," the sexually aggressive girl murmured as she guided
-her date's finger to her clitoris, "This bud's for you."
-%
-Scratch the average female and you'll find a purring bundle... at the
-ready to love and honor, bake a torte and still produce quintuplets.
- -- Edgar Berman
-%
-SDW/M, 35, offers French lessons for ladies.
-If you desire fluency in the French tongue,
-this cunning linguist can lick your problem.
-
-Fortune -- P.O. Box 478
-%
-Secrets to a happy marriage
- 1. It is important to find a woman that cooks and cleans.
- 2. It is important to find a woman that makes good money.
- 3. It is important to find a woman that likes to have sex.
- 4. It is important that these three women never meet your wife.
-%
-Seems like there were these two dogs in a vet's waiting room, each eyeing
-the other suspiciously. One of them turns to the other.
- "What are you here for?" he asks.
- "Well," replies the other, "I was feeling really bad the other day,
-and Master's six year old son started bothering me. I tried to ignore it,
-but I was feeling so rotten that I bit his hand."
- "Yeah, I now what you mean. So, what are you here for?"
- "Erm ... well ... Master reckons that I'm too vicious, so I'm going
-to be ... you know ... I'm going to have the *operation*."
- "Oh. Well, I'm sorry," sympathized the first dog.
- Time passed. The about-to-be-neutered dog coughed politely.
- "So," he asked, "What are you in here for?"
- "Oh, nothing really," the other replied, embarrassed.
- "Go on, I told you, it *can't* be as bad!"
- "OK. Well, it's like this. The bitch next door was in heat, and so
-I was feeling, you know, a bit randy. Then Mistress came into the kitchen
-wearing a short skirt and no underwear, and she bent over. I just couldn't
-resist it!" admitted the dog.
- "Oh! So you're here for the operation too!"
- "No," came the reply, "I'm here to have my nails clipped!"
-%
-Seems like these four rabbis had a series of theological arguments, and three
-were always in accord against the fourth. One day, the odd rabbi out, with
-the usual "3 to 1, majority rules" statement that signified that he had lost
-again, decided to appeal to a higher authority. "Oh, God!" he cried. "I
-know in my heart that I am right and they are wrong! Please show me a sign,
-so they too will know that I understand Your laws."
- It was a beautiful, sunny day. As soon as the rabbi finished his
-plaint, a storm cloud moved across the sky above the four. It rumbled once
-and dissolved. "A sign from God! See, I'm right, I knew it!" But the other
-three disagreed, pointing out that stormclouds form on hot days.
- So he asked again: "Oh, God, I need a bigger sign to show that I am
-right and they are wrong. So please, God, a bigger sign."
- This time four stormclouds appeared, rushed toward each other to form
-one big cloud, and a bolt of lightning knocked down a tree ten feet away from
-the rabbis. The cloud dispersed at once. "I told you I was right!" insisted
-the loner, but the others insisted that nothing had happened that could not
-be explained by natural causes.
- The insisting rabbi is all ready to ask for a *very big* sign when
-just as he says "Oh God..." the sky turns pitch black, the earth shakes, and
-a deep, booming voice intones, "HEEEEEEEE'S RIIIIIIIGHT!"
- The sky returns to normal. The one rabbi puts his hands on his hips
-and snarls, "Well?" "Okay, okayyyy," replied another, "so now it's 3 to 2!"
-%
-Seems like this guy is hitting up on a woman in a bar. After assiduously
-pursuing her for several minutes, she leans forward and tells him that he's
-a nice guy and all that, but, well, that she's a lesbian. Confused, he asks
-her what that means.
- "Well," she replies, "you see that woman at the corner table?"
- "Yeah..."
- "I'd like to walk over to her, and unbottom her blouse."
- "Yeah..."
- "And then I'd like to kiss her and suck on her nipples... and
-then I'd like to take off her skirt... and run my hand over her thighs..."
- "Right! Right!" interrupts the guy. "I think I'm a lesbian too!"
-%
-Seems there was this traveling salesman who wandered into a brothel and
-asked the madam for a woman who would give him the absolutely worst blow-job
-imaginable. Not horny, just homesick.
-%
-Seems this guy notices a young nun sitting on the bus; through her heavy veil
-he just spots a glimmer of her face. Gorgeous! She moves, and her vestments
-cannot hide the fact she has a truly phenomenal body. The guy gets more and
-more excited until he finally approaches the nun and tells "Sister, please
-believe me, I don't normally do this sort of thing, but I think I love you.
-Could we maybe talk?"
- The nun almost runs off the bus. As the young man's stop comes up,
-the bus driver asks the guy if he was the person bothering the nun. The man
-starts apologizing, but the bus driver interrupts him. "No, don't apologize,
-I was checking her out myself. Listen, you see where she got on? She goes
-there every day, to a little park. Why don't you meet here there?"
- Sure enough, the man goes to the park the next day and there's the nun
-in a secluded grove of trees. He approaches her, and she seems, although shy,
-much more willing to talk. After an hour of cautious talk, he asks her if
-she'd be willing to make love with him. She blushes, smiles, blushes again
-and says "yes". But that she doesn't dare risk getting pregnant, so it would
-have to be the "back door".
- As they start to make love, the young man is overcome with guilt;
-panting, he says, "Sister, I have to tell you, I'm the guy who was annoying
-you on the bus yesterday.
- Replies the nun, "Well, that's okay. I'm not really a nun. I'm
-actually the bus driver."
-%
-Seems to me that both the Democrats and the Republicans should change their
-symbols to a contraceptive device; it stands for inflation, inhibits
-production, protects a bunch of pricks and gives everyone a false sense of
-security while they're being screwed.
-%
-Self-abuse is the most certain road to the grave.
- -- Dr. George M. Calhoun (1855)
-%
-SEMINARS:
- From 'semi' and 'arse', hence, any half-assed discussion.
-%
-Sen. Danforth: "There is nothing on the face of the album which would
- notify you if the record has pornographic material or
- material glorifying violence?"
-Tipper Gore: "No, there is nothing that would suggest that to me."
-Frank Zappa: "I would say that a buzz saw blade between the guy's legs on
- the album cover is good indication that it's not for little
- Johnny."
-
- -- The Senate Commerce Committee hearing on rock
- lyrics, from The Village Voice, 6 Oct 1985
-%
-Send lawyers, guns, and money,
-The shit has hit the fan.
- -- Warren Zevon
-%
-Sensible and responsible women do not want to vote.
- -- Grover Cleveland (1905)
-%
-Sex and drugs and UNIX.
-%
-Sex and mathematics have one thing in common.
-You can do each while thinking about the other.
-%
-Sex appeal is 50% what you've got and 50% what people think you've got.
- -- Sophia Loren
-%
-Sex is a biological function; kissing is a commitment.
-%
-Sex is better than grass, if you have the right pusher.
-%
-Sex is dirty, but only if you do it right.
-%
-Sex is great,
-Sex is grand,
-Sex around here,
-Is mostly by hand.
-%
-Sex is just one damp thing after another.
-%
-Sex is like a bridge game.
-If you have a good hand no partner is needed.
-%
-Sex is like air. It's not important unless you aren't getting any.
-%
-Sex is low in calories, and *oooh* that aftertaste!
-%
-Sex is nobody's business but the three people involved.
-%
-Sex is not the answer. Sex is the question. "Yes" is the answer.
- -- Swami X
-%
-Sex is one of the nine reasons for reincarnation ... the other eight
-are unimportant.
- -- Henry Miller
-%
-Sex is the poor man's opera.
- -- George Bernard Shaw
-%
-Sex is what women have and men want.
-%
-Sex; it's always best when one partner is at least a little bit desperate.
-%
-SEX-CHANGE NUN BECOMES TV WRESTLER!!!
- details at 11!
-%
-Shamus: A shamus is a guy who takes care of handyman tasks around the
-temple, and makes sure everything is in working order. A shamus is at
-the bottom of the pecking order of synagogue functionaries, and there's
-a joke about that:
-
-A rabbi, to show his humility before God, cries out in the middle of a
-service,
- "Oh, Lord, I am nobody!"
-The cantor, not to be bested, also cries out,
- "Oh, Lord, I am nobody!"
-The shamus, deeply moved, follows suit and cries,
- "Oh, Lord, I am nobody!"
-The rabbi turns to the cantor and says,
- "Look who thinks he's nobody!"
- -- Arthur Naiman, "Every Goy's Guide to Yiddish"
-%
-Share and enjoy, share and enjoy.
-Journey through life with a plastic boy or girl by your side.
-Let your pal be your guide.
-And when it breaks down or starts to annoy,
- or grinds when it moves and gives you no joy,
- 'cause it digs up your hat,
- or has sex with your cat,
- sprays oil on your wall or rips off your door,
- and you get to the point you can't stand any more.
-Bring it to us, we won't give a shit.
-We'll tell you: "Go stick your head in a pig".
-%
-She Ain't Much to See, but She Looks Good Through the Bottom of a Glass
-If Fingerprints Showed Up On Skin, I Wonder Who's I'd Find On You
-I'm Ashamed to be Here, but Not Ashamed Enough to Leave
-It's Commode Huggin' Time In The Valley
-If You Want to Keep the Beer Real Cold, Put It Next to My Ex-wife's Heart
-If You Get the Feeling That I Don't Love You, Feel Again
-It's the Bottle Against the Bible in the Battle For Daddy's Soul
-My Wife Ran Off With My Best Friend, And I Sure Miss Him
-Don't Cut Any More Wood, Baby, 'Cause I'll Be Comin' Home With A Load
-I Loved Her Face, But I Left Her Behind For You
- -- proposed Country-Western song titles
-%
-She asked me if I loved her still. "Yes," I replied. "I've never had
-you any other way."
-%
-She begged and she pleaded for more.
-I said, "We've already had four,
- And I'm sure that you've heard,
- Though it's somewhat absurd,
-That eros spelt backwards is sore."
-%
-She called her parakeet Onan, because he spilled his seed.
- -- Dorothy Parker
-%
-She hates testicles, thus limiting the men she can admire to Democratic
-candidates for president.
- -- John Greenway, "The American Tradition", on feminist
- Elizabeth Gould Davis
-%
-She made a thing of soft leather,
-And topped off the end with a feather.
- When she poked it inside her
- She took off like a glider,
-And gave up her lover forever.
-%
-She never liked zippers, she said,
-Until she opened one in bed.
-%
-She stood there and peeled off her clothes,
-And begged for a bang: goodness knows
- I am surely impure
- And I sizzled to scrure,
-But the push had gone out of my hose.
-%
-She was a farmer's daughter but she couldn't keep her calves together.
-%
-She was coming round the mountain doin' ninety,
-When the chain on her motorcycle broke,
- Now she's lying in the grass,
- With the muffler up her ass,
-And her tits a-playin' Dixie on the spokes.
-%
-She was only:
- a coal digger's daughter, but she'll always be mine.
- a statistician's daughter, but she knew all the standard deviations.
- a wrestler's daughter, but you should have seen her box.
- a moonshiner's daughter, but I loved her still.
- a chimney sweep's daughter, but she sure knew how to haul ash.
- a fireman's daughter, but her face was a cause for alarm.
- a banker's daughter, but she opened her drawers for cash.
-%
-She was peeved, and called her beau "Mr."
-Not because, when she came in, he kr.,
- But she knew, just before
- She opened the door,
-This same Mr. had kr. sr.
-%
-She was wearing a very tight skirt, and when she tried to board the Fifth
-Avenue bus she found she couldn't lift her leg. She reached back and
-unzipped her zipper. It didn't seem to do any good, so she reached back
-and unzipped it again. Suddenly the man behind her lifted her up and put
-her on the top step.
- "How dare you?" she demanded.
- "Well, lady," he said, "by the time you unzipped my fly for the
-second time I thought we'd become good friends."
-%
-She wasn't what one could call pretty
-And other girls offered her pity,
- So nobody guessed
- That her Wasserman test
-Involved half the men in the city.
-%
-She's fine, upstanding, and wonderful laying down.
-%
-She's looking for: He's looking for: Foreplay:
-1957 Someone who'll go Her: Finding a place to put
-Mr. Nice Guy all the way her gum
- Him: Wondering which word would
- best describe her breasts
- to the guys
-
-1967 Someone who's got The first ten minutes
-Mr. Natural rolling papers and of "In-A-Gadda-Da-Vida"
- will go all the way
-
-1977 Someone who'll go Testing the batteries
-Mr. Goodbar all the way in leg
- warmers and a leather
- face mask
-
-1987 Someone who's never Examination of the genitalia
-Mr. Clean gone all the way in under the magnifying glass
- San Francisco that Grandma used for needle-
- point before she passed away
- -- Michael Corcoran, "National Lampoon", October 1987
-%
-She's the kind of woman you could fall madly in bed with.
-%
-Shit happens.
-%
-Shopping at this grody little computer store at the Galleria for a
-totally awwwsome Apple. Fer suuure. I mean Apples are nice you
-know? But, you know, there is this cute guy who works there and HE
-says that VAX's are cooler! I mean I don't really know, you know?
-He says that he has this totally tubular VAX at home and it's stuffed
-with memory-to-the-max! Right, yeah. And he wants to take me home
-to show it to me. Oh My God! I'm suuure. Gag me with a Prime!
-%
-Short man who dance with tall woman gets bust in mouth.
-%
-Shouted Frosty the Snowman "Hooray!
-I'm agog with excitement today!
- And the reason of course,
- A reliable source,
-Said the snow blower's heading this way!"
-%
-Showerbath: Natural venue for sexual adventures -- wash together, make love
-together: only convenient overhead point in most apartments or hotel rooms
-to attach a partner's hands. Don't pull down the fixture, however -- it
-isn't weightbearing. See Discipline.
- -- The Joy of Sex
-%
-Sighed a neat little package named Annie:
-"I've the tits and the twat and the fanny,
- Plus the yen, but the men
- Only call now and then--
-Can it be I've B.O. in my cranny?"
-%
-Sir Francis Drake circumcised the world with a 100 foot clipper.
-%
-Sixteen'll get you twenty.
-%
-Size counts.
-%
-Small, adj.:
- Is it in yet?
-%
-Smoking a woman is like kissing a fish.
-%
-Sniff sniff... Hey! Who farted?
-%
-Snow White:
- "Gee guys, I've always dreamed of getting ten inches...
- but not an inch-and-a-half at a time!"
-%
-"Snyder's got a stiff ticket," said Kay,
-"Come on, take it out, and let's play."
- He pulled it on out,
- But she started to pout,
-His ticket was only a quarter-inch stout.
-%
-So, good night, you moonlit ladies,
-Rock-a-bye sweet baby James.
-Deep greens and blues are the colors I choose,
-Won't you let me go down in my dreams?
-And rock-a-bye sweet baby James.
- -- James Taylor, "Rock-a-bye Sweet Baby James"
-%
-So here was this fellow of Strensall
-Whose pecker was shaped like a pencil,
- Anemic, 'tis true,
- But an interesting screw,
-Inasmuch as the tip was prehensile.
-%
-So, how's your love life?
-Still holding your own?
-%
-So... if you could choose any nose in the whole wide world,
-which one would you pick?
-%
-So it's ai yi yi yi,
-Your mother scores more than Wayne Gretzky!
-So sing me another verse that worse than the other verse,
-And waltz me around by my willie!
-
- There once was a man from Nantucket!
- Whose cock was so long he could suck it!
- He said with a grin,
- As he wiped off his chin,
- If my ear were a cunt I could fuck it!
-
-So it's ai yi yi yi,
-Your sister does squat thrusts on flag poles!
-So sing me another verse that worse than the other verse,
-And waltz me around by my willie!
-
- There once was a young man from Boston!
- Who drove around town in an Austin!
- There was room for his ass,
- And a gallon of gas,
- So he hung out his balls and he lost 'em!
-%
-So it's ai yi yi yi,
-Your sister swims out to meet troop ships!
-So sing me another verse that worse than the other verse,
-And waltz me around by my willie!
-
- There once was a man from Racine!
- Who invented a screwing machine!
- Both concave and convex,
- It could please either sex,
- But, oh, what a bastard to clean!
-
-So it's ai yi yi yi,
-Your girlfriend douches with Drano!
-So sing me another verse that worse than the other verse,
-And waltz me around by my willie!
-
- One night a girl had an affair!
- With a fellow all covered with hair!
- His enormous red whang,
- Gave her a wonderful bang --
- She'd been diddled by Smokey the bear!
-%
-So this elderly couple were sitting in their tiny cold water flat on the
-lower East Side when the husband said, "Doris, we're in bad shape. Inflation
-has eaten up our Social Security check. The next one isn't due for a week
-and we've got no money left for food."
- "Could I do anything to help?" she asked.
- "Yes," he said. "I hate to see you do this but it's the only way.
-You're going to have to go out and hustle."
- "Me?" she asked. "At the age of sixty-five?"
- "It's the only way," he said.
-Resigned to the situation, she went out into the warm night. She came
-staggering in early the next morning.
- "How did you do?" asked the husband.
- "Here," she said, "I've got four dollars and ten cents."
- "Four dollars and ten cents," he said. "Who gave you the ten cents?"
- "Everybody," she said.
-%
-So you fucked up... you trusted us!
- -- Animal House
-%
-So, your daughter was voted "Most Likely to Conceive",
-and you're still drinking ordinary scotch?
-%
-Social interaction can be fatal. Come to Irvine and live forever.
-%
-Sodomy, fellatio, cunnilingus, pederasty,
-Father, why do these words sound so nasty?
- -- Hair
-%
-Sodomy is a pain in the ass.
-%
-Some companies idea of playing ball is, you play ball with us,
-and we'll stick the fucking bat up your ass.
-%
-Some Harvard men, stalwart and hairy,
-Drank up several bottles of sherry;
- In the Yard around three
- They were shrieking with glee:
-"Come on out, we are burning a fairy!"
- -- Edward Gorey
-%
-Some of the greatest love affairs I've known have involved one actor,
-unassisted.
- -- Wilson Mizner
-%
-Some of the management around here are the final proof that the Indians
-fucked the buffalo.
-%
-Some people seem to think that "damn" is God's last name.
-%
-Some women achieve greatness, some have greatness thrust into them.
-%
-Some women are like musical glasses.
-To keep them in tune they must be wet.
- -- Samuel T. Coleridge
-%
-Some women should be beaten regularly, like gongs.
- -- Noel Coward
-%
-Something better...
-
-13 (sympathetic): Oh, What happened? Did your parents lose a bet with God?
-14 (complementary): You must love the little birdies to give them this to
- perch on.
-15 (scientific): Say, does that thing there influence the tides?
-16 (obscure): Oh, I'd hate to see the grindstone.
-17 (inquiry): When you stop to smell the flowers, are they afraid?
-18 (french): Say, the pigs have refused to find any more truffles until you
- leave.
-19 (pornographic): Finally, a man who can satisfy two women at once.
-20 (religious): The Lord giveth and He just kept on giving, didn't He.
-21 (disgusting): Say, who mows your nose hair?
-22 (paranoid): Keep that guy away from my cocaine!
-23 (aromatic): It must be wonderful to wake up in the morning and smell the
- coffee ... in Brazil.
-24 (appreciative): Oooo, how original. Most people just have their teeth
- capped.
-25 (dirty): Your name wouldn't be Dick, would it?
- -- Steve Martin, "Roxanne"
-%
-Sometimes guys'll say to you, "Have a good one." I say, "I already have
-a good one. Now I'm looking for a longer one."
- -- George Carlin
-%
-Sometimes, you just gotta say "What the fuck."
- -- Risky Business
-%
-Sooner or later, generals will own you.
-%
-Sorry 'bout that sweat, honey. That's just holy water.
- -- Little Richard
-%
-SPINSTER:
- Unlusted number.
-%
-Starkle, starkle, little twink,
-Who the hell you are I think
-I'm not as drunk as thinkle peep
-I'm just a little slort of sheep.
-Tee martoonis make a guy,
-Feel so woozy, I don't know why.
-So mass the pixer and kill my fup
-I've all day sober to sunday up.
-%
-Statisticians do it with 95% confidence.
-%
-Statisticians probably do it.
-%
-Sticks and stones may break my bones but whips and chains excite me!!!
-%
-Stockmayer's Theorem:
- If it looks easy, it's tough.
- If it looks tough, it's damn well impossible.
-%
-STRAPLESS EVENING GOWN:
- Bust truster.
-%
-Stress, n.:
- The confusion created when one's mind overrides the body's
- desire to choke the living shit out of some asshole who
- desperately needs it.
-%
-Subpoena, n.:
- From the root "sub", below, and the Latin "poena" for male
- organ or penis. Therefore, "below the penis" or "by the balls."
-%
-Success has many fathers, but failure is a bastard.
-%
-Success is like a fart -- only your own smells nice.
- -- James P. Hogan
-%
-Successful cunnilingus, n.:
- When you wake up the next morning with a face like a
- frosted doughnut.
-%
-SUGAR DADDY:
- A man who can afford to raise cain.
-%
-Support the right of unborn males to bear arms!
- -- A public service announcement from Phyllis Schlafly,
- the Catholic Church, and the National Rifle
- Association
-%
-Sure, and of course I would vote for a woman for president!
-Quite naturally, we wouldn't have to pay her so much.
-%
-Sure banking is Biblical!
-
-How about when Onan received a substantial penalty for early withdrawal?
-Or when Pharaoh's daughter went into the bulrushes and came out with a
-little prophet? And it was Moses who led the Children of Israel to the
-Banks of the Jordan!
-%
-Sure eating yoghurt will improve your sex life. People know that if
-you'll eat that stuff, you'll eat anything.
-%
-Sure, Reagan has promised to take senility tests. But what if he
-forgets?
-%
-Swallow, v.:
- The (blew) bird of birth control.
-%
-Systems people do it with a small, but clean, interface.
-%
-Take a look around you, tell me what you see,
-A girl who thinks she's ordinary lookin' she has got the key.
-If you can get close enough to look into her eyes
-There's something special right behind the bitterness she hides.
- And you're fair game,
- You never know what she'll decide, you're fair game,
- Just relax, enjoy the ride.
-Find a way to reach her, make yourself a fool,
-But do it with a little class, disregard the rules.
-'Cause this one knows the bottom line, couldn't get a date.
-The ugly duckling striking back, and she'll decide her fate.
- (chorus)
-The ones you never notice are the ones you have to watch.
-She's pleasant and she's friendly while she's looking at your crotch.
-Try your hand at conversation, gossip is a lie,
-And sure enough she'll take you home and make you wanna die.
- (chorus)
- -- Crosby, Stills, Nash, "Fair Game"
-%
-Taken from actual police car videos:
-
-(15) Relax! The handcuffs are tight because they're new. They'll
- stretch out after you wear them awhile.
-(14) Take your hands off the car and I'll make your birth certificate
- a worthless document.
-(13) If you run you'll only go to jail tired.
-(12) Can you run faster than 1200 feet per second? In case you didn't
- know that's the average speed of a 9 mm bullet fired from my gun.
-(11) So you don't know how fast you were going. I guess that means I
- can write anything I want on the ticket, huh?
-(10) Yes, sir, you can talk to the shift supervisor, but I don't think
- it will help. Oh, did I mention that I AM the shift supervisor?
-(9) Warning? You want a warning? OK, I'm warning you not to do that
- again or I'll give you another ticket.
-(8) The answer to this last question will determine whether you are
- drunk or not. Is Mickey Mouse a cat or a dog?
-%
-Taken from actual police car videos:
-
-(7) Fair? You want me to be fair? Listen, fair is a place where you
- go to ride on rides, eat cotton candy, and step in monkey poop.
-(6) Yeah, we have a quota. Two more tickets and my wife gets a toaster
- oven.
-(5) No, sir, we don't have quotas anymore. We used to have quotas but
- now we're allowed to write as many tickets as we want.
-(4) Just how big were those two beers?
-(3) In God we trust, all others we run through CPIC/NCIC.
-(2) I'm glad to hear the Chief of Police is a good personal friend of
- yours. At least you know someone who can post your bail.
-(1) You didn't think we gave pretty women tickets?
- You're right, we don't -- sign here.
-%
-Taoism: Shit Happens.
-Confucianism: Confucius say, "Shit Happens".
-Buddhism: If shit happens, it isn't really shit.
-Hinduism: This shit has happened before.
-Protestantism: Shit happens, but it happens to someone else.
-Catholicism: Shit happens, but you deserved it.
-Judaism: Why does shit always happen to US?
-%
-Taxes should hurt. I just mailed my own tax return last night and I
-am prepared to say "ouch!" as loud as anyone.
- -- Ronald Reagan
-%
-TAXIDERMIST:
- A man who mounts animals.
-%
-Teaching undergraduates is like herding sheep. And, like the old Basque
-sheepherder explained, whenever the livestock starts looking good to you,
-it's time to spend a night in town.
-%
-Tear leather:
- To become excited, as in the sentence "Robin Hood tore
- his leather jerkin' off."
-%
-Tearing off a quicky:
- Gunning the jump.
-%
-Teddy Kennedy: A Blond in Every Pond!
-%
-Teen-age prostitution: the problem is mounting!
-%
-Television is a whore. Any man who wants her full favors can have them
-in five minutes with a pistol.
- -- Hijacker, quoted in "Esquire"
-%
-Tell you what," the haberdasher said to a persistent job applicant. "I've
-got one suit I can't sell -- that purple, green and yellow number over there.
-If you can make that sale, you've not only got the job, you've got it for
-life."
- Then the store owner left for lunch. When he returned, he was shocked
-to see the young man's clothes in tatters and his hands and face bleeding.
- "My God, what happened to you?"
- "I sold the suit! I sold the suit!" the young man shouted, a smile
-on his bloodied lips.
- "Congratulations," the haberdasher said. "You've got the job. But
-what happened? Did the customer start a fight?"
- "Oh, no," the new salesman replied. "But his Seeing Eye dog was
-*pissed*."
-%
-Tequila my girl, is deceiving:
-Take two at the very most.
-Take three and you're under the table,
-Take four and you're under the host.
-%
-Test makers do it:
- A: sometimes
- B: always
- C: never
- D: none of the above.
-%
-TEXAN:
- A wet-back that didn't make Oklahoma.
-%
-Thank God for the Duchess of Gloucester,
-She obliges all who accost her.
- She welcomes the prick
- Of Tom, Harry or Dick,
-Or Baldwin, or even Lord Astor.
-%
-That girl could suck the chrome off a bumper.
-%
-That Harvard don down at El Djim --
-Oh, wasn't it nasty of him,
- With the whole harem randy,
- The sheik himself handy,
-To muss up a young camel's quim.
-%
-That naughty old Sappho of Greece
-Said: "What I prefer to a piece
- Is to have my pudenda
- Rubbed hard by the enda
-The little pink nose of my niece."
-%
-That reminds me of a friend of mine who went north to work on the Alaskan
-pipeline. Before he went up there, he was just a skinny little runt. When
-he got back, he was a husky fucker.
-%
-The abbess of a nunnery was instructing a group of novices on the house rules
-of her particular order. The indoctrination period, which went on for hours,
-began with "No washing of undies in the founts," and ended with "Lights out at
-nine. Candles out at ten."
-%
-The acrobats - Tom and Louise-
-Do an act in the nude on their knees.
- They crawl down the aisle
- While screwing dog-style,
-As the orchestra plays Kilmer's "Trees."
-%
-The Army is a place where you get up early in the morning to be yelled
-at by people with short haircuts and tiny brains.
- -- Dave Barry
-%
-The attractive and grief-stricken widow had been living in seclusion at the
-home of her deceased husband's younger brother for several weeks. One evening,
-when she could no longer control her emotions, she barged into her brother-in-
-law's study and pleaded, "James, I want you to take off my dress." Shyly,
-the brother-in-law did as she requested. "Now," she continued, "take off my
-slip." He again complied. "And now," she said, with a slight blush, "remove
-my panties and bra." Once more James obeyed her command.
- Then, regaining her composure, she stared directly at the young man
-and boldly announced, "I have only one more request, James. Don't ever let
-me catch you wearing my things again."
-%
-The babe, with a cry brief and dismal,
-Fell into the water baptismal;
- Ere they'd gathered its plight,
- It had sunk out of sight,
-For the depth of the font was abysmal.
- -- Edward Gorey
-%
-The bedsprings next door jounce and creak:
-They have kept me awake for a week.
- Why do newlyweds
- Select squeaky beds
-To develop their fucking technique?
-%
-The best way to cut off a cat's tail is to repossess his Jaguar.
-%
-The Bible says that woman was the last thing God made.
-Evidently He made her on Saturday night. She reveals his fatigue.
- -- Dumas
-%
-The big difference between sex for money and sex for free is that
-sex for money usually costs a lot less.
- -- Brendan Francis
-%
-The bishop of Alexandretta
-Loved a girl and he couldn't forget her.
- So he thought he'd enshrine her
- As the Holy Vagina
-In the Church of the Sacred French Letter.
-%
-The blacksmith told me before he died,
-And I have no reason to believe that he lied,
-That no matter how he tried,
-His wife was never satisfied!
-
-And so he built a bloody great wheel,
-Harnessed to a cock of steel,
-Two balls of brass were filled with cream,
-And the whole damn thing was driven by steam.
-
-Round and round went the bloody great wheel,
-In and out went the cock of steel,
-Till at last the maiden cried,
-"Enough! Enough! I am satisfied!"
-
-And now we come to the crucial bit --
-There was no way of stopping it.
-And she was split from hole to hole,
-And the whole fucking thing was covered in shit...
-%
-The blind daters had really hit it off and at the end of the evening, as
-they were beginning to undress each other in his apartment, the fellow said,
- "Before we go any further, Charmaine, tell me -- do you have
-any special fetishes that I should take into account in bed?"
- "As a matter of fact," smiled the girl, "I do happen to have a foot
-fetish -- but I suppose I'd settle for maybe seven or eight inches."
-%
-The bottom-up approach always gets me buggered.
- -- Sidney J. Hurtubise
-%
-The boys in the Epperson family all acquired fine educations except for Edward.
-They made him go to school, but most of the time he just ignored what was said
-there. Yet there were rare moments when he could display a bit of curiosity.
- One day Edward was sitting at home looking at a magazine, and he said
-to his brilliant older brother, Hud, he said, "Hud, what does fox pass mean?"
- Brother Hud gave the question some deep consideration and then said,
-"You must mean _faux_pas_."
- "The way it's spelled," said dumb Ed, "it's fox pass."
- Hud took a look at the way it was spelled and then said, "It's a French
-phrase -- it means a social blunder. Remember last Sunday when the Bishop came
-for dinner? Mother took him out in the garden and they were looking over the
-roses when the Bishop got stuck on the thumb by a thorn. It was bleeding quite
-a bit so Mother brought him in the house. They went into the bathroom together
-and stayed quite a while, and when they came out we all went to the dinner
-table. Remember all that, Ed?"
- "Yeh."
- "Now," Hud continued, "you recall that I was just getting to pass
-the gravy when Mother said, 'Bishop, does your prick still throb?' The gravy
-bowl flew out of my hands and hit the table, and the gravy splattered all
-over everyone. And just at that point you, Brother Edward, you hollered,
-'Sheee-itt!' You remember that?"
- "Yeh."
- "Well, when you hollered 'Sheee-itt!' that was a _faux_pas_."
-%
-The bustard's a remarkable fowl
-With surely no reason to growl
- He escapes what would be
- Illegitimacy
-By the grace of a fortunate vowel.
-%
-The butcher, the baker, the candlestick make her, why can't I?
-%
-The computer is the ultimate polluter.
-Its shit is indistinguishable from the food it produces.
-%
-The country girl who became a city madam
-has obviously gone from rags to rigids.
-%
-The cruelest of creatures' the crab
-With claws that can pinch you or stab,
- And then when you dine
- On crab and white wine
-It gets you as well with the tab.
-%
-The difference between a lawyer and a rooster is that
-the rooster gets up in the morning and clucks defiance.
-%
-The difference between a sorority girl and a bowling ball
-is that you can only get three fingers in a bowling ball.
-%
-The difference between graffiti and philosophy is the word "fuck".
-%
-The difference between her and the Titanic is that only 1100 men
-went down on the Titanic.
-%
-The difference between like and love is the
-same as the difference between a spit and a swallow.
-%
-The difference between this school and a cactus plant is that the
-cactus has the pricks on the outside.
-%
-The difference between women and girls
-is as much as twenty years in some states.
-%
-The Dowager Duchess of Spout
-Collapsed at the height of a rout;
- She found strength to say
- As they bore her away:
-"I should never have taken the trout."
- -- Edward Gorey
-%
-The early worm gets the bird.
-%
-The ecumenical movement has reached a milestone with the agreement on the
-text of the first Jewish-Catholic prayer -- one that begins "Oy vay, Maria".
-%
-The Enterprise crew when off work
-Will fuck like an Ottoman Turk.
- Uhura the Zulu
- Is shacked up with Sulu,
-And Spock shares a crew girl with Kirk.
-%
-The Enterprise girls, so one hears,
-Have chased Spock for several years.
- His look of disdain
- Has spared them great pain,
-For his prick is as sharp as his ears.
-%
-The Father, the Son and the Holy Ghost would never throw the Devil
-out of Heaven as long as they still need him as a fourth for bridge.
- -- Letter in NEW LIBERTARIAN NOTES #19
-%
-The fearless old bishop of Brest
-Put his faith in the Lord to the test.
- He fucked whores in the apse
- With chancres and claps,
-But first they were sprinkled and blessed.
-%
-The first child of a Mrs. Keats-Shelley
-Came to light with its face in its belly;
- Her second was born
- With a hump and a horn,
-And her third was as shapeless as jelly.
- -- Edward Gorey
-%
-The First: I'm not a demon little girl, I am something that you can't
- even conceive. The first evil. Beyond sin, beyond death.
- I am the thing the darkness fears. You'll never see me but I
- am everywhere. Every being, every thought, every drop of hate.
-Buffy: Alright I get it, you're evil. Do we have to chat about it all day?
- -- Buffy the Vampire Slayer, "Amends"
- Season 3, Episode 10
-%
-The first time we slept together she drove a recreational vehicle into
-the bedroom.
- -- Richard Lewis
-%
-The five-alarm fire had been raging out of control for hours, pouring thick,
-black smoke over the street. At last the blaze was under control and the
-fire chief began accounting for his men. Two were missing, so he ordered
-a search. Captain Kelly finally rounded a fire truck parked in an alley
-and found, to his shock, one fireman with his trousers down leaning over a
-garbage can and another fireman screwing him in the ass.
- "What's the meaning of this!", the captain roared.
- "Jones here had passed out from smoke inhalation," the fireman on
-top panted.
- "You're supposed to give mouth to mouth resuscitation for that!"
-the captain yelled.
- "I know. That's what started this," the fireman replied.
-%
-The Fortune Travel Agency offers a special... Vacation in Hell!
- -- Grace Kelly drives you to the airport.
- -- Thurman Munson flies you to a remote tropical island.
- -- Ted Kennedy's your chauffeur on the island.
- -- You go yachting with Natalie Wood.
- -- You have drinks with William Holden.
- -- And Roman Polanski stays at home and watches your kids.
-%
-The fucking ain't worth the fighting.
-%
-The genital area of Ann
-Will accommodate any size man,
- From the wee that cause titters
- To the mighty twat-splitters
-That cause screams peasants hear in Japan.
-%
-The girls that go to see a man's etchings
-may not know art, but they know what they like.
-%
-The good doctor had been an inspiration to the jungle natives. He had cured
-their sick and taught them the religious and moral values of his own England.
-He was loved and respected by every native in the village, but on this
-particular afternoon the chief was obviously troubled as he entered the
-doctor's hut. "You live among my people long time now," said the chief.
-"You tell us not right for a man and girl to be close together before
-marriage and we believe what you say. This morning white child born to
-woman in village. You only white man in jungle. What I tell my people?"
- The doctor smiled and led the chief to a window. "My son," he said,
-"I'll won't attempt to give you a full scientific explanation for the
-phenomenon known as an albino. But look at the flock of sheep upon that
-hill. Every one is snow white except one. The white baby born to the
-woman in your village means nothing more or less than that one black sheep
-in the white flock. It is simply one of nature's mysterious accidents."
- The black chief became embarrassed and looked at his feet. "OK, doc,"
-he said. "You no tell -- I no tell."
-%
-The good news is that the horse is dead, but your mother's pregnant.
-%
-The good thing about masturbation is that you don't have to dress up for it.
- -- Truman Capote
-%
-The government [is] extremely fond of amassing great quantities of statistics.
-These are raised to the nth degree, the cube roots are extracted, and the
-results are arranged into elaborate and impressive displays. What must be
-kept ever in mind, however, is that in every case, the figures are first
-put down by a village watchman, and he puts down anything he damn well
-pleases.
- -- Sir Josiah Stamp
-%
-The greatest lies of all time:
- (1) I love you.
- (2) This won't hurt a bit.
- (3) The Mercedes is paid for.
- (4) The check is in the mail.
- (5) I was just going to call you.
- (6) I've always worn cowboy boots.
- (7) I swear I won't come in your mouth.
- (8) Of course I'll respect you in the morning.
- (9) We have a really challenging assignment for you.
- (10) I'm from the government, and I'm here to help you.
-%
-The Grecians were famed for fine art,
-And buildings and stonework so smart.
- They distinguished with poise
- The men from the boys,
-And used crowbars to keep them apart.
-%
-The hacker as a mate/lover and the signs of trouble:
-
--- The morning after note reads:
- Whiting, Barbara:
- I enjoyed last night. We really interfaced. You looked so cute
- I wanted to byte your ear.
--- He believes Steve Wozniak offered the Apple to Adam.
--- The people he tries to emulate are five years his junior.
--- The last straw:
- Once again, your date has lost all track of time debugging a new
- program and shows up an hour late.
-
- You Don't...:
- Make nasty asides regarding his 5-1/4 inch floppy.
- You Do...:
- Remind him that "going down" doesn't necessarily
- indicate a malfunction.
-%
-The harder they come, the more important it is to have
-an extra-firm mattress.
-%
-The honest female orgasm is three to fifteen rhythmic contractions of the
-outer third of the vagina at .8 second intervals, which is approximately
-the beat of "Surfing Safari" by the Beach Boys. Unless these contractions
-occur, you can regard her groaning, moaning, clawing, kicking, begging for
-mercy, and shouting filthy religious epithets as bargain-basement histrionics.
- -- John Hughes, National Lampoon
-%
-The honeymoon is over when a quickie before dinner refers to a short drink.
-%
-The hope that springs eternal
-Springs right up your behind.
- -- Ian Drury, "This Is What We Find"
-%
-The hungover couple dawdled over a midafternoon breakfast, after a
-particularly wild all-night party held in their fashionable apartment.
- "Dearest, this is rather embarrassing," said the husband, "but
-was it you I made love to in the library last night?"
- His wife looked at him reflectively and then asked, "About what
-time?"
-%
-The husband was disturbed by his wife's indifferent attitude towards him
-and the marriage counselor suggested he try being more aggressive in his
-lovemaking.
- "Act more like a romantic lover and less like a bored spouse," he
-was advised. "When you go home, make love to her as soon as you meet --
-even if it's right inside the front door."
- At the next consultation, the adviser was pleased to hear that the
-husband had followed his instructions. "And how did she react this time?"
-the consultant asked.
- "Well, to tell you the truth," the husband replied, "she was still
-sort of indifferent. But one thing I've got to admit: her bridge club went
-absolutely wild!"
-%
-The husband wired home that he had been able to wind up his business trip a
-day early and would be home on Thursday. When he walked into his apartment,
-however, he found his wife in bed with another man. Furious, he picked up his
-bag and stormed out. He met his mother-in-law on the street, told her what
-had happened and announced that he was filing for divorce in the morning.
- "Give my daughter a chance to explain before you take any action,"
-the older woman pleaded. Reluctantly, he agreed.
- An hour later his mother-in-law phoned the husband at his club.
-"I knew my daughter would have an explanation," she said, a note of triumph
-in her voice. "She didn't receive your telegram!"
-%
-The investment community feels very putupon. They feel there is no
-reason why they shouldn't earn $1 million to $200 million a year,
-and they don't want to be held responsible for the global financial
-meltdown.
- -- Daniel Fass, Chairman of United States President
- Barack Obama's financial-industry fundraising party
- 20 October 2009
-%
-The Italian entry in the Eurovision Song Contest, "I Can't Get No
-Contraception", has been withdrawn after the Pope advised them to
-pull it out at the last minute.
- -- Not the Nine O'Clock News
-%
-The king arranged a regal marriage for his daughter -- a bond that would unite
-two great kingdoms. Yet, because the young couple seemed so formal to each
-other, he posted a spy outside the royal wedding chamber and demanded a full
-account of the wedding night's progress.
- "It's hard to tell," said the spy the next morning. "When the prince
-entered the chamber, I heard the princess say, quite formally, 'I offer you my
-honor.' Then the prince said, with equal courtliness, 'I honor your offer.'
-And that's the way it went all night long -- honor, offer, honor, offer.
-%
-The King named Oedipus Rex
-Who started this fuss about sex
- Put the world to great pains
- By the spots and the stains
-Which he made on his mother's pubex.
-%
-The King plugged the Queen's ass with mustard
-To make her fuck hot, but got flustered,
- And cried, "Oh, my dear,
- I am coming, I fear,
-But the mustard will make you come `plus tard'."
-%
-The kings of Peru were the Incas,
-Who were known far and wide as great drincas.
- They worshiped the sun
- And had lots of fun,
-But the peasants all thought they were stincas.
-%
-The largest gay community in the U.S. (as a percentage of total population)
-is not in San Francisco, but in Iowa Falls, Minnesota (pop. 763), a small
-town in which virtually everyone is gay. In 1976, a group of about 100
-gays fleeing persecution in the South settled in the town, and soon won a
-majority on the town council. Ordinances prohibiting heterosexual acts
-soon followed. "After all," said mayor Harry Whalen, "If the Supreme Court
-has refused to strike down laws prohibiting homosexual acts, then our
-anti-straight laws are equally valid." Rigorous enforcement of those laws
-has resulted in a community that is now almost 100% gay. Said one long-time
-resident: "I've lived here 35 years and didn't want to leave, but I didn't
-want to give up sex either. Then my neighbor Ed came over one night, and
-said how about I do it with him, and my wife Millie could do it with his
-wife. Well, I found it wasn't nearly as bad as I thought it was gonna be.
-Fact is, I rather like it."
-%
-The lights are on,
-but you're not home;
-Your will
-is not your own;
-Your heart sweats,
-Your teeth grind;
-Another kiss
-and you'll be mine...
-
-You like to think that you're immune to the stuff
-(Oh Yeah!)
-It's closer to the truth to say you can't get enough;
-You know you're gonna have to face it,
-You're addicted to love!"
- -- Robert Palmer
-%
-The little boy pointed to two dogs in the park and asked his father what
-they were doing. "They're making puppies, son," replied the father.
- That night, the boy wandered into his parents' room while they were
-making love. Asked what they were doing, the father replied, "Making you
-a baby brother."
- "Gee, Dad," the boy pleaded, "turn her over -- I'd rather have a
-puppy."
-%
-The little old lady rushed into the taxidermist and unwrapped a package
-containing two recently deceased monkeys. Her instructions to the proprietor
-were delivered in a welter of tears.
- "Favorite pets... (blubber,sob)... caught cold... (moan)... Don't
-see how I'll live without them... (weep,sob)... want to have them stuffed...
-(blubber,blubber)!"
- "Of course, madam," said the proprietor in an understanding voice,
-"and would you care to have them mounted?"
- "Oh, no," she sobbed, "shaking hands. They were just close friends."
-%
-The long-peckered Bey of Algiers
-Loved to spear chubby lads in their rears.
- A demon for semen,
- This buffersome he-man
-Shot the chute till it seeped from their ears.
-%
-The man and woman make love, attain climax, fall separate. Then she
-whispers, "I'll tell you who I was thinking of if you tell me who you
-were thinking of." Like most sex jokes the origins of the pleasant
-exchange are obscure. But whatever the source, it seldom fails to evoke
-a certain awful recognition.
- -- Gore Vidal, "New York Review of Books"
-%
-The man who said "A bird in the hand's worth two in the bush" has been
-putting his bird in the *WRONG* bushes.
-%
-The man-hating woman, like the cold woman, is largely imaginary. She
-is simply a woman who has done her best to snare a man and has failed.
- -- Norton
-%
-The Messiah will come. There will be a resurrection of the dead -- all
-the things that Jews believed in before they got so damn sophisticated.
- -- Rabbi Meir Kahane
-%
-The mind is its own place, and in itself
-Can make a Heaven of Hell, a Hell of Heaven.
-What matter where, if I be still the same,
-And what I should be, all but less than he
-Whom thunder hath made greater? here at least
-We shall be free; the almighty hath not built
-Here for his envy, will not drive us hence;
-Here we may reign secure, and, in my choice,
-To reign is worth ambition, though in Hell:
-Better to reign in Hell than serve in Heaven.
- -- Satan, Milton's "Paradise Lost", I, 254-263
-%
-The more crap you put up with, the more crap you're going to get.
-%
-The more I learn about women, the more I love my dog.
-%
-The most common form of marriage proposal: "YOU'RE WHAT!?"
-%
-The most pressing issue facing women today is finding a contraceptive
-jelly that smells like a fresh fruit salad.
-%
-The most romantic thing any woman ever said to me in bed was
-"Are you sure you're not a cop?"
- -- Larry Brown
-%
-The most unfair thing about STDs (sexually transmitted diseases) is
-that the guys who bought vasectomies have to wear condoms anyway.
-%
-The most unsatisfactory men are those who pride themselves on their
-virility and regard sex as if it were some form of athletics at which
-you win cups. It is a woman's spirit and mood which a man has to
-stimulate in order to make sex interesting. The real lover is the
-man who can thrill you by just touching your head or smiling into
-your eyes - or just by staring into space.
- -- Marilyn Monroe
-%
-The mother of the year should be a sterilized woman with two
-adopted children.
- -- Paul Ehrlich
-%
-The moving finger having writ... gestures.
-%
-The moyel who treated young Alec
-Was cross-eyed and hydrocephalic.
- Presented the child
- His aim was so wild
-He rendered the poor boy biphallic.
-%
-THE MX IS GOOD FOR THE ECONOMY. One important reason we have a Defense
-Department is that when we give it money, it spends it, which creates
-jobs, whereas if we left the money in the hands of civilians, we don't
-know what they'd do with it. Probably put it in open trenches and set
-it on fire. The MX will create an especially large number of jobs
-because of the number of warheads it carries. It carries a total of 10
-warheads. This creates a great deal of employment, because you have
-your Warhead Makers, your Warhead Lifters, your Persons Who Tap the
-Warheads Gently with Rubber Mallets to Wedge Them All Snugly Into the
-Nose Cone, your Persons Who Just Walk Around Playing Soothing Cassettes
-by Recording Artists such as Perry Como So We Don't Have Any More
-Episodes Where a Worker Who is Experiencing Some Strain Sticks a
-Warhead in the Employee Cafeteria Microwave and Sets It On Roast, etc.
-We are talking about a lot of jobs.
- -- Dave Barry, "At Last, the Ultimate Deterrent Against
- Political Fallout"
-%
-The nervous young bride became irritated by her husband's lusty advances on
-their wedding night and reprimanded him severely.
- "I demand proper manners in bed," she declared, "just as I do at
-the dinner table."
- Amused by his wife's formality, the groom smoothed his rumpled hair
-and climbed quietly between the sheets. "Is that better?" he asked, with a
-hint of a smile.
- "Yes," replied the girl, "much better."
- "Very good, darling," the husband whispered. "Now would you
-be so kind as to please pass the pussy?"
-%
-The new cinematic emporium
-Is not just a super-sensorium,
- But a highly effectual
- Heterosexual
-Mutual masturbatorium.
-%
-The new priest was so nervous about performing his first mass that he could
-hardly speak. He asked his Monsignor how he could relax. The Monsignor
-replied that it might help relax him to add just a bit of vodka to the water
-pitcher. The next Sunday, after following the Monsignor's advice, the priest
-returned to the rectory to find a note from that worthy.
-
- 1. Next time sip rather than gulp.
- 2. There are ten commandments, not 12.
- 3. There are 12 disciples, not 10.
- 4. We do not refer to the cross as the "Big T".
- 5. The recommended grace before meals is not,
- "Rub-a-dub-dub, thanks for the grub, Yaaaay, God!"
- 6. Do not refer to our Saviour, Jesus Christ, and his
- Apostles as "J.C. and the Boys".
- 7. David slew Goliath, he did not kick the shit out of him.
- 8. The Father, Son, and the Holy Ghost are never referred
- to as, "Big Daddy, Junior, and the Spook".
- 9. It is always the Virgin Mary, never The Mary with the Cherry.
- 10. Last, but not least, next Wednesday there will be a
- Taffy-Pulling Contest at St.Peter's, not a Peter-Pulling
- Contest at St. Taffy's.
-%
-The new rooster caused a great stir in the barnyard. From resplendent comb
-to defiant spurs, he was the picture of young bantamhood. Almost immediately
-upon arrival, he was greeted by an elderly rooster who took him behind the
-barn and whispered in his ear: "Young fellow, I'm long past my prime. All I
-want now is peace and solitude. So you take over right now as ruler of the
-roost with my blessings."
- The newcomer did just that. He went about his squirely duties as only
-a young rooster could. After several days, however, the elder rooster again
-took the young champion behind the barn. "Kid," he said, "the hens are after
-me for giving up my position so readily. So why don't we have a race, say,
-ten laps around the farmhouse? The winner becomes undisputed keeper of the
-henhouse and the hens will stop nagging me."
- The young rooster, with only contempt for his elder, agreed.
-Surprisingly, the older one jumped off to an early lead. His counterpart,
-weakened by the activities of the previous week, was never quite able to
-overtake him. As they rounded the barn for the fourth time, the elder rooster
-maintained a formidable lead.
- Suddenly, a shotgun blast rang out. The young rooster fell in the
-dust, his plumage riddled with buckshot.
- "Dammit, Emmy," said the farmer. "That's the last rooster we buy
-from Ferguson. Four of 'em this month, and every one's been queer."
-%
-The nipples of Sarah Sarong
-When excited are twelve inches long
- This embarrassed her lover
- Who was pained to discover
-She expected no less of his dong
-%
-The notorious Duchess of Peels
-Saw a fisherman fishing for eels.
- Said she, "Would you mind? --
- Shove one up my behind.
-I am anxious to know how it feels."
-%
-The office brown-noser named Bunky
-Would claim he was nobody's flunky.
- But when the chips were all down,
- His proboscis was brown,
-And there hung many strands which were gunky.
-%
-The only difference between your current lover and a doorknob is
-that a doorknob warms up when you hold it.
-%
-The only difference between your girlfriend
-and a barracuda is the nail polish.
-%
-The only excuse for God is that he doesn't exist.
- -- Stendhal
-%
-The only psychologically damaging thing about masturbation is
-that there's nobody else to blame later for persuading you to do it.
-%
-The only thing faster than the speed of light is shit flowing downhill.
- -- Mike O'Dell
-%
-The only way for writers to meet is to share a quick pee over a common
-lamp-post.
- -- Cyril Connolly, "Journal and Memoir"
-%
-The only way I can lose this election is if I'm caught in
-bed with a dead girl or a live boy.
- -- Edwin Edwards, Louisian governor
-%
-The only way to behave to a woman is to make love to
-her if she is pretty and to someone else if she is plain.
- -- Oscar Wilde
-%
-The only way you'll ever hear from
-me is if you're living in the same hell.
- -- Roy Harper
-%
-The operator's left hand quivered as she gingerly unlatched the
-catch to the diskette reader. Uncontrollably, she reached down,
-guiding the sharply pointed diskette into the deep, dark slot.
-The floppy diskette nearly folded under the repeated thrusts of
-her hand, until finally she could control it no longer, her right
-hand instinctively taking an option zero. And then it all came at
-once, thousands upon thousands of data bits flowing from diskette
-to disk in a torrent of torrid transfer, as the helpless legs
-of the 32 strained to remain on the floor.
-%
-The other night I was having sex, but the girl hung up on me.
-%
-The outraged husband discovered his wife in bed with another man.
- "What is the meaning of this?" he demanded. "Who is this fellow?"
- "That seems like a fair question," said the wife, rolling over.
-"What IS your name?"
-%
-The partition of Vavasour Scowles
-Was a sickener: they came on his bowels
- In a firkin; his brain
- Was found clogging a drain,
-And his toes were inside of some towels.
- -- Edward Gorey
-%
-The penis mightier than the sword.
-%
-The perfect woman:
- Four feet tall, no teeth and a flat head so you can rest
- your drink.
-
- [Pistol-grip ears? Ed.]
-%
-The pleasure is momentary,
-The position ridiculous,
-The expense damnable.
- -- Chesterfield, on sex
-%
-The pleasure is transitory, the cost
-prohibitive, and the position ridiculous.
- -- Disraeli, on sex
-%
-The plural of spouse is spice.
- -- Robert A. Heinlein
-%
-The police were investigating the mysterious death of a prominent businessman
-who had jumped from a window of his 11th story office. His voluptuous private
-secretary could offer no explanation for the action but said that her boss had
-been acting peculiarly ever since she started working for him a month ago.
- "After my very first week on the job," she said, "I received a
-twenty-dollar raise. At the end of the second week he called me into his
-private office, gave me a lovely black nightie, five pairs of nylon stockings
-and said, 'These are for a beautiful, efficient secretary.' At the end of the
-third week he gave me a gorgeous mink stole. Then, this afternoon, he called me
-into his private office again, presented me with this fabulous diamond bracelet
-and asked me if I would consider making love to him and what it would cost.
-I told him I would, and because he had been so nice to me, he could have it
-for five dollars, although I was charging all the other boys in the office ten
-dollars. That's when he jumped out the window."
-%
-The poor little doe
-Crawled out of the woods,
-Tired, bedraggled and blue.
-"Look," she said, "What I did for a buck,
-I should have asked for two!"
-%
-The Pope is working on a crossword puzzle one Sunday afternoon. He stops
-for a moment, scratches his forehead, then asks a Cardinal, "Can you think
-of a four-letter word for `woman' that ends in `u-n-t'?"
- "Aunt," replies the Cardinal.
- "Say, thanks," says the Pope. "You got an eraser?"
-%
-The prick of the engineer, Scott,
-Fell off from Saturnian rot.
- He went to the basement
- And made a replacement
-Of tungsten and plastic and snot.
-%
-The priest at Sunday mass noticed that Michael took a ten-dollar bill and two
-one-dollar bills from the collection plate, instead of putting something in.
-He thought to himself, I'd better watch out for Michael. The next week he
-noticed the same thing. So he waited outside church when mass was over, and
-as Michael came out, he accosted his and said,
- "Michael, tell me -- why did you take out a ten-dollar bill and two
-singles two weeks in a row, instead of putting money into the collection?"
- Michael replied, "Father, I'm embarrassed, but I did it because I
-wanted to go downtown for a blow job."
- The priest looked surprised but said to Michael, "Listen, don't do
-that anymore. I'll be watching you from now on."
- When he got back to the rectory, the priest was still perplexed.
-Finally he decided to call Mother Agatha at the convent. He said, "Mother,
-you've been such a great friend of mine, I have a question I need to ask you.
-What is a blow job?"
- Mother Agatha replied, "Oh, twelve dollars, same as downtown."
-%
-The problem with being best man at a wedding is that you never get a
-chance to prove it.
-%
-The problems with "Medflies" may have hurt Jerry Brown's chances to become a
-Senator. After all, if they won't allow California fruit out of the state,
-how is Brown going to get to Washington?
-%
-The public is an old woman. Let her maunder and mumble.
- -- Thomas Carlyle
-%
-The quality of a blow-job is determined by the
-length of sheet you have to pull out of your ass.
-%
-The randy old Bey of Algiers
-Who'd confined his cock-poking to queers,
- Tried a cunt for a change,
- And remarked: "It felt strange ...
-Just think what I've missed all these years!"
-%
-The real problem with fucking a sheep is that you have to walk around
-in front every time you want to kiss her.
-%
-The real trouble with women is that they have *all* the pussy.
-%
-The reason big companies have lots and lots of meetings is because
-they can't masturbate.
-%
-The reason Roman Catholics are allowed to use the
-rhythm method of birth control is that it doesn't work.
-%
-The reason that sex is so popular is that it's centrally located.
-%
-The reason we need the MX missile system is that the missiles we
-currently have in the ground are the Minuteman model, which is very
-old. The Defense Department can't even remember where half of them
-are. Insects have built nests in them. People have built houses
-directly over the silos. What this means, of course, is that if we
-ever needed them to help obliterate all human life on the planet, they
-could be a real embarrassment. I mean, maybe YOU'RE comfortable with
-the prospect of missiles that are supposed to represent you barging
-over the North Pole trailing shreds of polyester carpeting from some
-recreation room in South Dakota, but your strategic defense planners
-are not.
- -- Dave Barry, "At Last, the Ultimate Deterrent Against
- Political Fallout"
-%
-The Reverend Henry Ward Beecher
-Called a girl a most elegant creature.
- So she laid on her back
- And, exposing her crack,
-Said, "Fuck that, you old Sunday School Teacher!"
-%
-The REVERSE function works on the opposite SEXPR.
-%
-The rich man uses Vaseline,
- The poor man uses lard;
-The worker uses axle grease
- But gets it twice as hard.
-%
-The romantic young man sat on the park bench with a first date. He was
-certain his charming words and manner would win her as they had many others.
- "Some moon out tonight,"he cooed.
- "There certainly is," she agreed.
- "Some really bright stars in the sky."
- She nodded.
- "Some dew on the grass."
- "Some do," she said indignantly, "but I'm not that sort."
-%
-The San Francisco police are nothing if not sensitive to the mood of the
-community. The word is that Dirty Harry has been replaced by Bitchy Gerald.
-%
-The sergeant walked into the shower and caught me giving myself a
-dishonorable discharge. Without missing a beat, I said, "It's my dick
-and I can wash it as fast as I want!"
-%
-The sex act is the funniest thing on the face of this earth.
- -- Diana Rigg
-%
-The sex life of spiders is very interesting.
-He fucks her.
-She bites his head off.
- -- From a Women's Lib Poster
-%
-The sex was nice, but confusing. The whole situation kept going di-polar
-on Sta-Hi. One instant Misty would seem like a lovely warm girl who'd
-survived a terrible injury, like a lost puppy to be stroked, a lonely
-woman to be husbanded. But then he'd start thinking of the wires behind
-her eyes, and he'd be screwing a machine, an inanimate object, a public
-toilet. Just like with any other woman for him, really.
- -- Rudy Rucker, "Software"
-%
-The Shah of the Empire of Persia
-Lay for days in a sexual merger.
- When the nautch asked the Shah,
- "Won't you ever withdraw?"
-He replied with a yawn, "It's inertia."
-%
-The shy young man had been married for three months when he reported to his
-doctor that his marriage was still in name only. The doctor, after hearing
-the sad tale, told him that waiting until bedtime to make advances was causing
-psychological pressure and advised him to take advantage of the next time he
-felt in the mood. A week later, the doctor happened to meet the man again,
-and noticed a new spring in his step. "My advice worked, I take it?" he
-inquired.
- The young man grinned. "Perfectly. The other night, we were having
-supper, and as I reached for the salt -- so did she! Our hands touched... It
-was as if an electric current ran through us. I leaped to my feet, swept the
-dishes from the table and then and there consummated our marriage! There's
-just one problem, however. We can't go back to The Four Seasons again..."
-%
-The sight of his guests filled Lord Cray
-At breakfast with horrid dismay,
- So he launched off the spoons
- The pits from his prunes
-At their heads as they neared the buffet.
- -- Edward Gorey
-%
-The skater, Barbara Ann Scott
-Is so fuckingly "winsome" a snot,
- That when posed on her toes
- She elaborately shows
-Teeth, fat ass, titties and twat.
-%
-The spouse of a pretty young thing
-Came home from the wars in the spring.
- He was lame but he came
- With his dame like a flame --
-A discharge is a wonderful thing.
-%
-The star of that X-rated hit
-Plays a nurse with a throat full of clit.
- This serves as a palace
- For each turgid phallus--
-Some say that the plot is pure shit.
-%
-The State of California has no business subsidizing intellectual
-curiosity.
- -- Ronald Reagan
-%
-The Stealth Condom -- they'll never see you coming.
-%
-The struggling for knowledge has a pleasure in it
-like that of wrestling with a fine woman.
- -- Lord Halifax
-%
-The Sultan was peeved with his harem,
-And cooked up a scheme for to scare'em.
- He caught a big mouse
- Which he loosed in the house.
-(Such confusion is called harem-scarem).
-%
-The sun was shining brightly The breeze was blowing briskly,
-And I could hardly wait, It made the flowers sway,
-To ponder at my window The garden was enchanting
-And gaze at my estate. On this inspiring day.
-
-My eyes fell on a little bird, I smiled at him cheerfully
-With a beautiful yellow bill, And gave him a crust of bread,
-I beckoned him to come and light And then I closed the window
-Upon my window sill. And smashed his fucking head.
- -- "Good Morning", Debbie Smith
-%
-The superpowers often behave like two heavily armed blind men feeling
-their way around a room, each believing himself in mortal peril from
-the other, whom he assumes to have perfect vision. Each tends to
-ascribe to the other side a consistency, foresight and coherence that
-its own experience belies. Of course, even two blind men can do
-enormous damage to each other, not to speak of the room.
- -- Henry Kissinger
-%
-"The testes are cooler outside,"
-Said the doc to the curious bride,
- "For the semen must not
- Get too fucking hot,
-And the bag fans your bum on the ride."
-%
-The three faithful things in life are money, a dog and an old woman.
-%
-The three most important parts of a stove: lifter, leg, and poker.
-%
-The three sexual positions during pregnancy.
-
-During the first four months: Missionary style
-During the second four months: Doggie style
-And during the last month: Coyote style
-
-Coyote style?
- You sit by the hole and howl.
-%
-The time has come for kicking ass and taking names.
-%
-The townspeople stood in despair as the fire that had begun in a diner
-threatened to spread to adjoining homes. Just then, a truck filled with
-farm workers came speeding down a hill toward the fire. The crowd moved
-back and the truck drove right into the thickest of the flames. The workers
-jumped out and beat at the fire with their coats, miraculously bringing the
-blaze under control.
- The city fathers were so grateful for the men's heroism that they
-gave each a plaque and $1000. After the ceremony, newsmen interviewed the
-driver and asked him what he was going to do with the money.
- "You can be damned sure the first thing I'm gonna do," he replied,
-"is get the brakes fixed on that son-of-a-bitchin' truck!"
-%
-The truth about a woman often lasts longer than the woman is true.
-%
-The two couples were enjoying their vacation together at a resort hotel. They
-were in the middle of a game of Scrabble in the lobby when a thunderstorm cut
-off the hotel's electricity, leaving little to do but retire to their rooms.
-Bill was a rather devout man, so before getting into bed with his companion,
-he said his prayers. As he got under the covers, the lightning suddenly
-flashed through the window and he discovered that he was in the wrong room.
-He instantly jumped up and started to dash for the hallway. "It's too late,
-called the girl from the bed, "my guy doesn't pray."
-%
-The two men feigned friendship but secretly hated each other's guts and took
-great pleasure in giving one another the needle on any and all occasions.
-This particular evening they met, quite by accident, at a popular bar.
-The conversation started innocently enough; then one, with sudden inspiration,
-ran his hand over the other's bald head and exclaimed,
- "By God, Fred, that feels just like my wife's ass!"
-The other ran his own hand over his head and nonchalantly retorted,
- "Well, I'll be damned, Jim, so it does, so it does!"
-%
-The two things that you should never lend out are your car
-or your woman. Someone's bound to throw a rod in either one.
-%
-The Unitarians are really just a bunch of atheists who really
-like going to church.
-%
-The United States Army:
-194 years of proud service,
-unhampered by progress.
-%
-The Utah version of this joke goes:
- One of the Council of the Twelve runs breathlessly into the Presidents'
-office one day. The President looks up and says "Brother, what is so important
-that you ran all the way here, losing your breath?"
- The Council member finally regains his breath, and says "The Savior is
-in the lobby!!"
- The President immediate starts for the door, crying "It has come! The
-prophecies are fulfilled! We are all about to be uplifted!"
- The Council member says "Wait! You didn't let me finish! She's...
-black, and SHE IS PISSED!"
-%
-The very proper spinster didn't go out very often, but she had some important
-shopping to do that morning and so decided to have her lunch in what appeared
-to be a nice quiet respectable restaurant. With the noontime crowd, many
-customers shared their tables with strangers; the spinster selected a seat
-next to an attractive, young office girl. The girl finished her sandwich and
-coffee, then settled back and lit up a cigarette. The older woman controlled
-herself for a few moments and then snapped,
- "I'd rather commit adultery than smoke in public."
- "So would I," said the girl, "but I only have half an hour for lunch."
-%
-The voters have spoken, the bastards.
-%
-The wages of sin are high -- unless you know someone who does it for nothing.
-%
-The warden of the De Luxington preparatory school for boys was holding a
-hearing. The lad before his desk, a very popular young fellow, was angrily
-accusing one of his schoolmates of having assaulted him sexually.
- "I must warn you, m'boy, this is a very serious charge, the warden
-said.
- "I don't care. I tell you it is true. He raped me, warden." The
-youth pointed to another, somewhat larger boy smirking in the corner.
-"That's him, sir, the one who forced me to do all those crimes against
-nature. The bully!"
- "Now tell me, son, as closely as you can, when this happened."
- "Sir, two weeks ago on Wednesday at 4:00, then at 7:00 that same
-evening, on Friday, twice on Saturday, two times on Monday, once on
-Wednesday, and then he met that bitch Roy and he hasn't touched me since."
-%
-The whole religious complexion of the modern world is due to the
-absence from Jerusalem of a lunatic asylum.
- -- Havelock Ellis
-%
-The whole world is about three drinks behind.
- -- Humphrey Bogart
-%
-The wife of young Richard of Limerick
-Complained to her husband, "My quim, Rick,
- Still grows in diameter
- Each time that you ram at her;
-How can your poor tool stay so slim, Rick?"
-%
-The woman who lives on the moon
-Is still cherishing the balloon
- Of an earthling who'd come
- And given her some,
-But had dribbled away all too soon.
-%
-The woman you buy -- and she is the least expensive -- takes a great
-deal of money. The woman who gives herself takes all your time.
- -- Honore de Balzac
-%
-The word "spine" is, of course, an anagram of "penis". This is true in
-almost fifty percent of the languages of the Galaxy, and many people
-have attempted to explain why. Usually these explanations get bogged
-down in silly puns about "standing erect".
- -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
-%
-The work of Mess Sergeant Potgieter
-Is not merely reading a meter.
- By orders of Kirk
- A part of his work
-Is dosing the food with saltpeter.
-%
-The world is an 8000 mile in diameter spherical pile of shit.
-%
-The world is so full of a number of things,
-I'm sure we should all be as happy as kings.
- I'll tell you a story--
- It won't take me long--
-Of a brother and sister whose tale is my song.
-
-There was an old fellow and what do you think?
-He lived on the cheese that he scraped from his dink.
- He whacked it, he hacked it,
- He ate it with glee-
-Was there ever a fellow so happy as he?
-
-This charming old chap had a sister as well:
-She was ugly and gaunt, with a horrible smell.
- Her cunt was so dirty
- It stank like a beast,
-And the odor killed flies as they gathered to feast.
-
-What a wonderful family! What marvelous style!
-I'll bet you and I aren't close by a mile.
- Their odor and diet
- Won't soon be forgotten,
-And one day you and I may be equally rotten.
-%
-The young girl was having a heart-to-heart talk with her mother on her
-first visit home since starting college.
- "Mom, I have to tell you," the girl confessed. "I lost my virginity
-last weekend."
- "I'm not surprised," said her mother. "It was bound to happen sooner
-or later. I just hope it was a romantic and pleasurable experience."
- "Well, yes and no," the pretty student remarked. "The first eight
-guys felt great, but after them my pussy got real sore."
-%
-The young stud walked into a bordello. After he took his clothes off, the
-woman was puzzled to see him put a clothespin on his nose, stuff cotton in
-his ears, and put a prophylactic on his penis.
- "Hey," she asked, "what the hell are you doing?"
- "Well, ma'am", replied the stud, "there are two things I just can't
-stand. A screaming woman and the smell of burning rubber."
-%
-Then there was the girl who was engaged
-to a gymnast -- 'til he broke it off.
-%
-Then there was the girl whose boyfriend didn't smoke, drink or
-swear, and never, ever made a pass at her. He also made his own dresses.
-%
-Then there was the guy that got badly messed up fighting
-for his girl's honor. It seems she wanted to keep it.
-%
-Then there was the middle-aged businessman who took his spouse to Paris.
-After traipsing with her from one mansion du couture to another, be begged
-for a day off to rest and got it. With the wife gone shopping again, he
-went to the Ritz Bar and picked up a luscious parisienne. They got on
-well until the question of money came up. She wanted a hundred American
-dollars; he offered fifty. They couldn't get together on the price; so
-they didn't get together. That evening he escorted his wife to one of the
-nicer restaurants on the Rue de Rivoli, and there he spotted his gorgeous
-babe of the afternoon seated at a table near the door.
- "See, monsieur?" she said as they passed her. "Look what you got
-for your lousy fifty bucks."
-%
-Then there was the Scot that wanted to rob a jewelry store -- he tossed a
-brick through the show window and ran off with a king's ransom. They
-caught him when he came back for the brick.
-%
-There are a couple of things about her I greatly admire.
-%
-There are also a lot of nice buildings in Haiphong. What their
-contributions are to the war effort I don't know, but the desire to
-bomb a virgin building is terrific.
- -- Commander Henry Urban, Jr.
-%
-There are Jews in the world, there are Buddhists, Every sperm is sacred,
-there are Hindus and Mormons and then Every sperm is great,
-there are those that follow Mohammed ...But... If a sperm is wasted,
-I've never been one of them. God gets quite irate.
-
-I am a Roman Catholic Every sperm is wanted,
-And have been since before I was born, Every sperm is good.
-And the one thing they say about Catholics is Every sperm is needed,
-They'll take you as soon as you're warm. In your neighborhood.
-
-You don't have to be a six-footer. Let the heathens spill theirs,
-You don't have to have a great brain. On the dusty ground.
-You don't have to have any clothes on, God shall make them pay for
-You're a Catholic the moment Dad came Each sperm that can't be found.
-...Because...
-
-Hindu, Taoist, Mormon, Every sperm is useful,
-spill theirs just anywhere Every sperm is fine.
-but God loves those who treat their God needs everybodies,
-semen with more care. Mine, and mine, and mine.
- -- Monty Python, "Every Sperm is Sacred"
-%
-There are many ways to say "I love you", but fucking is the fastest.
-%
-There are only six Democrats in all of Hinsdale County and you, you son of
-a bitch, you ate five of them.
- -- Colorado judge, sentencing Alfred E. Packer for
- cannibalism in 1874.
-%
-There are revolutions that are sweeping the world and we in America
-have been in a position of trying to stop them. With all the wealth of
-America, with all of the military strength of America, those
-revolutions are revolutions against a form of political and economic
-organization in the countries of Asia and the Middle East that are
-oppressive. They are revolutions against feudalism. [1952]
- -- Supreme Court Justice William O. Douglas
-%
-There are so many people wanting a piece of my ass that some of them
-are having to take turns.
- -- T.K.
-%
-There are some things we mustn't expose,
-So we hide them away in our clothes.
- Oh, it's shocking to stare
- At what's certainly there--
-But why this is so, heaven knows.
-%
-There are three religious truths:
-1. Jews do not recognize Jesus as the Messiah.
-2. Protestants do not recognize the Pope as the leader of the
- Christian faith.
-3. Baptists do not recognize each other in the liquor store or
- the adult book store.
-%
-There are three women on the fast track in a particular company. The
-president realizes it's time to promote one of them, but they're all so
-competent that he's not sure which one to choose. So he devises a little
-test. One day while they're all at lunch, he places $500 on each of their
-desks. #1 returns it to him immediately. #2 pockets it. #3 invests
-in the market and returns $1,500 to him in the morning. Who gets the
-promotion? The one with the big tits!
-%
-There are two sides to every divorce: yours and the shithead's.
-%
-There are two trees in the forest. They are very proud trees. One day
-they notice a sapling half-way between them.
- One tree proclaims, "That is a son of beech!"
- "No, that is a son of a birch!" insists the other.
- "A son of a BEECH!"
- "A son of a BIRCH!"
- "Son of a beech!"
- "Son of a birch!"
-
-The fighting attracts a woodpecker who informs them that he can tell what
-kind of tree the sapling is by its taste. First he tastes the beech and
-the birch. Then he tastes the sapling. "Well now, is that a son of a
-beech or a son of a birch?" asks the beech.
- "You're both wrong!" says the bird. "That's the best piece of ash
-I've had my pecker in for a long time!"
-%
-There is a definite parallel between shots of tequila and a
-woman's breasts. One is not enough and three are too many.
-%
-There is a God, but He drinks.
- -- Blore
-%
-There is a new model of car being sold in San Francisco --
-the pervertible. The top doesn't go down, but the driver does.
-%
-There is a young faggot named Mose
-Who insists that you fuck his long nose.
- And you'll double the joy
- Of this lecherous boy
-If you'll tickle his balls with your toes.
-%
-There is a young lady named Aird,
-Whose bottom is always kept bared.
- When asked why she pouts,
- She says "The Boy Scouts,
-All beg me to please Be Prepared!"
-%
-There is nothing as overrated as a bad
-lay, or as underrated as a great shit.
-%
-There is nothing wrong with screwing everyone in sight.
-Boring your friends about it is the sin.
- -- Mama Liz
-%
-There once was a man named Eugene
-Who invented a screwing machine
- Concave and convex
- It served either sex
-And it played with itself in between.
-%
-There once was a Sailor who looked through a glass
-And spied a fair mermaid with scales on her... island.
-Where seagulls flew over their nest.
-She combed the long hair which hung over her... shoulders.
-And caused her to tickle and itch.
-The sailor cried out "There's a beautiful... mermaid.
-A sittin' out there on the rocks."
-The crew came a running, all grabbing their... glasses.
-And crowded four deep to the rail.
-All eager to share in this fine piece of... news.
-...
-"Throw out a line and we'll lasso her... flippers.
-And soon we will certainly find
-If mermaids are better before or be... brave
-My dear fellows," The captain cried out.
-And cursing with spleen.
-This song may be dull, but it's certainly clean.
- -- "The Clean Song", Oscar Brandt
-%
-There was a man who, every day, would buy a newspaper on the way to work,
-glance at the headline, and hand it back to the newsboy. Day after day the
-man would go through this routine. Finally the newsboy could not stand it
-and he asked the man, "Why do you always buy a paper and only look at the
-front page before discarding it?"
- The man replied, "I am only interested in the obituaries."
- "But they are on page 21. You never even unfold the newspaper."
- "Young man," he replied, "the son-of-a-bitch I'm looking for will
-be on the front page."
- -- Attributed to FDR
-%
-There was a young man hitchhiking along a road one day. A car stopped and the
-driver opened the door and asked, "What political party are you with?"
- He replied, "Why, I'm a Democrat."
- And the driver slammed the door and rode off. The guy was pretty
-discouraged when another car came along, and the driver asked the same
-question.
- The guy answered, "Uh, I'm a Democrat."
- And again, the driver slammed the door and rode off. Now he was
-downright confused when another car came along. The driver was an attractive
-lady, and she asked the same question.
- He answered: "I'm a Republican."
- And she answered, "Well, then, hop on in."
- They drove on for a few minutes when he began to notice that her
-skirt was beginning to get hiked up on her thighs. Finally, he couldn't take
-it any more, and said "Ma'am, stop the car and let me out. I've only been
-a Republican for 15 minutes, and already I feel like screwing someone!"
-%
-There was a young tenor named Springer,
-Got his testicles caught in a wringer.
- He hollered in pain,
- As they rolled down the drain,
-"There goes my career as a singer!"
-%
-There was once a newly-married couple. Now these two lovers were, well,
-rather uptight about using expressions such as "having sex", "getting it on",
-or "boffing the brains out". So, they decided to use the euphemism, "doing
-the laundry" whenever the topic of sex came up.
- One evening, hubby said, "Well, honey, feel like doing some laundry
-tonite?", and she consented. The next evening, hubby again asked, "Sweetie,
-feel like doing some laundry tonite?" Well, wifey wasn't really in the mood,
-but complied. On the third night, when hubby approached her, asking her to
-participate in doing still MORE laundry, she replied, "Oh, Hon, I'm really not
-in the mood for doing any laundry tonite."
- Well, hubby, being a bit disappointed, locked himself in the bathroom
-and engaged in a spot of self-abuse instead. Upon returning to the living
-room, wifey said, "Well, Poopsie, I've changed my mind -- how about doing
-some laundry?" To which he replied, "Oh, no, that's okay, I just did a small
-load!"
-%
-There was once a salesman who had an outstanding record for selling tooth-
-brushes. His boss, wondering at his unlikely success, sent a man out to
-follow the salesman on rounds to see what pitch he gave that brought such
-good results. It was soon found that this particular salesman went to the
-corner of a busy street and opened up his briefcase, and on one side was the
-assortment of toothbrushes, and on the other side various chips and garnishes
-and a bowl of brownish stuff. He would grab a likely customer and give them
-the following pitch.
- "Good morning, ma'am, this is a commercial promotion for --- brand
-of chip dip. Would you care to give it a try?"
- At that point the person would try it, then spit it out and scream
-in utter disgust, "This tastes like shit!"
- The salesman would smile and say, "It is. You want to buy a
-toothbrush?"
-%
-There was something about her I liked,
-but I couldn't put my finger on it.
-%
-There were the Scots
-Who kept the Sabbath
-And everything else they could lay their hands on.
-Then there were the Welsh
-Who prayed on their knees and their neighbors.
-Thirdly there were the Irish
-Who never knew what they wanted
-But were willing to fight for it anyway.
-Lastly there were the English
-Who considered themselves a self-made nation
-Thus relieving the Almighty of a dreadful responsibility.
-%
-There's a handsome boy who tells me how I've changed his past. He buys me
-a brandy... Could it be he's really just after my ass?
- -- Pete Townshend, "How Many Friends"
-%
-There's a tendency today to absolve individuals from moral responsibility and
-treat them as victims of social circumstance. You buy that, you pay with your
-soul. It's not men who limit women, it's not straights who limit gays, it's
-not whites who limit blacks. What limits people is lack of character. What
-limits people is that they don't have the fucking nerve or imagination to star
-in their own movie, let alone direct it.
- -- Bernard Mickey Wrangle
-%
-There's a vas deferens between men and women.
-%
-There's amnesia in a hangknot,
-And comfort in the ax,
-But the simple way of poison will make your nerves relax.
- There's surcease in a gunshot,
- And sleep that comes from racks,
- But a handy draft of poison avoids the harshest tax.
-You find rest on the hot squat,
-Or gas can give you pax,
-But the closest corner chemist has peace in packaged stacks.
- There's refuge in the church lot
- When you tire of facing facts,
- And the smoothest route is poison prescribed by kindly quacks.
-Chorus: With an *ugh!* and a groan, and a kick of the heels,
- Death comes quiet, or it comes with squeals --
- But the pleasantest place to find your end
- Is a cup of cheer from the hand of a friend.
- -- Jubal Harshaw, "One For The Road"
-%
-There's been no top authority saying what marijuana does to you. I
-really don't know that much about it. I tried it once but it didn't do
-anything to me.
- -- John Wayne
-%
-There's many a slurp t'wixt the tip and the zip.
-%
-There's more than one way to skin a cat:
- #15 -- Krazy Glue and a toothbrush.
-%
-There's more than one way to skin a cat:
- #27 -- Use an electric sander.
-%
-There's more than one way to skin a cat:
- #32 -- Wrap it around a lonely frat man's pecker.
-%
-There's more than one way to skin a cat:
- #33 -- A bicycle pump.
-%
-There's nothing better than good sex. But bad sex? A peanut butter
-and jelly sandwich is better than bad sex.
- -- Billy Joel
-%
-There's nothing wrong with America that a good erection wouldn't cure.
- -- David Mairowitz
-%
-They ought to make butt-flavored cat food.
- -- Gallagher
-%
-They watched the sun slowly sink behind the hills, and the fiery glow on the
-lake fade into darkness. He eyed her shadowy figure, accentuated by the moon-
-light, as the tension from within began to fuel his animalistic desires.
-She followed him, ever so quietly, as they sought a secluded corner in the
-barn. Alone! At last. His hands roamed about her soft back, around to her
-thighs, and finally caressed her budding nipples. Oh, how smooth and succulent
-she was! "Was it so wrong?", he asked himself. No, he thought, for his
-father had done it, as did his own father, ad infinitum. The boiling,
-uncontrollable rage within him became unbearable. She signaled her eagerness,
-spreading her legs, as he grasped her nipples again. Stroking, again and
-again, longer each time. It began coming; again, again, again, again. His
-mind raced with fear "Will it stop?". Exhausted, he lay down beside her.
-"Dear God, what have I done?". Suddenly, his father burst in. His eyes
-burned as he stared for what seemed an eternity. Finally, his father spoke.
- "Son, you ain't supposed to milk the damn cow till mornin'!"
-%
-They're just jealous because they don't have three
-wise men and a virgin in the whole organization.
- -- Mayor Vincent J. "Buddy" Cianci, on the
- ACLU's suit to have a city nativity scene removed.
-%
-This Czech walks into police station in 1968 during the Fraternal Assistance.
-Czech: Hey, out there in the street, a Swiss soldier knocked me down and
- took my Russian watch.
-Desk Sergeant: Come again?
-Czech: Right out there in the street, a Swiss soldier knocked me down and
- took my Russian watch.
-DS: You're confused. Why would there be a Swiss soldier here? And who
- would want to own a Russian watch? It was a Russian soldier who
- knocked you down and took your Swiss watch, right?
-Czech: Well, maybe, but you said it, not me.
-%
-This fellow rushed into a crowded tavern on Saturday night. Men and women
-stood three-deep at the bar. Our man, who felt nature calling strongly,
-looked about him but couldn't see anything that resembled a john. He saw a
-stairway and bounded up the steps to the second floor in his increasingly
-desperate search. Just as his bowels threatened to erupt, he spotted a
-one-foot by one-foot hole in the floor. Now, at the end of his control, he
-decided to take advantage of the hole. He dropped his pants, hunched over it,
-and did his thing. Thoroughly relieved and relaxed, he sauntered down the
-steps to find, to his surprise, that the crowded bar was now empty.
- "Hey!" he yelled to the seemingly empty room, "Where is everyone?"
- From behind the bar a voice responded, "Hey! Where were you when
-the shit hit the fan?"
-%
-This guy makes an appointment with a doctor because his hemorrhoids are
-really bothering him. The doctor gives him some suppositories and tells
-him to come back in a week for a checkup. "How's it going?" he asks
-the patient a week later.
- "I gotta tell you the truth, Doc," said the man. "For all the
-good these pills did me, I coulda shoved them up my ass."
-%
-This guy, see, was walkin' down the street sportin' two -- not one, but two
--- black eyes; a coupla real shiners. He chanced upon his buddy walkin' th'
-other way... they stopped to talk... "Hey guy," sez his buddy, "where'd'ja
-git them good lookin' shiners? Musta been a helluva fight."
- "Well, actually, I got them in church," sez he.
- "Nowwaitaminnit," sez the friend, "nobody gits black eyes in church!"
- "I swear I did," sez he, "and here's how it happened. We all got up
-to sing a hymn, you see, and the fat lady in front of me got her dress all
-stuck up in the crack of her butt, so bein' as how I'm a real gennulman an'
-all, well, I leaned forward and pulled it out for her. And you know what?
-She just turned around, hauled off and slugged me one!"
- "Well," his buddy replies, after he can talk again, "that shore 'nuff
-explains one of 'em. Howdja git th' other one?"
- "Well," sez he, "like I said, I'm a gennulman, even when somebody does
-me wrong, so when I saw she didn't like it like that, I stuck it back in."
-%
-This guy walks into a bank and up to a female bank teller:
-
-Man: "I want to open a fuckin' savings account."
-Teller: "Excuse me, sir?"
-M: "Listen, bitch, I want to open a fuckin' savings account."
-T: "Sir, I don't have to listen to this abusive language."
-M: "LOOK! I just want to open a fuckin' savings account."
-T: "Sir, you leave me no choice but to speak to the manager."
-
-The teller walks over and explains the customer's rude behavior to the bank
-manager who then accompanies her back to the teller booth.
-
-Mgr: "Can I help you, sir?"
-M: "I want to open a fuckin' savings account."
-Mgr: "Please, sir, we'll be delighted to help you, but we must request
- that you not use abusive language to our tellers."
-M: "Look. I just won $25 million in the state lottery and I want to
- open a fuckin' savings account!"
-Mgr: "I see. And has this cunt been giving you any trouble?"
-%
-This guy was screwing his neighbors wife when a car pulls into the drive.
-"My husband!" she screams. He panics and jumps out the window. He finds
-himself on the street, naked, under cloudy skies. There is no place to hide
-except in a crowd of joggers. As he runs along, a woman looks over and says,
- "Do you always jog in the nude?"
- "Yes ma'am!" he replies.
- "Does it always result in that kind of sexual excitement?" she asks.
- "Yes ma'am!" he replies.
- "Do you always wear a condom?"
- "Only when it rains, lady. Only when it rains."
-%
-This hot and dusty cowboy rode in from the mesa, filthy and exhausted. He
-obviously had had nothing but his horse for company for a couple of weeks
-and was looking forward to a couple of cold beers in the saloon. Swinging
-off his horse and hitching it to the rail, the cowboy gave his horse an
-affectionate slap on the neck. Then he astonished an old cowhand lounging
-on the porch by moving around to the horse's hindquarters, lifting up its
-tail and planting a demure kiss on its asshole.
- "What'd you do that for?" asked the cowhand, completely repulsed.
- "Chapped lips," said the cowboy, heading for the saloon doors.
- "Wait a minute," said the old guy. "Whaddaya mean, chapped lips?"
- "Keeps ya from lickin' 'em," explained the cowboy.
-%
-This is a test of the emergency cunnilingus system. If this had been an
-actual emergency, you would have known it!
-%
-This is National Smokers-Are-Shits Week.
-%
-This limerick is **SO**FILTHY** that it would offend you. So I'll put
-"di-dah" for the filthy words:
-
- Di-dah, di-dah, di-dah di-dah,
- Di-dah di-dah di-dah, di-dah;
- Di-dah di-dah di-dah?
- Di-dah di-dah di-dah.
- Di-dah di-dah, di-dah di-fuck.
-%
-This story concerns a man who, after putting his son to bed each night, would
-stand by his boy's door and listen to his son saying his prayers. One night,
-the boy ended his prayers with, "God specially bless Granddad, who won't be
-with us much longer." The man thought this was rather curious, but passed it
-off as childish whimsy. The next day, however, he received a call from his
-mother, informing him that his father had passed away early that morning.
-During the next few weeks, he listened particularly closely to his son's
-prayers, but noticed nothing unusual. Then, one night, the boy ended his
-prayers with, "God specially bless Grandmom, who won't be with us much longer."
-Although the shock of the original incident had worn off during the intervening
-weeks, he nonetheless phoned his mother to inquire as to her health. He went to
-bed reassured, only to be awakened in the night by his sister calling with the
-news that their mother had died suddenly in the night. The father had a series
-of psychological tests done; nothing unusual was uncovered. About a month
-later, the boy ended his prayers with, "God specially bless Daddy, who won't
-be with us much longer." The man was panic-stricken, certain that he was
-going to die during the night. He resolved to stay awake all night; if awake
-and alert he should be able to prevent any tragedy. Morning came. Breathing
-a huge sigh of relief, he went to get the paper off the porch. There, lying
-dead on the doorstep, was the milkman.
-%
-This system goes down more often than a two-dollar whore.
-%
-This time it's for love; next time it's $100.00.
-%
-THORNY:
- A thailor at thea.
-%
-Thou shalt not omit adultery.
-%
-Thought:
- Girls get minks the same way minks get minks!
-%
-Three fine Irish lads, O'Rourke, O'Malley and O'Donnell, worked together at
-the local brewery. One day, as fate would have it, O'Rourke fell into one
-of the beer vats and drowned. O'Malley and O'Donnell, completely crestfallen,
-had to break the news to his wife.
- They went 'round the Widow O'Rourke's house and informed her that her
-poor dear Patrick had drowned in a beer vat that very day. Choking back her
-tears, she asked them "Tell me now, did me poor Patty suffer much?"
- "I don't think so," replied O'Donnell. "He climbed out twice to take
-a piss."
-%
-Three gay guys were discussing what they thought their favorite sport would
-be. The first decides on football, 'cause of all those gorgeous guys bending
-over in their tight pants.
- "Definitely wrestling," sighs the second guy. "Those skimpy little
-costumes, and think of the holds."
- "Definitely baseball," says the third guy. "Why? Well, I'd be
-pitching with the bases loaded, the batter would hit a savage one-hopper
-right to me, I'd catch it, and I'd just stand there while the other guys
-rounded the bases. Meanwhile, the crowd would be going crazy, screaming,
-`Throw the ball, you cocksucker!' and that's what I like -- recognition!"
-%
-Three minutes of serious sex and I need eight hours of sleep and
-a bowl of Wheaties.
- -- Richard Pryor
-%
-Three things have been difficult to tame: The oceans, fools,
-and women. We may soon be able to tame the ocean. Fools and
-women will take a little longer.
- -- Spiro Agnew
-%
-Three women always hang their laundry out in the backyard. When it rains,
-however, the laundry always gets wet. All the laundry, that is, except
-for Laurie's. Laurie never seems to have her laundry out when it rains.
- So, one day, they are all out in the backyard putting their clothes
-on the line when one of the women says to Laurie, "Laurie, how come it
-never rains when you have your laundry out?"
- "Well," replies Laurie, "when I wake up in the morning, I check out
-my husband Paul. If his penis is hanging over his right leg, I know it's
-going to be a great day. If his penis is hanging over his left leg, I know
-it might rain. I don't know why it works, but he's never been wrong!"
- "Laurie, what if he has an erection?" asks the other woman.
- "Honey, on a day like *that*, you don't do the *laundry*."
-%
-Three young women were attending the same logic class given at one of the
-better universities. During a lecture the professor stated that he was
-going to test their ability at situation reasoning.
- "Let us assume," said the prof, "that you are aboard a small craft
-alone in the Pacific, and you spot a vessel approaching you with several
-sex-starved sailors on board. What would you do in this situation to avoid
-the problem?"
- "I would attempt to turn my craft in the opposite direction and
-flee," said the first girl.
- "I would pass them, and hope that I could fend them off," responded
-the second woman.
- "Frankly," murmured the third woman, "I understand the situation,
-but I fail to see the problem."
-%
-Three-bag ugly, adj.:
- That's when you put one bag over her head, one bag over your
- head in case her's falls off, and one over the dog's to keep
- it from howling.
-
-Four-bag ugly, adj.:
- When you leave a bag by the door in case someone drops by.
-%
-Through a major bureaucratic error, you are made county coroner.
-You seriously consider the job because it gives you:
-
- 1: Lots of unclaimed wedding rings and watches.
- 2: Lots of gold fillings and bridges.
- 3: Free blood.
- 4: A constantly changing array of new friends who aren't at
- all stuffy about what happens to their genitalia.
-%
-Tim and I a hunting went
-We found three damsels in a tent,
-As they were three, and we were two,
-I bucked one and Timbuktu.
- -- the only known poem using the word "Timbuktu"
-%
-'Tis the dream of each programmer,
-Before his life is done,
-To write three lines of APL,
-And make the damn things run.
-%
-To a Real Woman, every ejaculation is premature.
-%
-To be the kind of girl designed to be kissed between the thighs.
-%
-To win a woman in the first place one must please her, then undress her, and
-then somehow get her clothes back on her. Finally, so she will allow you
-to leave her, you've got to annoy her.
- -- Jean Giraudoux, "Amphitryon 38"
-%
-Today is gonna be one helluva week!
-%
-Todays title:
- Creative Violence in Sexual Relationships
-%
-Tonight's piss is tomorrow's Tang.
- -- An American astronaut
-%
-Tourist, n.:
- A pretty girl in Oklahoma.
-%
-Tourist to New Yorker:
- "Pardon me, sir, do you know what time it is, or should I
- just go fuck myself?"
-%
-Transvestite, n.:
- Someone who likes to eat, drink, and be Mary.
-%
-Tri Delts; everyone else has.
-%
-Trust me:
- Los Angeles for "Fuck you, your mother, and the horse
- she rode in on."
-%
-T-shirt of the Day:
- Head for the Mountains
- -- courtesy Anheuser-Busch beer
-
-Followup T-shirt of the Day (on the same scenic background):
- If you liked the mountains, head for the Busch!
- -- courtesy someone else
-%
-T-shirt of the Day:
-
- See Dick Drink...
- See Dick Drive...
- See Dick Die.
- DON'T BE A DICK.
-%
-T-shirt of the Week:
- I'm not excited, I'm cold!
-%
-'Twas orgy, and the hip and mod And as in raffish thought he sprawled,
-Did groove and trip out at the pad: The Radcliffe girl, no idle flirt,
-All whimsy were the slamming chicks, Crept past the hippies getting balled
-And the Radcliffe undergrad. And doffed her miniskirt.
-
-"Beware the Radcliffe girl, my son! One, two! One, two! And through
-The looks that melt, the claws that and through
- catch! The venerable staff went snicker-snack!
-Beware the Byrn Mawr deb, and shun He left her bred, sans maidenhead,
-The uppity Wellesleysnatch!" And went galumphing back.
-
-He took his venerable staff in hand: "And hast thou laid the Radcliffe girl?
-Long time the cool young stuff he Come to my arms, my horny boy!
- sought -- O spaced-out day! Calooh! Callay!"
-So rested he among the spree He cackled in his joy.
-And paused to smoke some pot.
- 'Twas orgy, and the hip and mod
- Did groove and trip out at the pad:
- All whimsy were the slamming chicks,
- And the Radcliffe undergrad.
-%
-Twenty years of romance make a woman look like a ruin; but
-twenty years of marriage make her something like a public building.
- -- Wilde
-%
-Two friends, an Italian boy and a Jewish boy, come of age at the same time.
-The Italian boy's father presents him with a brand-new pistol. On the other
-side of town, at his Bar Mitzvah, the Jewish boy receives a beautiful gold
-watch.
- The next day, in school, the two boys are showing each other what
-they got. It turns out that each boy likes the other's present better, and
-so they trade.
- That night, the Italian boy is at home and his father sees him
-looking at his new watch. "Where did you getta thatta watch?" he asks.
- The boy explains the trade, and the father blows his top. "Whatta
-you? Stupidda boy? Whatsa matta you!"
- "Somma day, you maybe gonna getta married. Then maybe somma day
-you gonna comma home and finda you wife inna bed with another man. Whatta
-you gonna do then? Looka atta you watch and say, `How longa you gonna be?'"
-%
-Two gentlemen met at the club after a long absence and talked.
- "Did you hear about Chumley?", one asked.
- "No, old man, what about him?"
- "Last seen in Africa, you know."
- "No, I didn't."
- "Yes. Appalling. Ran off with a gorilla. Fallen in love."
- "Queer."
- "Not Chumley. Female gorilla."
-%
-Two golfers were being held up as the twosome of women in front of them
-whiffed shots, hunted for lost balls and stood over putts for what seemed
-like hours.
- "I'll ask if we can play through," Bill said as he strode toward
-the women. Twenty yards from the green, however, he turned on his heel
-and went back to where his companion was waiting.
- "Can't do it," he explained, sheepishly. "One of them's my wife
-and the other's my mistress!"
- "I'll ask," said Jim. He started off, only to turn and come back
-before reaching the green.
- "What's wrong?" Bill asked.
- "Small world, isn't it?"
-%
-Two men and a woman were stranded on a desert island -
-
-Two weeks later, the woman was so ashamed of what she
-had been doing, she committed suicide.
-
-Two weeks later, the men were so ashamed of what they
-had been doing, they buried her.
-
-Two weeks later, the men were so ashamed of what they
-had been doing, they dug her back up.
-%
-Two men, both close to retirement, are working on the assembly line. One
-boasts to the other, "Last night I made love to my wife *three* times!"
- "Three times!", replies his friend. "How did you do it?"
- "Well," says the first man, "I made love to my wife and set the
-alarm clock for two hours later. When it went off we made love again.
-Then, I reset it for the morning and we made love once more before I came
-to work. I feel like a bull!"
- His friend says, "Well, that *is* fantastic! I'm going to have
-to give it a try." So, he goes home that night and makes love to his
-wife. Figuring he doesn't need to set the alarm clock, he settles off
-to sleep. Waking up a few hours later, he nudges his wife and they make love
-again. Waking up in the morning he makes love to his wife for the third
-time. Looking over at the clock he realizes that he's twenty minutes late
-for work. He throws on his clothes and runs down to the subway. When
-he gets to the factory his boss is standing there waiting.
- "Frank", he says, "I've been working for you for 18 years, and I've
-never been late before. You've got to forgive me twenty minutes this once!"
- "Well," replies his boss, "okay, but it's not the twenty minutes
-that had me worried. Where were you Tuesday, where were you Wednesday..."
-%
-Two men were standing around talking while nearby a large German Shepherd
-lay licking his balls. One man says to the other, "Damn, I wish I could
-do that."
- The other man replies, "Well, it's okay by me, but I think you
-ought to get to know him a little first."
-%
-Two midgets arrived at the convent door and asked to speak with the Mother
-Superior. Led into her office, the first one asked respectfully "Excuse
-me, your holiness, but are there any midget nuns in this convent?"
- Receiving a reply to the negative, he asked whether any midget
-nuns were to be found in any of the neighboring parish. Again the reply
-was no.
- The tiny man scratched his head and posed a final question. "Beggin'
-your pardon, Mother Superior, but would you know of *any* midget nuns at
-all, anywhere?" The nun shook her head.
- At which the first midget turned to the second midget, put his hand
-on his shoulder, and said, "You see, I told you you fucked a penguin!"
-%
-Two nuns, a mother superior and a new nun, are walking home one night from
-church when they are attacked by two vicious rapists. The two men drag the
-nuns off into the bushes and proceed to have their way with them. The mother
-superior is very afraid, but she knows that God will protect her. To show her
-strength and trust in God she yells out "Forgive him Father, for he knows not
-what he does!"
- To which the young nun replies "Oooooh, mine does!!"
-%
-Two old men are walking down the boardwalk when one of them tells the other
-that he has to leave, his wife is expecting him to come home and make love
-with her.
- The other man is astonished. "Make love to your wife? You're as old
-as I am! Nearly eighty years old! What do you mean you have to go home and
-make love to your wife?"
- The first man smiles and says, "We have a *great* sex life. We make
-love every day."
- "You're kidding!" says his friend. "How do you do it?"
- "Pumpernickel bread. That's the secret." And he dashes off home.
- The other man starts to walk home. "Hmmm," he thinks to himself
-pumpernickel bread. Well, it's worth a try." So he goes into a nearby
-bakery.
- Going up to the woman at the counter, he asks for their entire stock
-of pumpernickel bread. The woman stares at him in astonishment. "You want
-all the pumpernickel bread we have? Are you sure? Don't you know that it
-will get hard?"
- "How come," demands the man, "everybody knows about this but me?"
-%
-Two Peace Corp. doctors who had just returned to a stateside hospital
-were in front of the main desk in the midst of a heated argument that
-went along these lines:
- (1st doctor) "No, no, no! It's 'waaaahmmmb'"
- (2nd doctor) "No you're wrong! It's 'woooooommmb'"
-and this continued for quite sometime.
- Finally a nurse stepped in and said: "The correct pronunciation is
-'womb'" and trotted off.
- (1st doctor) "That shows you what she knows."
- (2nd doctor) "Yeah. I bet she's never even SEEN a hippopotamus,
-let alone heard one fart underwater."
-%
-Two pirates are sitting in a seaside tavern, talking. One of them has a
-hook instead of a hand, and an eye patch. The other pirate has a wooden
-leg. Over a few beers, they start to tell each other how they received their
-injuries.
- "One day," says the first pirate, "we had pulled alongside a merchant
-vessel and were boarding her. I had my sword drawn when suddenly a man with
-a saber caught me by surprise and cut my hand off. So I had this hook put
-on. How did you lose your leg?"
- "From a broadside of grapeshot from an English military vessel, in a
-terrific battle off the coast of France. And how about your eye?"
- "Well, I don't really like to talk about it," said the first pirate.
- "Come on," says the second pirate. "It doesn't matter after all
-these years, does it?"
- "Oh, okay," says the first pirate. "See, it's pretty embarrassing;
-a seagull shit in my eye."
- "A seagull!? I can see how that would hurt, but I don't see why
-you would *lose* the eye..."
- "But," the first pirate says, "it was my first day with the hook."
-%
-Two recent emigrants to the United States, on their first day off the boat
-in New York City, spied a hotdog vendor. "Do they eat dogs in America?"
-one asked his companion.
- "I don't know."
- "Well, if we're going to live in America, we have to learn to eat
-American foods."
- So they each bought a wax paper wrapped hotdog and sat down to eat
-them on a nearby park bench. One man looked inside his wax paper, then over
-at the other man, and asked, "So, what part did you get?"
-%
-Two women are talking; one says to the other, "Say, weren't you dating that
-cute French horn player? What ever happened to him?"
- "Well," replies her friend, we're still seeing each other, but,
-I must admit, we've had some problems."
- "Problems? What's wrong?"
- "You see," says the second woman, "every time he kisses me, he
-wants to shove his fist up my ass."
-%
-Two young men seated in a restaurant were watching a customer busily
-disposing of a plate of oysters on the half shell. One of the young
-men remarked to his friend,
- "Did you ever hear that business about raw oysters being
-good for a man's virility?"
- "Yes, why?" the friend replied.
- "Well, take it from me, that's a lot of foolishness. I ate a
-dozen of them the other night, and only nine worked."
-%
-Un moine au milieu de la messe A monk in the middle of mass
-S'eleva et cria en detresse; Stood up and cried out in distress;
- "La vie religieuse, "The religious life
- C'est sale et affreuse," Is dirty and horrid,"
-Et se poignarda dans les fesses. And stabbed himself in the ass.
- -- Edward Gorey
-%
-Uncle Sam comes off as the perverted relative who'll offer you a
-bit of candy, but if you won't bend over for him, you get a beating.
-%
-Under capitalism, man exploits man. Under Communism, it's just the
-opposite.
- -- John Kenneth Galbraith
-%
-Unfair animal names:
-
--- tsetse fly -- bullhead
--- booby -- duck-billed platypus
--- sapsucker -- Clarence
- -- Gary Larson
-%
-Unitarians pray "To whom it may concern".
-%
-UNIX is hard. Let's go shopping!
-%
-Unix programmers do it with pipes.
-%
-Upon leaving a hotel bar one evening, an executive noticed a drunk sitting
-on the edge of a potted palm in the lobby, crying like a baby. Because he'd
-had a couple himself that night, and was feeling rather sorry for his fellow
-man, he asked the inebriated one what the trouble was.
- "I did a terrible thing tonight," sniffled the drunk. "I sold my
-wife to a guy for a bottle of Scotch."
- "That is terrible," said the man, too much under the weather to
-muster any real indignation. "And now that she's gone, you wish you had her
-back."
- "Thas right," said the drunk, still sniffling.
- "You're sorry you sold her, because you realize too late that you
-love her," sympathized the executive.
- "No, no," said the drunk. "I wish I had her back because I'm
-thirsty again."
-%
-Uppers are no longer stylish, methedrine is almost as rare as pure acid
-or DMT. "Consciousness Expansion" went out with LBJ and it is worth
-noting, historically, that downers came in with Nixon.
- -- Dr. Hunter S. Thompson
-%
-U.S. of A.:
- "Don't speak to the bus driver."
-Germany:
- "It is strictly forbidden for passengers to speak to the driver."
-England:
- "You are requested to refrain from speaking to the driver."
-Scotland:
- "What have you got to gain by speaking to the driver?"
-Italy:
- "Don't answer the driver."
-%
-Useful Farsi phrases for Americans traveling to Iran:
-
-AKBAR KHALI-KILI HAFTIR LOTFAN.
- Thank you for showing me your marvelous gun.
-
-FEKR GABUL CARDAN DAVAT PAEH GUSH DIVAR.
- I am delighted to accept your kind invitation to lie down
- on the floor with my arms above my head and my legs apart.
-
-SHOMAEH FEKR TAMOMEH QEH GOFTEH BANDE.
- I agree with everything you have ever said or thought in your life.
-%
-Useful Farsi phrases for Americans traveling to Iran:
-
-AUTO ARRAREGH DAVATEMAN MANO SEPAHEH-HAST.
- It is exceptionally kind of you to allow me to
- travel in the trunk of your car.
-
-FASHAL-EH TUPEHMAN NA DEGAT MANO
-GOFTAM CHEESHAYEH MOHEMA RAJEBEH KESHVAREHMAN.
- If you will do me the kindness of not harming my genital
- appendages I will gladly reciprocate by betraying my
- country in public.
-
-KHREL, JEPAHEH MANEH VA JAYEH AMRIKAHEY.
- I will tell you the names and addresses of
- many American spies traveling as reporters.
-%
-Useful Farsi phrases for Americans traveling to Iran:
-
-MAMNOUNAN GHORBAN IN DAFAYEH MEEMUNAM.
- It is with greatest pleasure that I sign
- this confession of capital crimes.
-
-MATERNIER GHERMEZ AHLIEH, GHORBAN.
- The red blindfold would be lovely, excellency.
-
-TIKEH NUNEH BA OB KHRELEH BEZORG VA KHRUBE BOYAST INO BEGERAM.
- The water-soaked bread crumbs are delicious, thank you.
- I must have the recipe.
-
-ETEHFOR'AN, DEHRATEE, OTAGEH SHOMA MIKRASTAM KHE
-DO HAFTAEH BA BODANEH SHEEREEL TEEGZ.
- Truly, I would rather be a hostage to your greatly esteemed
- self than spend a fortnight upon the person of Cheryl Tiegs.
-%
-USENET is like a herd of performing elephants with diarrhea --
-massive, difficult to redirect, awe-inspiring, entertaining, and
-a source of mind-boggling amounts of excrement when you least
-expect it.
- -- Gene Spafford
-%
-User friendly software searching for friendly Hardware to interface with.
-Hardware may present itself in floppy format as software has capability to
-upgrading same to full size firm. Size is not all that important; but byte
-sized bandwidth required -- header width is of more concern. Joystick should
-be able to toggle in different speeds and for some duration. Software is
-looking for system willing to perform intensive manipulation of keyboard as
-well as preparing the mainframe and disk drives. Fingering of all files
-permitted, and encouraged, before thrusting joystick into drive. Software
-is programmed not to copy; there is no need for removing joystick before
-completed execution of program. Program may be run several times per day...
-especially if special features and options are utilized.
-%
-vacation;look;find;talk;grep;touch;finger;find;flex;unzip;mount;workbone; \
-fsck;yes;gasp;fsck;yes;eject;umount;make clean;zip;split;done;exit
-%
-Vagina, n.:
- The box a penis comes in.
-%
-Vaginal lubricant, n.:
- A slitty slicker.
-%
-Vandalism On The Upswing!
- Last night, windows were broken and graffiti was sprayed over the
- front of the local sex shop, Le Sex Boutique, causing several hundred
- dollars in damage. In a later anonymous phone call, the provisional
- wing of the Salvation Army claimed responsibility.
-%
-Vatican upholds ban on contraceptives: "To heir is humane," claims the Pope.
-%
-VD, n.:
- The gift that keeps on giving.
-%
-Vegetarians for oral sex -- "The only meat that's fit to eat"
-%
-Very few modern women either like or desire marriage, especially after the
-ceremony has been performed. Primarily women wish attention and affection.
-Matrimony is something they accept when there is no alternative. Really,
-it is a waste of time, and hazardous, to marry them. It leaves one open
-to a rival. Husbands, good or bad, always have rivals. Lovers, never.
- -- Helen Lawrenson, "Esquire"
-%
-Vidi, vici, veni.
-(I saw, I conquered, I came.)
-%
-Viennese Oyster: Lady who can cross her feet behind her head, lying on her
-back, of course. When she has done so, you hold her tightly round each instep
-with your full hand and squeeze, lying on her full-length. Don't try to put
-an unsupple partner into this position -- it can't be achieved by brute force.
-You can get a very similar sensation -- unique rocking pelvic movement -- with
-less expertise if she crosses her ankles on her tummy, knees to shoulders, and
-you lie on her crossed ankles with your full weight. Why "Viennese" we don't
-know. Tolerable for short periods only but gives tremendous genital pressure
-for both.
- -- The Joy of Sex
-%
-Virgin, n.:
- An ugly third grader.
-%
-Virginity is a bubble on the sea of life,
-which takes but one prick to break.
- -- Jordan Sand
-%
-VIRGO (Aug. 23 to Sep. 22)
- Get it in writing. Be careful. You are surrounded by lechers and
- assholes; birds of a feather flock together. Trust no one. People
- will not be offended, because they've come to recognize you for the
- paranoid neurotic that you are. Your dentures are loose.
-%
-Visiting a lawyer for advice, the wife said, "I want you to help me obtain a
-divorce. My husband is getting a little queer to sleep with."
- What do you mean?" asked the attorney. "Does he force you to indulge
-in unusual sex practices?"
- "No, he doesn't," replied the woman, "and neither does the little
-queer."
-%
-W. Lafayette may not be the asshole of the universe...
- but you sure as hell can see it from there!
-%
-Waldheimers disease is what you have when you can't remember you were a Nazi.
-%
-War is menstruation envy.
-%
-Was it you that did the pushin',
-Left the stains upon the cushion,
-The footprints on the dashboard upside-down?
-Was it you, you little pecker,
-That got into my Rebecca,
-If you did, you'd better leave this town!
-
-Yes, 'twas I that did the pushin',
-Left the stains upon the cushion,
-Footprints on the dashboard upside-down.
-But since I stuck your daughter,
-I've had trouble passin' water,
-So I guess we're kind of even all around!
-%
-WASP, n.:
- Someone who gets out of the shower to take a piss.
-%
-Watch out for a cold wave this week. (Or maybe a warm WAC.)
-%
-Watching girls go passing by
-It ain't the latest thing
-I'm just standing in a doorway
-I'm just trying to make some sense
-Out of these girls passing by A smile relieves the heart that grieves
-The tales they tell of men Remember what I said
-I'm not waiting on a lady I'm not waiting on a lady
-I'm just waiting on a friend I'm just waiting on a friend
-...
-Don't need a whore
-Don't need no booze
-Don't need a virgin priest Ooh, making love and breaking hearts
-But I need someone I can cry to It is a game for youth
-I need someone to protect But I'm not waiting on a lady
- I'm just waiting on a friend
- I'm just waiting on a friend
- -- Rolling Stones, "Waiting on a Friend"
-%
-Water? Never touch the stuff! Fish fuck in it.
- -- W. C. Fields
-%
-We ... make the modern error of dignifying the Individual. We do everything
-we can to butter him up. We give him a name, assure him that he has certain
-inalienable rights, educate him, let him pass on his name to his brats and
-when he dies we give him a special hole in the ground ... But after all, he's
-only a seed, a bloom and a withering stalk among pressing billions. Your
-Individual is a pretty disgusting, vain, lewd little bastard ... By God,
-he has only one right guaranteed him in Nature, and that is the right to die
-and stink to Heaven.
- -- Ross Lockridge, quoted in "Short Lives" by Katinka Matson
-%
-We Americans, we're a simple people... but piss us off, and we'll bomb
-your cities.
- -- Robin Williams
-%
-We are born naked, wet, and hungry, and get slapped on our ass ...
-then things get worse.
-%
-We are upping our standards ... so up yours.
- -- Pat Paulsen for President
-%
-We aren't what we eat. We are what we don't shit.
- -- Hugh Romney
-%
-We boggies are a hairy folk Ever hungry, ever thirsting,
-Who like to eat until we choke. Never stop till belly's bursting.
-Loving all like friend and brother, Chewing chop and pork and muttons,
-And hardly ever eat each other. A merry race of boring gluttons.
-
-Sing: GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE.
-
-Boggies gather 'round the table, Anything edible, we've got dibs on,
-Eat as much as you are able. And hope we all die with our bibs on.
-Gorge yourselves from moon till noon Ever gay, we'll never grow up,
-(Don't forget your plate and spoon.) Come! And sing and play and throw-up!
-
-Sing: GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE, GOBBLE!
- -- Bored of the Rings, "The Hobbits National Anthem"
-%
-We call our dog Egypt, because in every room he leaves a pyramid.
-%
-We came, we saw, we kicked its ass!
- -- Bill Murray, "Ghostbusters"
-%
-We don't have to protect the environment -- the Second Coming is at
-hand.
- -- James Watt
-%
-We drove to the hotel and said goodbye. How hypocritical to go upstairs
-with a man you don't want to fuck, leave the one you do sitting there alone,
-and then, in a state of great excitement, fuck the one you don't want to
-fuck while pretending he's the one you do. That's called fidelity. That's
-called civilization and its discontents.
- -- Erica Jong, "Fear of Flying"
-%
-We have reason to believe that man first
-walked upright to free his hands for masturbation.
- -- Lily Tomlin
-%
-We must! We must!
-We must increase our bust!
-The bigger the better!
-The tighter the sweater!
-And the boys will think more of us!
-%
-We sailed on the good ship Venus,
-My God, you should have seen us
- With a figurehead
- Of a whore in bed
-And the mast an upright penis
-
-The captain of the lugger
-Was known as a filthy bugger
- Declared unfit
- To shovel shit
-From one ship to another
-
-The first mate's name was Cooper,
-By god he was a trooper
- He jerked and jerked
- Until he worked
-Himself into a stupor
-
-The cabin boy was chipper,
-A dandy little nipper
- He shoved cracked glass
- Inside his ass
-And circumcised the skipper
-
-The captain's wife was Charlotte,
-Born and bred a harlot
- Her thighs at night
- Were lily white
-By morning they were scarlet
-
-The captain's youngest daughter
-Slipped into the water
- Her plaintive squeals
- Announced that eels
-Had found her sexual quarter
-
-The ship's dog's name was Rover,
-They turned the poor beast over
- And ground and ground
- That faithful hound
-From Tenerief to Dover
-%
-We should declare war on North Vietnam. We could pave the whole
-country and put parking strips on it, and still be home by Christmas.
- -- Ronald Reagan
-%
-We took some pictures of the girls, but they weren't developed.
- -- Groucho Marx
-%
-We will follow Zarathustra, We will worship like the Druids,
-Zarathustra like we use to, Dancing naked in the woods,
-I'm a Zarathustra booster, Drinking strange fermented fluids,
-And he's good enough for me! And it's good enough for me!
-(chorus) (chorus)
-
-In the church of Aphrodite,
-The priestess wears a see through nightie,
-She's a mighty righteous sightie,
-And she's good enough for me!
-(chorus)
-
-CHORUS: Give me that old time religion,
- Give me that old time religion,
- Give me that old time religion,
- 'Cause it's good enough for me!
-%
-Welcome back, my friends, to the show that never ends!
-We're so glad you could attend, come inside, come inside!
-There behind the glass there's a real blade of grass,
-Be careful as you pass, move along, move along.
-Come inside, the show's about to start,
-Guaranteed to blow your head apart.
-Rest assured, you'll get your money's worth,
-Greatest show, in heaven, hell or earth!
-You gotta see the show! It's a dynamo!
-You gotta see the show! It's rock 'n' roll!
- -- ELP, "Karn Evil 9" (1st Impression, Part 2)
-%
-Welcome to Fortune Blackmail!!
- Ms. Kat****** Bl****an is the mistress of a well-known
- banker in Houston, Texas. That's $5000, please, to stop
- us from revealing both of your names, Mr. L*****, so that
- your wife Doreen, and your lovely children Diane, Janice
- and Tom need never know the name of your mistress. You
- have two days to reach us at:
-
- Fortune Blackmail
- Behind the hot water pipes,
- Third stall from the end,
- Greyhound Bus Terminal, Fayette MO.
-%
-Welcome to Fortune Blackmail!!
- This is the first of a series of revelations which could
- add up to a divorce, premature retirement and possible
- criminal proceedings for a company vice-president in Langley Virginia.
- So, Mr. S*****, $10,000 please to stop us from revealing:
- 1: Whose shoulders you were sitting on.
- 2: What you were doing.
- 3: The names of the three people involved.
- 4: The youth organization to which they belonged.
- 5: The shop where you bought the equipment.
-%
-Well, actually, I don't mind going to weddings or anything, as long as they're
-not my own, I show up, but uh, I've always kinda been partial to callin' myself
-up on the phone, asking myself out, y'know, yeah, one thing about it, you're
-always around. Yeah, I know, yeah, you ask yourself out, y'know, some class
-joint somewhere, the Burrito King, or somethin', y'know, well, I ain't cheap
-y'know. Take yourself out for a coupla drinks, mebbe, then you eat, some
-provocative conversation on the way home, and uh, park in front of the house,
-y'know, and you, oh yeah, you smoo with yourself, put a little nice music on,
-mebbe you put on like, uh, y'know, like shoppin' music, something that's not
-too interruptive, y'know, and then uh, y'know, slide over real nice, and say,
-"Oh, I think you have something in your eye", well, maybe it's not that
-romantic with you, but I don't, y'know, I get into it, y'know, I take myself
-up to the porch, and uh, take myself inside, maybe, oh, I might get a little
-something in a brandy snifter, "Would you like to listen to some of my back
-records, I got something here...", well, usually, about two-thirty in the
-morning, you've ended up takin' advantage of yourself, and there ain't no way
-around that, y'know, yeah, makin' the scene with a magazine, ain't no way
-around it. I'll confess, y'know, I'm no different, y'know, I'm not weird
-about it or anything, I don't tie myself up first, I just, I just kinda
-spend a little time with myself.
- -- Tom Waits, "Nighthawks at the Diner"
-%
-Well buggered was a boy named Delpasse
-By all of the lads in his class
- He said, with a yawn,
- "Now the novelty's gone
-And it's only a pain in the ass."
-%
-Well, God gave me a bust. What am I supposed to do with it?
- -- Martha Mitchell
-%
-Well, he went down to dinner in his Sunday best,
-Excitable boy, they all said!
-And he rubbed the pot roast all over his chest,
-Excitable boy, they all said! (Well, he's just an excitable boy.)
-
-He took in the 4am show at the Clark,
-Excitable boy, they all said!
-And he bit the usherette's leg in the dark,
-Excitable boy, they all said! (Well, he's just an excitable boy.)
-
-He took little Susie to the junior prom,
-Excitable boy, they all said!
-And he raped her and killed her, then he took her home,
-Excitable boy, they all said! (Well, he's just an excitable boy!)
-
-After ten long years they let him out of the home,
-Excitable boy, they all said!
-And he dug up her grave and built a cage with her bones,
-Excitable boy, they all said! (Well, he's just an excitable boy.)
- -- Warren Zevon, "Excitable Boy"
-%
-Well, I don't know where they come from but they sure do come,
-I hope they comin' for me!
-And I don't know how they do it but they sure do it good,
-I hope they doin' it for free!
-They give me cat scratch fever... cat scratch fever!
-First time that I got it I was just ten years old,
-Got it from the kitty next door...
-I went to see the doctor and he gave me the cure,
-I think I got it some more!
-Got a bad scratch fever...
- -- Ted Nugent, "Cat Scratch Fever"
-%
-"Well, I took your advice, Doc", said Knopp,
-"And told my wife to try it on top.
- She bounced for an hour,
- Till she ran out of power,
-And the kids, who'd grown bored, made us stop."
-%
-Well, I went to a party, and what did they do?
-They took off their socks and they took off their shoes.
-They took off their shirts, and they took off their pants,
-I had a hunch, we weren't gonna dance.
-
-Everybody, everybody's ass was bare,
-No bras left, just a queer over there.
-But the whole damn thing didn't faze me a bit;
-I just jumped on the pile and grabbed some tit.
-
-My baby's not a sports fan,
-But she plays with balls whenever she can.
-'Cause her favorite sport you see,
-Is playing tonsil hockey.
-[chorus]
- Eat, bite, fuck, suck, gobble, nibble, chew;
- Nipple, bosom, hair pie, finger fuck, screw.
- Moose piss, cat pud, orangutan tit;
- Sheep pussy, camel crack, pig-lie-in-shit.
- -- Doctor Dirty, "The Eat-Bite Song"
-%
-Well, I'd left home just a week before,
-And I'd never ever kissed a woman before,
-But Lola smiled and took me by the hand,
-And said 'Little boy, gonna make you a man!'
-Well, I'm not the world's most masculine man,
-But I know what I am and I'm glad I'm a man and so's Lola.
-La, la, la, la-Lola... la, la, la, la-Lola... Lola.
- -- The Kinks
-%
-Well, it seems that there was this traveling saleswoman whose car broke
-down, late at night, in the middle of a torrential downpour. Hoping to
-find a phone she ran to a nearby farmhouse. When she was unable to find
-a garage still open, the farmer told her that, while they were short of
-beds, she could sleep with his daughter. The daughter proved to eighteen
-and beautiful. So they went to bed, and shortly afterward, the saleswoman
-rolled over toward the daughter and said, "Dear, I'm sure that you're aware
-that some women like... to be with... other women. Let me be frank..."
- "No!" interrupted the daughter, sternly. "This time *I* want to
-be Frank!"
-%
-"Well, madam," the bishop declared,
-While the vicar just mumbled and stared,
- "'Twere better, perhaps,
- In the crypt or the apse,
-Because sex in the nave must be shared."
-%
-Well, now that SUN's in bed with AT&T, I sure hope she sleeps with her
-back to the wall.
- -- Guy Harris, on AT&T buying 20% of SUN Microsystems
-
-Eat shit and die. Strong memo to follow.
- -- Mike O'Dell, on AT&T buying 20% of SUN Microsystems
-%
-Well, see, I was out with this chick last night, and we were in bed, and
-she groaned to me, "Give me nine inches, and make it hurt!" So, I fucked
-her twice and slapped her.
-%
-Well, see, Joyce, there we were, trapped in the elevator. Now, I had
-my tennis racquet and the goldfish; she was holding the Crisco. Surely
-you can imagine how one thing naturally led to another!
-%
-Well, you almost got it right. The only problem is, you're doing it exactly
-backwards! Just reverse the motions you described and your partner will
-experience an incredibly intense orgasm. One trouble with this technique,
-though, is that it works so well. Believe me, word will get around about
-your newfound prowess and you'll be inundated by prospective sexual partners.
-So try to be discreet. I prefer maple syrup to pineapple/apricot lotion, but
-that's a matter of personal preference. Also, I'd advise against the syrup,
-or using honey, if you're outside, because the insects it attracts tend to
-distract the quail. You can substitute crazy glue (but obviously not thumb
-tacks!) for the masking tape, but only if you don't want to use the piano for
-awhile.
-%
-Well, you got your mules and you got your racehorses, and you can kick
-a mule in the ass all you want, and he's still not gonna be a racehorse.
- -- Billy Martin, "Esquire", May, 1984
-%
-Well, you see, it's such a transitional creature. It's a piss-poor reptile
-and not very much of a bird.
- -- Melvin Konner, from "The Tangled Wing", quoting a
- zoologist who has studied the archeopteryx and found it
- "very much like people".
-%
-Well, you see there was this neighborhood that had a priest, a minister, and
-a rabbi who lived near each other. One summer afternoon the priest went out
-and bought himself a new car, and the minister and rabbi, not to be outdone,
-did the same.
- The next day the priest went out and blessed his car. The minister
-hired a crane and baptized his car in a swimming pool. The rabbi, after
-thinking seriously for a bit, got a hacksaw and cut three inches off the end
-of the tail pipe.
-%
-We're all looking for a woman who can sit in a mini-skirt and talk
-philosophy, executing both with confidence and style.
-%
-WE'RE GOING TO THROW THE MX AWAY AFTER WE BUILD IT. The MX is really
-[Don't tell anybody!] just a "bargaining chip" in the nuclear-arms-
-reduction talks with the Russians. See, we have a problem with the
-Russians. They look at our leaders and they see, for example, George
-Bush, who is really a fine and brave man but who happens to have this
-unfortunate physical characteristic whereby when he talks he sounds as
-though he just inhaled a helium party balloon. If he ever becomes
-President, the Russians will deliberately create nuclear crises just so
-they can gather around the Hot Line with refreshments and listen to
-George talk.
- -- Dave Barry, "At Last, the Ultimate Deterrent Against
- Political Fallout"
-%
-Were it not for imagination, sir, a man would be as happy in the arms
-of a chambermaid as a duchess.
- -- Dr. Johnson
-%
-Wesley: I have in fact faced two vampires myself. Under controlled
- circumstances of course.
-Giles: No danger of finding those here.
-Wesley: Vampires?
-Giles: Controlled circumstances.
- -- Buffy the Vampire Slayer, "Bad Girls"
- Season 3, Episode 14
-%
-Wet dream, n.:
- Overnight sensation.
-%
-We've all heard about the woman who married a Field Service engineer but
-divorced him after one day because he'd done nothing on their wedding night
-but promise to have it up in 15 minutes. What few people realize is that the
-poor man was in the bathroom all night, masturbating furiously, muttering
-"I just don't understand, it passes all the diagnostics!"
-%
-We've got things well in hand.
- -- Master Byte Software, Los Gatos California
-%
-We've just received the results of a survey conducted to ascertain the
-various reasons men get out of bed in the middle of the night. According
-to the report, 2% are motivated by a desire to visit the bathroom, and
-3% have an urge to raid the refrigerator. The other 95% get up to go home.
-%
-What a man enjoys most about a woman's clothes are his fantasies of how
-she would look without them.
- -- Brendan Francis
-%
-What can you use used tampons for? Tea bags for vampires.
-%
-What creatures of habit we are. This morning, without thinking, half asleep,
-I put $100 on my pillow. That's not so bad, no one would worry about it, but
-my wife, half asleep, without thinking, gave me $20 change.
-%
-What did Mickey Mouse get for Christmas?
-A Dan Quayle watch.
-%
-What did Snow white say when told she was pregnant?
- "I'd like to thank all the little people who made this possible..."
-
-Presumably this all started that evening when she was feeling Happy...
-%
-What do hookers do on their nights off, type?
- -- Elayn Boosler
-%
-What do you call someone with herpes, AIDS, syphilis, and gonorrhea?
-An incurable romantic.
-%
-What is a promiscuous person -- it's usually someone who is getting more
-sex than you are.
- -- Victor Lownes, quoted in "In and Out: Debrett 1980-81",
- by N. Mackwood
-%
-What is the difficulty with writing a PDP-8 program to emulate Jerry
-Ford?
-
-Figuring out what to do with the other 3K.
-%
-What the fuck, over?
-%
-What the hell, go ahead and put all your eggs in one basket.
-%
-What this department needs is a really good inflatable doll.
-%
-What with chromodynamics and electroweak too
-Our Standardized Model should please even you,
-Tho' once you did say that of charm there was none
-It took courage to switch as to say Earth moves not Sun.
-Yet your state of the union penultimate large
-Is the last known haunt of the Fractional Charge,
-And as you surf in the hot tub with sourdough roll
-Please ponder the passing of your sole Monopole.
-Your Olympics were fun, you should bring them all back
-For transsexual tennis or Anamalon Track,
-But Hollywood movies remain sinfully crude
-Whether seen on the telly or Remotely Viewed.
-Now fasten your sunbelts, for you've done it once more,
-You said it in Leipzig of the thing we adore,
-That you've built an incredible crystalline sphere
-Whose German attendants spread trembling and fear
-Of the death of our theory by Particle Zeta
-Which I'll bet is not there say your article, later.
- -- Sheldon Glashow, Physics Today, December, 1984
-%
-What you mean, how old am I? About one hundred! But Viennese answer is
-better: we say, "I keep passing the open windows." This is an old joke.
-There was a street clown called King of the Mice: he trained rodents, he
-did horoscopes, he could impersonate Napoleon, he could make dogs fart
-on command. One night he jumped out his window with all his pets in a box.
-Written on the box was this: "Life is serious, but art is fun!" I hear his
-funeral was a party. A street artist had killed himself. Nobody had
-supported him but now everybody missed him. Now who would make the dogs
-make music and the mice pant? The bear knows this, too: it is hard work
-and great art to make life not so serious.
- -- John Irving "The Hotel New Hampshire"
-%
-Whatever you say about pornography, sex is here to stay.
-%
-What's on the floor of the old hen-house?
-Doo-doo, doo-doo.
- -- Foghorn Leghorn, to "Camptown Ladies"
-%
-What's the worst thing about being an atheist?
-Noone to talk to when you're having an orgasm.
-%
-When a girl admits she's had a checkered career, it's your move.
-%
-When a man grows old and his balls
- grow cold, So find me a seat and stand me a drink
-And the end of his knob turns blue; And a tale to you I'll tell
-When it's bent in the middle like a Of Dead-eye Dick and Mexican Pete
- one-string fiddle, And the gentle Eskimo Nell.
-He can tell a tale or two.
-
-When Dead-eye Dick and Mexican Pete
-Go out in search of fun, And when Dead-eye Dick and Mexican Pete
-It's usually Dick who wields the prick Are sore, depressed, and mad,
-And Mexican Pete the gun. 'Tis the cunt that bears the brunt
- So the shooting ain't so bad.
-There was rarely a day without a lay
-And usually two or three Now Dead-eye Dick and Mexican Pete
-For Dead-eye Dick, his kingly prick Had been hunting in Deadman's creek.
-Was always like a tree. And they'd had no luck in the way of
- a fuck
-Just a moose or two and a caribou, For nigh on half a week.
-And a bison cow or so;
-And for Dead-eye Dick with his kingly prick
-This fucking was mighty slow.
- -- The Ballad of Eskimo Nell
-%
-When better women are made, computer programmers will make them.
-%
-When ev'rybody's tryin' to sleep,
-I'm somewhere makin' my midnight creep. Chorus:
-In the mornin' the rooster crow, I am a back door man,
-Somethin' tells me I got to go. I am a back door man,
- Well, the men don't know,
-They take me to the doctor, But the little girls understand.
- shot full of holes,
-Nurse try to save a soul.
-Killed her for murder first degree,
-Judge what tried let the man go free.
-
-Stand up, cop's wife cried, don't take him down,
-Rather be dead six feet in the ground.
-When you come home, you can eat pork and beans,
-I eats more chicken than any man's seen.
- -- Willie Dixon, "Backdoor Man" (1961)
-%
-When God created man, She was only testing.
-%
-When God created two sexes, he may have been overdoing it.
- -- Charles Merrill Smith
-%
-When he tried to inject his huge whanger
-A young man aroused his girl's anger.
- As they strove in the dark
- She was heard to remark,
-"What you need is a zeppelin hanger."
-%
-When his company fell on hard times, the boss realized that he'd have to
-lay off one of his two middle managers. As both Jack and Liz were equally
-honest and dedicated to their jobs, he was unable to decide which one to
-fire. To resolve his dilemma, the boss arbitrarily decided that the first
-to leave his or her desk the next morning would be the one to get the ax.
- The next morning found Liz at her desk, rubbing her temples. Asking
-Jack for some aspirin, she headed for the water fountain and that's where
-the boss caught up with her. "I've got some bad news for you, Liz," he said.
-"I've got to lay you or Jack off."
- "Jack off," she snapped. "I have a headache."
-%
-When I need something
-To help me unwind
-I find a six-foot baby What kind of guy
-With a one-track mind Does a lot for me
-Smart guys are nowhere Superman
-They make demands With a lobotomy
-Give me a moron My father's out of Harvard
-With talented hands My brother's out of Yale
-I go bar-hopping Well the guy I took home last night
-And they say "Last call" Just got out of jail
-I start shopping The way he grabbed and threw me
-For a Neanderthal Oooo, it really got me hot
- But the way he growled and bit me
-The bigger they come I hoped he had his shots
-The harder I fall
-In love till we're done The bigger they are
-Then they're out in the hall The harder they'll work
- I got a soft spot
- For a good-looking jerk
- -- Julie Brown, "I Like 'Em Big and Stupid"
-%
-When I was eight years old I came home with tears in my eyes because some
-kids had stolen my sandwich. My father handed me an ice pick, and said,
-"Next time, hit 'em first and hit 'em hard."
- -- Jake LaMotta
-
-You can't go into the ring and be a nice guy. I would go a month, two
-months, without having sex. It worked for me because it made me a
-vicious animal. You can't fight if you have any compassion or anything
-like that.
- -- Jake LaMotta
-%
-When in calling, plain speaking is out;
-When the ladies (God bless 'em) are milling about,
-You may wet, make water, or empty the glass;
-You can powder your nose, or the "johnny" will pass.
-It's a drain for the lily, or man about dog
-When everyone's drunk, it's condensing the fog;
-But sure as the devil, that word with a hiss
-It's only in Shakespeare that characters ____.
- -- Ogden Nash
-%
-When it all boils down to the essence of truth one must live by a dog's
-rule of life: if you can't eat it or fuck it, piss on it!
-%
-When Snow White turns on with the dwarfs she probably winds up feeling Dopey.
-%
-When somebody protested at [Pope Alexander VI's] wholesale distribution of
-pardons for the most heinous crimes -- one of which included the murder of
-a daughter by the father -- he retorted easily, "It is not God's will that
-a sinner should die, but that he should live -- and pay."
- -- E.R. Chamberlin, "The Bad Popes"
-
-Judas sold Christ for 30 denari, this man [Pope Alexander VI] would sell
-him for 29.
- -- Ottaviano Ubaldini, chamberlain to Pope Alexander VI
-%
-When the candles are out all women are fair.
- -- Plutarch
-%
-When the naive young lady asked the clerk in Le Sex Shoppe to show her his
-selection of vibrators, he brought out the two most popular ones.
- "The basic white plastic one here is twenty dollars," the clerk said.
-"The flesh-toned rubber models are thirty."
- "I'm just not sure," the woman said, then she noticed an eye-catching
-item on the back shelf. "How much is that plaid one over there?"
- "Uh, well, that's a pretty special one," said the clerk. "I couldn't
-sell you that one for less than a hundred."
- "I'll take it."
- Later that day, the store owner checked in to see how business was
-going. "Great," the clerk told him. "This morning, I sold four white
-vibrators and three flesh-toned ones. And, this afternoon, I got a hundred
-bucks for my Thermos."
-%
-When the prick stands up, the brains get buried in the ground.
- -- Old Jewish saying
-
-[How come there aren't ever any "New Jewish sayings?" Ed.]
-%
-When the shit hits the fan, keep your mouth shut!
-%
-When they tell me to stick it where
-the sun don't shine, I put it in Oregon.
-%
-When things go wrong as they usually will,
-And your daily road seems all uphill,
-When funds are low and debts are high,
-When you try to smile, but can only cry --
-And you really feel you'd like to quit,
-Don't talk to me; I don't give a shit.
-%
-When you and I are far apart
-Can sorrow break your tender heart?
-I love you darling, yes I do;
-Sleep is so sweet when I dream of you;
-All you are is a blossoming rose.
-Night is here so I must close.
-With care read the first word of each line.
-You will find a question of mine.
- -- Yours hopefully, The VAX
-%
-When you're lying on the bed,
-And the thought is in your head,
-But the feeling is way down between your legs,
-Take your problem in your hand,
-And beat it to the band,
-And try your best to keep it off the walls.
-
-Don't let your lover tell you,
-Don't let anybody sell you,
-That the joy of masturbation is a crime.
-For I've rid myself of fears,
-(I've been doing it for years)
-And now I have an erection all the time.
-%
-Whenever someone tells you to "take it like a man" it usually means
-up your ass.
-%
-Which of the following doesn't belong?
- a. meat
- b. eggs
- c. drum
- d. blowjob.
-
-Answer:
- d: A blowjob, because you can beat your meat, your eggs,
- or your drum, but you just can't beat a blowjob.
-%
-While away at a convention, an executive happened to meet a young woman who
-was pretty, chic, and intelligent. When he persuaded her to disrobe in his
-hotel room, he found out she had a superb body as well. Unfortunately, as
-will happen, the executive sadly found himself unable to perform.
- On his first night home, the executive padded naked from the shower
-into the bedroom to find his wife swathed in a rumpled bathrobe, her hair
-curled, her face creamed, munching candy loudly as she pored through a movie
-magazine. And then, without warning, he felt the onset of a magnificent
-erection.
- Looking down at his throbbing member, he snarled, "Why you ungrateful,
-mixed-up, son-of-a-bitch! Now I know why they call you a prick!"
-%
-While farmers generally allow one rooster for ten hens, ten men are
-scarcely sufficient to service one woman.
- -- Boccaccio
-%
-While not actually a sailor, I certainly enjoy getting blown ashore.
-%
-While sitting 'neath an oak one morn
-In thought on this and that,
-A tiny, twitt'ring little bird "Oh tiny bird, O Nature's gift
-A load dropped in my hat. Of music and of wit!
- Why didst thou feel that my best hat
-"Thy music gladdens my poor soul, Was thy best place to shit?"
-And brings joy to my heart.
-But tell me, little bird divine, The tiny bird a few notes sang,
-Why didst thou not just fart?" Then answer'd "Pardon me,
- For thy hat I thought was my nest,
-I rose and stood in solemn awe A-fallen from the tree."
-His words to better mull,
-Then lifted up a paving block
-And crushed his fucking skull.
- -- Bill Wordsworth, "A Tiny Twitt'ring Bird"
-%
-While vacationing last summer in the North Woods, a young fellow thought it
-might be a good idea to write his girl. He had brought no stationery with
-him, however; so he had to walk into town for some. Entering the one and
-only general store, he discovered that the clerk was a young, full-blown farm
-girl with languorous eyes.
- "Do you keep stationery?" he asked.
- "Well," she giggled, "I do until the last few seconds, and then I
-just go wild."
-%
-Whip it, baby.
-Whip it right.
-Whip it, baby.
-Whip it all night!
-%
-White House carpenters have reworked the master bedroom, remodeling it
-so that Ronnie can sleep with his head in the hall. That way, by the
-time he wakes up, somebody will have already shined his hair.
-%
-Why does Dr. Pepper come in a bottle?
-
-Because his wife left him. But things are looking up for their reconciliation.
-Seems that when she left, she took his word processor, and she's been renting
-it out occasionally in Japan. That is, every now and then she gets a yen for
-his Wang.
-%
-Why, Good Morning! I'm the bluebird of fellatio!
-%
-Why I am an atheist:
-
-1. Atheists do not believe in higher powers.
-2. God is the highest power.
-3. Therefore, God must be an atheist.
-4. We should all strive to be like God.
-5. We should all be atheists.
-%
-Why is it that there are so many more horses' asses than there are
-horses?
- -- G. Gordon Liddy
-%
-Why is Mrs. Carter always on top when she and Jimmy make love?
-Because all Jimmy Carter can do is fuck up.
-%
-Why marry a virgin? If she wasn't good enough for the rest of them
-then she isn't good enough for you.
-%
-Why not, for example, offer a brand-new Mustang convertible to every girl
-who consents to having her Fallopian tubes tied in a Gordian knot? ... It
-would have the additional benefit of eliminating from the gene pool those
-stupid enough to consent to such a deal.
- -- Edward Abbey
-%
-...why should you waste a single moment of *your* life seeming to be something
-you don't want to be? Lord, that's so simple. If you hate your job, quit it.
-If your friends are tedious, go out and find new friends. You are queer, you
-lucky fool, and that makes you one of life's buccaneers, free from the clutter
-of 2000 years of Judeo-Christian sermonizing. Stop feeling sorry for yourself
-and start raising your sails. You haven't a moment to lose.
- -- Edmund Carlevale
-%
-Willie, looking in the mirror, Willie with the nursery shears
-Sucked the mercury off Cut off both the baby's ears.
-Thinking in his childish error To the baby so unsightly
-It would cure the whooping cough. Mother raised her eyebrows slightly.
-
-At the funeral his weeping mother In the family drinking well
-Sadly said to Mrs. Brown, Willie pushed his sister, Nell.
-"'Twas a chilly day for Willie She's there still because it killed her,
-When the mercury went down." Now, we have to buy a filter.
-%
-Winning isn't everything, but losing really sucks.
-%
-With a bushel of apples, you can have
-a hell of a time with the doctor's wife.
-%
-Wok, n.:
- Something to thwow at a wabbit.
-%
-Woman is: finally screwing and your groin and buttocks and thighs ache like
-hell and you're all wet and maybe bloody and it wasn't like a Hollywood
-movie at all but Jesus at least you're not a virgin any more but is this
-what it's all about? And meanwhile, he's asking "Did you come?"
- -- Robin Morgan, "Sisterhood Is Powerful"
-%
-Women -- can't live with 'em, can't leave 'em by the curb when you're done.
-%
-Women should be obscene and not heard.
-%
-Women think of being a man as a gift. It is a duty. Even making love can
-be a duty. A man has always got to get it up, and love isn't always enough.
- -- Norman Mailer
-%
-Women Unite! Make *_h_i_m* sleep in the wet spot tonight!
-%
-Women who want to be equal to men lack imagination
- -- Graffito in a women's restroom
-%
-Women's Libbers are OK. I just wouldn't want my sister to marry one.
-%
-Working hard around here is like pissing on yourself in a dark suit;
-you get a warm feeling but nobody notices.
-%
-Working here is like a pregnancy.
-After nine months you wish you hadn't come.
-%
-World War III is about to break out, but hidden somewhere in Switzerland,
-a small group of international statesmen are trying to avert disaster.
-The key members of this group are the representatives from Moscow, Bonn, and
-Jerusalem, who, despite their personal enmity, manage to forge a peaceful
-settlement, at the last moment. As the treaty is signed, and the war
-postponed, almost entirely through the efforts of those three men, an angel
-appears. "The earth is saved through the efforts of these three men!
-Therefore, I will grant each of them their heart's desire!"
- So, the angel asks the German for his wish, and the German, recalling
-the nearness of their disaster, and perceiving the cause to have been the
-Russians, immediately says "I wish there were no more Russians!" And God
-said, "It will be done."
- The angel asks the Russian for his wish, which, of course, is "*I*
-wish there were no more Germans!" Replies the angel, "It will be done."
- So the angel asks the Jew for his wish. The Jew is in a state of
-shock. "Will you really grant the German's wish?" he asks, and the angel
-avers. "And the Russian's, too?" The angel avers yet again. Then the Jew
-thinks a moment, leans back and says, "In that case, I think I'd like a small
-cup of coffee."
-%
-Would you mind terribly much if I asked you to take your silly-assed
-problem down the hall?
-%
-Would you rather have a 5-inch hard or an 8-inch floppy?
-%
-Writers do it between periods.
-%
-Xander: Let me tell you something. When it's dark, and I'm all alone,
- and I'm scared, or freaked out, or whatever. I always think,
- "What would Buffy do?" You're my hero. Ok, sometimes when it's
- dark and I'm all alone I think, "What is Buffy wearing?"
-Buffy: Can that be one of those things that you never ever tell me about?
-Xander: It's a deal.
- -- Buffy the Vampire Slayer, "The Freshman"
- Season 1, Episode 1
-%
-Yeah, I used to be into necrophilia, bestiality and sadism, but then I
-realized I was just flogging a dead horse.
-%
-Yes, that was Richard Nixon. He used to be President. When he left
-the White House, the Secret Service would count the silverware.
- -- Woody Allen, "Sleeper"
-%
-Yesterday is a memory,
- Tomorrow is a vision,
- Today is a bitch!
-%
-You always introduce the younger person to the older person, using the
-wording: "Miss Brown, I'd like to introduce you to an older person"
-(unless her name is not "Miss Brown"). If you do not know a person's
-age, ask for a driver's license and a major credit card. If you are
-introduced to a member of a minority group, use the "high-five" style
-handshake, followed by a remark designed to show you don't mind a bit,
-such as "I see you are a (name of a minority group)! Good!"
- -- Dave Barry, "The Stuff of Etiquette"
-%
-You and I as individuals can, by borrowing, live beyond our means, but
-only for a limited period of time. Why should we think that collectively,
-as a nation, we are not bound by that same limitation?
- -- Ronald Reagan
-%
-You are a tower of strength in the office, but only so-so in bed.
-%
-You are at a business lunch when you are suddenly overcome with an
-uncontrollable desire to pick your nose. Since this is definitely a
-no-no, you:
-
-(a) Pretend to wave to someone across the room and with one fluid
- motion, bury your forefinger in your nostril right up to the 4th
- joint.
-
-(b) Get everyone drunk and organize a nose picking contest with a prize
- to the one who makes his nose bleed first.
-
-(c) Drop your napkin on the floor, and when you bend over to pick it up,
- blow your nose on your sock.
-%
-You are without a doubt a rogue, a rascal, a villain, a thief, a scoundrel,
-and a mean, dirty, stinking, sniveling, sneaking, pimping, pocketpicking,
-thrice double-damned, no-good son-of-a-bitch.
-%
-You are witty, charming, handsome and above average in length.
-%
-You better believe that marijuana can cause castration. Just suppose
-your girlfriend gets the munchies!
-%
-You can beat my meat, but you can't lick my sauce!
- -- Boss' Ribs, Portland, Oregon
-%
-You can find sympathy, in the dictionary, right near shit and suicide.
-%
-You can get used to living at a nudist camp.
-The first three days are the hardest.
- -- R. Dreiser
-%
-You can lead a whore to Vasser, but you can't make her think.
- -- Frederick B. Artz
-%
-You can pick your friends, and you can pick your nose, but you can't
-pick your friend's nose.
-%
-You can't underestimate the power of fear.
- -- Tricia Nixon Cox
-%
-You come out of a woman and you spend the rest of your life trying to
-get back inside.
- -- Heathcote Williams
-%
-You have been bitchy since Tuesday and you'll probably get fired today.
-%
-You have just returned from a trip to Green Bay, Wisconsin in January
-and tell your boss that nobody but whores and football players live
-there. He mentions that his wife is from Green Bay. You:
-
-(a) Pretend you are suffering from amnesia and don't remember your
- name.
-
-(b) Ask what position she played.
-
-(c) Ask if she is still working the streets.
-%
-You have to be a bastard to make it, and that's a fact. And the Beatles
-are the biggest bastards on earth.
- -- John Lennon
-%
-You have to regard everything I say with suspicion -- I may be trying
-to bullshit you, or I may just be bullshitting you inadvertently.
- -- J. Wainwright, Mathematics 140b
-%
-You know the Norplant thing? It's a new birth control device for women.
-It's a cartridge, that goes in your arm. Well, they're coming out with
-a new one for men: it's a brain, that goes in your head.
-%
-You might get caught holding the bag. Say she's your sister.
-%
-You pedophiliac sodomizer of ducklings!!
-%
-You see that fucking fish?
-If he'd kept his mouth shut, he wouldn'ta got caught.
- -- Sam Giancana
-%
-You should be a hemorrhoid, you're such a pain in the ass.
-%
-You wanna play the dozens,
-Well, the dozens is a game,
-But the way I fuck your mother is an ass-wringing shame!
- -- George Carlin
-%
-You will always have friends
-Some friends will peter out.
-But I'll always be your friend,
-Peter in or peter out.
-%
-You'll be a guest at a gay party.
-That will have important consequences for you.
-%
-Young men want to be faithful and are not;
-old men want to be faithless and cannot.
- -- Oscar Wilde
-%
-Your boy/girl friend is *so* ugly that...
-
- -- when you look up ugly in the dictionary, their picture's there.
- -- it looks like their face caught fire and someone put it out
- with an ice pick.
- -- Nabisco used their face to model for animal cookies.
- -- when they yelled "Rape", the guy screamed "No way!"
- -- they were the birth control poster child.
- -- when they were born, the doctor slapped their mother.
- -- as a child, their parents tied a pork chop around her neck to
- get the puppy to play with them.
- -- they have to sneak up on a glass of water, just to get a drink!
-%
-Your chances of getting hit by lightning go up if you stand under a tree,
-shake your fist at the sky, and say, "Storms suck!"
- -- Johnny Carson
-%
-Your first husband was the one you married while firmly believing that
-there are more important things in life than great sex.
-%
-YOUR FOAMY FUTURE
- by Miss Fortune
-
-SCORPIO (October 24 - November 21)
- "Hard work never killed anybody, but why take the chance?" is your
-motto. You don't do much other than sleep, eat, down brewskis, and watch TV.
-Your friends and family are constantly pestering you to clean up your act.
-But it's OK, Scorpio. A kick in the ass is at least one step forward.
-
-SAGITTARIUS (Nov. 22 - Dec. 21)
- You've been on a diet for two weeks and all you've lost is two weeks.
-My advice is to drink copius amounts of beer just to get the thought of food
-out of your mind. Remember, a good reducing exercise consists of placing
-both hands against the table edge and pushing back.
-
-CAPRICORN (Dec. 22 - Jan 19)
- Remember that day you had one beer too many and did something
-extremely foolish? Now your friends are coming and going and your enemies
-accumulating. Cheer up! All is not lost. It's better to be hated for
-what you are than loved for what you're not.
-%
-Your spooning days are over,
- And your pilot light is out;
-When what used to be your sex appeal
- Is now your water spout!
-%
-You're not an alcoholic unless you go to the meetings.
-%
-Yuck Foo.
-%
-Zippity doo dah, zippity ay,
-I just gave my sister's cherry away!
-To a couple of truckers from Erie P.A.,
-Zippity doo dah, zippity ay.
- -- John Valby
-%
diff --git a/games/fortune/datfiles/fortunes-o.sp.ok b/games/fortune/datfiles/fortunes-o.sp.ok
deleted file mode 100644
index e7734c6..0000000
--- a/games/fortune/datfiles/fortunes-o.sp.ok
+++ /dev/null
@@ -1,1700 +0,0 @@
-# $FreeBSD$
-a'plucking
-AAAaaeeeeeeeeeiiiiiiiii
-Aaah
-Abbos
-ABS
-absolument
-Abyssinia
-AC
-acces
-acheter
-ACLU's
-Acquavit
-Addotta
-Adiau
-adj
-Adler
-Adolf
-Adorations
-aedificabat
-affreuse
-affreux
-aggie
-agmina
-Agnew
-Agonistes
-ah'm
-Ahh
-AHLIEH
-Aird
-Aire
-airlining
-Ajaye
-AKBAR
-Aldous
-Alexandretta
-Alexei
-alla
-allus
-Almighty's
-Alzheimer's
-Amaretto
-ambulabat
-Americard
-Amie
-amnesia
-amoureuse
-Amp's
-AMRIKAHEY
-Anamalon
-Anastasio
-androids
-Andropov
-Angelou
-angiloj
-ankau
-Ansel
-answer'd
-anticipas
-Anya
-apersonment
-APL
-Apocryphia
-apoplexy
-Apr
-Arbeiter
-archeopteryx
-Armenians
-ARRAREGH
-Arretez
-Arrrr
-Artz
-Ashton
-askin
-assed
-asshole
-assholes
-Audivi
-Aug
-auugghh
-avait
-avec
-avez
-Aw
-awwwsome
-Ayatollah
-b'ar
-Baber
-backend
-backhands
-Baja
-banker's
-Bankhead
-bantamhood
-bantams
-Barbie
-Barr
-Barre
-Bart's
-basewoman
-batpoles
-baudy
-beast's
-Beatles
-Beaverbrook
-bedfellows
-beeble
-beeg
-beer's
-Begatting
-BEGERAM
-Beggin
-Begorrah
-bein
-belies
-believin
-Benchley
-Berman
-Bertolt
-besoin
-Bette
-betweens
-BEZORG
-Biafra
-bible
-Biden
-bigga
-biggins
-Billy's
-bimbo
-binz
-biphallic
-birdshit
-bisex
-bitchin
-bitchy
-Blackadder
-blancs
-bleed'n
-bleu
-blimey
-blinkin
-bloimy
-Blore
-blossoming
-blower's
-blowjob
-blowjobs
-boars
-Boccaccio
-BODANEH
-body's
-Boers
-boffing
-Bogart
-boggies
-bogglingly
-BOHICA
-BOING
-bonza
-boobs
-bookmakers
-Boosler
-Bormann
-boss's
-Botha
-Botley
-BOYAST
-Braddock
-Brandt
-bras
-Brassieres
-Brecht
-Brest
-brewskis
-Brigands
-bringa
-Brits
-Britton
-Bronson
-Brown's
-Bruner
-brutish
-buccaneers
-buckaroooooo
-buffaloes
-buffersome
-Bullsheyet
-bullshit
-bullshitting
-bulrushes
-Bumpass
-bungee
-Bunky
-Buren
-buryin
-Bussy
-busters
-busty
-BUTTERFINGER
-Butthole
-Byer
-Byrn
-Byrne's
-byter
-Bywater
-C'est
-c'mon
-Cabell
-Caesar's
-Calhoun
-caliente
-calla
-Callay
-callgirl
-callgirls
-callin
-Calooh
-Camille's
-Camptown
-canakin
-Cannes
-capeau
-capeaux
-Capheughton's
-Capone
-cappucino
-Caray
-CARDAN
-Carlevale
-carnivorous
-carolers
-carpooling
-Carroll
-Carson's
-Caspar
-Castlereagh
-castrated
-castrating
-castration
-Catwoman
-caughte
-caveau
-cds
-centerfold
-chaises
-Chamberlin
-Chamfort
-chancres
-Chanuka
-chaque
-Charmaine
-Cheerios
-CHEESHAYEH
-cheeth
-Cheryl
-childproof
-chiseling
-chromodynamics
-chromosome
-Chumley
-Chungking
-chunkers
-Churchill's
-Cianci
-ciom
-circumsized
-clamdigger
-clamsucker
-Clarke's
-clergical
-Clydesdales
-Cobbett
-Cocaine's
-Cody's
-Coito
-coitus
-cojones
-Colloq
-comin
-commie
-Como
-computerfirm
-concerning'em
-condom
-Condoms
-conduite
-Connolly
-containeth
-contraire
-cooed
-Copacabana
-copius
-copulating
-Corcoran
-Corvallis
-Cosell's
-coulda
-counterfactual
-coupla
-court's
-couture
-Covina
-Cox's
-crapped
-crapuleuses
-creole
-cria
-Crinklaw's
-Crisco
-crossjostle
-crotchless
-Crotels
-crow's
-Cruz
-cubits
-cunnilingus
-cursin
-Cusinart
-Custer
-d'un
-d'ya
-DAFAYEH
-dah
-dahlias
-daiquiri
-daiquiris
-Dalmatians
-Dames
-Dammit
-damnfoolproof
-Danforth
-Dangerfield
-Dangerfield's
-dankoj
-dans
-Danzer
-Darlin
-dat
-date's
-daters
-datfiles
-DAVAT
-DAVATEMAN
-DC
-de
-Deadman's
-deb
-Debet
-Debrett
-dedie
-Defauw
-defendin
-deferens
-Deferrals
-DEFUN
-DEGAT
-Degen
-DeGourmont
-DEHRATEE
-Delpasse
-Delts
-dem
-DEMO
-denari
-der
-des
-desisted
-Dessine
-deteste
-detresse
-Detroit
-Devo
-deziras
-di
-dickheads
-Dickory
-Diddley
-dignifying
-dijon
-dillies
-Dimitri
-diner's
-dinna
-dipshit
-dipstick
-discontents
-discorporation
-disrobed
-DIVAR
-Dixon
-Djim
-DMT
-doberman
-doesn
-doffed
-Dohrn
-doin
-dolorigas
-dominatrix
-Don'ta
-doncha
-doo
-Dopplegangland
-Doreen
-Doritos
-dork
-douches
-dougb
-Drano
-Dreiser
-drincas
-Dristan
-dropcase
-drugsucker
-Druids
-ducebat
-ducklings
-Dukakis
-dunno
-dwowning
-dyslexics
-eatin
-EE's
-een
-eez
-effet
-EFM
-Ehrlich
-Eiffel
-ein
-Einstein's
-Elayn
-Electrolux
-eleison
-Ellyn
-ELP
-Elsdon
-Emersons
-Emmy
-Encyclopadia
-enda
-England's
-ENOLA
-entrailles
-Epperson
-erat
-ergo
-Erin's
-Erm
-eschatological
-esk
-est
-estas
-estis
-estropiements
-etait
-etchings
-ETEHFOR'AN
-Ethnologists
-ethology's
-Eurovision
-Ev'rybody
-ev'rybody's
-everone
-everybodies
-Ewald
-Ewing
-excrement
-explain'n
-eyeing
-faciebat
-Fackel
-faggot
-Fagin
-faire
-Fallopians
-Falwell
-fanny
-Fantastik
-Farge
-Farnum
-fart
-farted
-farter
-farting
-farts
-FASHAL
-Fastrack
-fatted
-faux
-Fayette
-FDR
-feces
-Feiffer
-FEKR
-Feldstein
-feli
-Fer
-fergot
-Ferrari
-fesses
-fetcheth
-Fibble
-fiddlers
-Fie
-fievre
-Fifi
-fille
-finda
-findeth
-Firesign
-Fisherwood
-fistfight
-fittin
-Fitz
-fiveskin
-Flannery
-Flawse's
-Fleur
-flexin
-florist's
-Florynce
-flunkers
-fly's
-fnu
-fobble
-fock
-Fokkers
-folksinger
-Fonteney
-footedly
-forded
-foreplay
-fornia
-Fornication
-Franklyn
-frat
-fratboy
-freaked
-freakout
-Fred's
-Fredrich
-Fredrick's
-freend
-french
-Friants
-Friedrich
-frigerator
-frigging
-Froats
-Frognogg
-frolicked
-fsck
-fuck
-Fuck'em
-fucked
-fuckin
-fucking
-fuckingly
-fuckoff
-Fumets
-functionaries
-funestes
-fup
-Gabriel's
-GABUL
-Gadda
-gaffed
-Galbraith
-Gallagher
-galumphing
-gameplayer
-gangrenous
-Gatos
-gays
-Geis
-gejo
-Gelett
-Geminis
-genievre
-genital
-gennulman
-getta
-gettin
-GHERMEZ
-GHORBAN
-Ghostbusters
-Giancana
-gibble
-giebt
-gimme
-Ginsberg
-Giraudoux
-girlfriend
-girlies
-gits
-Glashow
-glorifying
-godda
-goddam
-goers
-goest
-GOFTAM
-GOFTEH
-goin
-Goldthwait
-Goldwyn
-Gomorrah
-gonna
-Goodbar
-goodnight
-goodnights
-Gopala
-Gorbachev
-Gorey
-gotta
-gotter
-Gould
-Goy's
-Graffito
-grandes
-Grandmom
-Grantsmanship
-GREAAAAAAT
-Grecians
-greek
-Greenway
-grep
-Gretzky
-Grizzard
-grody
-Groucho
-GROUPIE
-gubble
-guerir
-Guv'na
-Guv'nor
-guys'll
-Gwynn
-hablo
-HAFTAEH
-HAFTIR
-Haggis
-Haiphong
-hairspray
-hand's
-hangknot
-harde
-hardon
-Harlan
-Harshaw
-Hart's
-hast
-haunche
-havin
-Hayakawa
-headdresses
-headshaker
-Heathcote
-heathens
-HEEEEEEEE'S
-heeld
-Hefner
-Helms
-her's
-Herbie
-Herbie's
-Herold
-Hersh
-Hickman
-Higgins
-Higgledy
-Hilde
-Hinojosa
-hispanan
-Hitchhiker's
-hmmm
-Hmmmmm
-Hobbits
-Hoffa
-hogsheads
-holdin
-hominem
-Hominum
-homme
-honteuse
-hoofbeats
-hookie
-hore
-Horsecrap
-hosings
-Hoss
-hotdog
-Hote
-hotshot
-housh
-hovercraft
-How'd
-Howdja
-Hubbard
-Hubert's
-Hughing
-huma
-humpers
-hungover
-Hurtubise
-husbanded
-husbandryman
-hushban
-Iain
-ibble
-if's
-igh
-Il
-ille
-Illegitemus
-Illustrated's
-imake
-impersonators
-ina
-infatuated
-ingles
-ingrediebatur
-ingressus
-Inkvizicion
-inna
-innkeeper's
-inquit
-int
-intercoursin
-interruptus
-intestinal
-inthides
-intones
-IRC
-isa
-iterum
-iterumque
-ith
-itis
-itt
-iver
-j'ai
-J'entends
-jacht
-jackrabbit
-jackrabbits
-JAP's
-java
-JAYEH
-Jayne
-Jeb
-jeered
-JEPAHEH
-jeune
-Jewry
-JIMI
-Joan's
-Jobcock
-Jodie
-joggers
-Jogging
-johnny
-jojn
-JTT
-Judeo
-Jurgen
-jus
-k'honi
-Kabbazah
-Kahane
-kaj
-Kandel
-Karn
-kasha
-Kennedy's
-Kerr's
-KESHVAREHMAN
-Keyes
-KHALI
-KHE
-Khomeini
-KHREL
-KHRELEH
-KHRUBE
-kidnapped
-Kie
-KILI
-Kilmer's
-kiloliks
-kinda
-Kinison
-Kinks
-Kinnan
-Kissinger
-kitty's
-KNAC
-Knopp
-kommen
-Konner
-kontraugraveda
-kookie
-Kopechne
-Kotex
-krajono
-Kraus
-Krazy
-Krispies
-KRON
-kuraciston
-kvardekdu
-kwirt
-KY
-lad's
-lagnaf
-Lahore
-laiety
-LaMotta
-Lancelot
-lassie
-lavat'ry
-Laverne
-Lawrenson
-LBJ
-Leacock
-leapy
-leatherdyke
-Lebowitz
-lecherous
-lechers
-Lefkovitz
-Legette
-LeGuin
-Lehrer
-Leipzig
-Lemme
-Lendl
-Leprechaun's
-leprechauns
-les
-LeSage
-lesbian's
-Lesh
-lewder
-Li
-lib
-Libbers
-Libble
-libertine's
-libidal
-Librium
-lickin
-lickings
-Liddy
-lievre
-lightbulb
-ligottage
-likka
-Limbaugh
-Limbaugh's
-limerick
-Lingam
-Lingus
-Linz
-livin
-loc
-Lockett
-Lockridge
-Loeb
-loggerheads
-LOL
-Looka
-lookin
-Los
-LOTFAN
-Louisian
-lovemaking
-lovin
-Lownes
-lubble
-Lupescu
-Luser
-Luxington
-Lyin
-m'boy
-M'sieur
-Mable
-Mabley
-MacKintosh
-Mackwood
-Maddox
-Madel
-Magda
-mah
-Mahal
-Maher
-maidenhead
-Mairowitz
-mais
-majora
-majorettes
-make's
-makin
-malaises
-mali
-Mama
-MAMNOUNAN
-MANEH
-manhattans
-Manilow
-Manishiewitz
-Mannis
-Manson
-marrons
-martialed
-Martina
-martoonis
-masturbate
-masturbation
-masturbatorium
-MATERNIER
-Matson
-Matzah
-Maui
-Max's
-Mayer's
-Mayfield
-McGowan's
-McGuzzum
-McHugh
-McMurphy
-McPugh
-McQuillan
-mebbe
-Medflies
-MEEMUNAM
-meeyow
-Meggs
-meilleure
-Meir
-Melchett
-mellitus
-Mellor
-Mellor's
-Menachem
-mene
-Messerschmidts
-Meth
-Methadone
-methedrine
-Mex'cans
-MGP
-Mgr
-Mia
-Michener
-Microsystems
-midgets
-midtown
-mignons
-mihi
-MIKRASTAM
-Millay
-Milli
-millions
-Milo
-Milpitas
-Milton's
-miniskirt
-misssture
-mistresses
-mit
-Mizner
-Moby
-mod
-MOHEMA
-moi
-moine
-molehills
-Mombasa
-Momma's
-Mommie
-mommy's
-Monsignor's
-Montagu
-moonshiner's
-Moosehead
-Moreno
-Mormons
-mornin
-morte
-Mostel
-motherfucker
-motherfuckers
-MOUNTIES
-mouse's
-mousetrap
-moustache
-moveth
-MOVs
-moyel
-muffer's
-Muggeridge
-Mumsy
-munchies
-Murphy's
-MUSKETEERS
-Musta
-muttons
-MX
-n'avait
-n'etait
-N'wam
-Nader
-Naeser's
-Nah
-Naiman
-Namath
-nanosexual
-Napagel
-NAPOLEONE
-narc'er
-Navratilova
-ne'er
-necebat
-necrophiliac
-Neniu
-Nero's
-Newfie
-Newsflash
-NFL
-nightclubbing
-Nighthawks
-nightstand
-nighty
-noires
-Nolan
-nonplussed
-noo
-Noone
-nooooooo
-Nope
-Norplant
-nothin
-nothing's
-notta
-Nov
-novacaine
-Nowwaitaminnit
-NPR
-nuff
-Nuke
-Numbair
-NUNEH
-NY
-Nybble
-nymphos
-Nyquist
-O'Donohugh
-O'Flaherty
-O'Huiginn
-O'Malley
-O'Riordan's
-O'Rourke
-O'Rourke's
-OB
-Oct
-octopus's
-Oden
-offer'd
-offither
-OHHHH
-Ohhhhh
-ok
-okayyyy
-olds
-ole
-Olmstead's
-Omer's
-Ooh
-oooh
-Oooo
-Oooooh
-Ooooooh
-Ooops
-open'd
-Orben's
-oris
-orphan's
-Osbourne
-OTAGEH
-Ottaviano
-oughta
-outdone
-ouverte
-overweighted
-Owen's
-owlin
-Ozy
-Ozzy
-Pacman
-PAEH
-panoe
-pantyhose
-pantyless
-Papa's
-Pappa
-parabolas
-parisienne
-Parmi
-parrot's
-Parton
-passin
-Patrick's
-pattes
-PDP
-peckered
-pedophiliac
-peehole
-pees
-penis
-pere
-Perelman
-pestes
-Peteer
-Pettigrew
-peu
-peyote
-PG
-Pharaoh's
-pickin
-picture's
-piggies
-Piggledy
-piglets
-Pinocchio
-Pinocchio's
-Piozzi
-piss's
-pissoirs
-pixer
-plaintes
-Playbeer
-PLAYGIRL
-playin
-pleasantest
-Pleasse
-plej
-plena
-plombait
-plombant
-plombier
-Ploughwright
-plucker's
-plummen
-PLUNDERER'S
-plushest
-PMS
-pocketpicking
-poena
-poignarda
-poiuyt
-Polacks
-Polanski
-Pommie
-Pompoir
-poo
-Poofter
-POOFTERS
-Poopsie
-poots
-popsicles
-por
-Porgie
-porno
-pornographistic
-Porsche
-porte
-potebat
-potens
-Potgieter
-Pourquoi
-poursuivit
-pouvais
-pox
-PPPPHHHHHHHBBBBTTTTTT
-Pratchett
-prestidigatory
-pri
-priest's
-prise
-prit
-prively
-progressus
-proksima
-prom
-Prope
-prophylactics
-prostitute's
-provideth
-Prufrock
-Pryor
-PSIG
-pubex
-puella
-Purmal's
-purty
-pushin
-PUSHJ
-pushups
-pussy's
-Putrid
-putts
-Python's
-QED
-QEH
-QOTD
-QT
-qu'a
-Quayle
-que
-Queensboro
-Queerios
-Quelle
-quelqu'un
-queynte
-qui
-quicky
-quim
-quintuplets
-qwert
-qwertyuiop
-Rabbeet
-rabbeets
-rabbinical
-rabbis
-rabs
-raciest
-racquet
-racquetball
-Rafferty
-RAJEBEH
-Rambolike
-Randel
-Ranger's
-Raquel
-Raygun
-readin
-Reaganomics
-Reefers
-rejuvenated
-religieuse
-religion'll
-Renata
-Rene
-Repo
-reproves
-Reza
-rhinoceroses
-Rhode
-Rico
-rida
-Rigg
-riggins
-riggle
-rigids
-RIIIIIIIGHT
-Rikki
-rither
-Rivoli
-rm
-Roeper
-rollin
-roly
-roo
-rootbeer
-Rosenberg
-Rosten
-rouges
-Roumanian
-Rovers
-rrrrrgh
-rubels
-Rubik's
-Rudner
-rugby
-Rumania's
-Rumour
-Rumpletweezer
-runna
-Runnin
-S'eleva
-sabble
-Sacre
-safariing
-Safeway
-sagt
-Sahl
-saideth
-Sangor
-Sayle
-scare'em
-scarem
-scareya
-Scarsdale
-Schlafly
-schlaft
-Schlegel
-schlemiel
-schloshed
-Schnuffel
-scones
-Scot's
-scotches
-Scout's
-Scowles
-screwin
-scrure
-SDW
-seaman's
-Sed
-sein
-Seldes
-Sep
-SEPAHEH
-Serafina
-sermonizing
-SEXPR
-sez
-shalt
-shamus
-Sharpe
-Sheee
-Sheeite
-sheep's
-SHEEREEL
-sheerest
-Sheilas
-sheyet
-Shhh
-shiksa
-shit
-shithead's
-shits
-shitty
-SHOMA
-SHOMAEH
-shoppin
-shoulda
-Shouse
-show's
-Showerbath
-showgirls
-shum
-side's
-siders
-sightie
-sipo
-sissies
-sittin
-Sixteen'll
-skiin
-skimpiest
-SL
-sleaze
-sligo
-slimey
-slort
-SM
-smarties
-Smokey
-smoo
-SMOORPLAY
-SMUCK
-SMURFS
-snake's
-Sniglets
-SNL
-snotface
-snowstorms
-Snyder's
-so's
-sociologist's
-sodomite
-sodomizer
-SofSqueeze
-SofSqueeze's
-soir
-soit
-solvo
-somethin
-Somoza
-sonna
-sonny's
-Sont
-soooo
-sorta
-sows
-Spaeth
-spake
-Spengler
-Sperling's
-spikey
-spluttering
-spoilspurt
-sportin
-sportscar
-sportscars
-sportscaster
-Spraints
-squaws
-Sta
-stagecoaches
-standin
-starkle
-stat
-Statim
-staya
-STDs
-Steinem
-Steinman
-Stendhal
-Stickin
-Stiffy
-stincas
-stinkfinger
-Stockmayer's
-stormclouds
-straights
-Strensall
-stroganoff
-Strumpets
-Stupidda
-subuseless
-sucha
-suckin
-sucky
-suh
-SUN's
-sunbathing
-sunbelts
-sunday
-Sunnydale
-Supercalifragilisticexpialidocius
-superpowers
-suppositories
-suraigus
-surgle
-suuure
-svebo
-SWBiM
-Swearingen
-sweep's
-swing's
-Symons
-sympatico
-t'was
-t'wixt
-tabble
-Tadger
-Taffy's
-talka
-talkin
-Tallulah
-TAMOMEH
-tampons
-tard
-tatters
-TCU
-teddy
-Teddy's
-tee'd
-teed
-TEEGZ
-teepee
-tella
-telly
-tenderizer
-Tenerief
-Tertullian
-Texan's
-Thackeray
-thacramento
-thailor
-thair
-thatta
-THC
-Thcuse
-thea
-theatre
-theem
-thekth
-them's
-thet
-thet's
-thid
-thidee
-thinkle
-thit
-thith
-Thorpes
-Thrale
-thumpers
-thure
-thurstay
-thwim
-thwow
-tibble
-Tiegs
-Tierra
-TIKEH
-Timbuktu
-Timer's
-Tinky
-tinyest
-Tinz
-tis
-titties
-tiu
-togethers
-Tomlin
-tonsillectomy
-tooties
-torte
-Toujours
-tous
-Townshend
-Toynbee
-transsexual
-transsexuals
-transvestites
-trashcan
-tres
-Trieste
-triffid
-triggle
-trois
-trou
-Trouser's
-truffles
-tryin
-Tsk
-Tulit
-Tull
-tumbledown
-TUPEHMAN
-tupperware
-Twas
-twats
-Twinkie
-Twinkies
-twitt'ring
-Tylenol
-Ubaldini
-UFOs
-Uh
-Uhura
-ulation
-ulcerous
-ummm
-umount
-une
-unfastens
-unflappable
-unlatched
-Unlusted
-uno
-unzip
-unzipped
-unzipping
-upbraided
-urgin
-urgin's
-usherette's
-usonan
-UUOs
-Uzbeks
-VA
-vaginae
-vagine
-Valby
-vampire's
-Vanbrugh
-vaseux
-Vasser
-Vavasour
-VAX's
-VD
-velcro
-venait
-veni
-verborumque
-verumque
-vet's
-Vette
-veux
-VI's
-vibrators
-vici
-Vida
-vidi
-virginem
-Visme
-viziti
-voir
-Volby
-volebat
-von
-Vonnegut
-vous
-VRAAAARRRRRK
-Vries
-waaaahmmmb
-Waal
-wabbit
-Wadd
-Waggying
-wald
-Waldheimers
-Walka
-walkin
-wangs
-wanna
-WASP's
-WASPs
-Waterin
-Watt's
-wedgies
-Weellll
-weightbearing
-Weinberger
-Wellesleysnatch
-Werderobe
-Whaddaya
-Whalen
-whanger
-What'll
-whatchamacalit
-Whatsa
-whatta
-Wheaties
-where'd'ja
-Whhoooooooeeeeeeeeeee
-Whhoooosh
-whiffed
-whimsy
-whirlers
-White's
-Whitehorn
-WHOAH
-Whoopie
-whorehouse
-Whut's
-Why'd
-widda
-wifey
-Wiggam
-Wilde
-wildebeest
-wilds
-Wimbleton
-wimmen
-Windex
-Wittgenstein
-wonderin
-woooooommmb
-workbone
-workin
-wouldja
-wouldn'ta
-Wousy
-Wozniak
-wrestler's
-wrestlers
-wrigglin
-wuz
-Xander
-XXX
-Y'got
-y'know
-Yaaaay
-yaki
-yamalchas
-yankee
-Ybarra
-Yeh
-Yoni
-ysror
-Yuletide
-Yum
-ZAGNUTS
-Zappa
-Zarathustra
-Zealanders
-Zeiger
-Zevon
-zippity
-zitfaced
-zits
-Zukav
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile
index 73d9213..a06daa7 100644
--- a/gnu/lib/libgcc/Makefile
+++ b/gnu/lib/libgcc/Makefile
@@ -123,10 +123,10 @@ CFLAGS+= -fheinous-gnu-extensions
LIB1ASMSRC = lib1funcs.asm
LIB1ASMFUNCS = _dvmd_tls _bb_init_func
.if ${MK_ARM_EABI} != "no"
-LIB1ASMFUNCS+= _addsubdf3 _addsubsf3 _cmpdf2 _cmpsf2 _fixdfsi _fixsfsi \
- _fixunsdfsi _fixunsdfsi _muldivdf3 _muldivsf3 _udivsi3
-
LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c
+# Some compilers generate __aeabi_ functions libgcc_s is missing
+DPADD+= ${LIBGCC}
+LDADD+= -lgcc
.else
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
.endif
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 89689a0..fac1e43 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -361,6 +361,7 @@ MLINKS+=getcap.3 cgetcap.3 \
getcap.3 cgetstr.3 \
getcap.3 cgetustr.3
MLINKS+=getcwd.3 getwd.3
+MLINKS+=getcontext.3 getcontextx.3
MLINKS+=getcontext.3 setcontext.3
MLINKS+=getdomainname.3 setdomainname.3
MLINKS+=getfsent.3 endfsent.3 \
@@ -490,6 +491,20 @@ MLINKS+=ttyname.3 isatty.3 \
MLINKS+=tzset.3 tzsetwall.3
MLINKS+=unvis.3 strunvis.3 \
unvis.3 strunvisx.3
-MLINKS+=vis.3 strvis.3 \
- vis.3 strvisx.3
+MLINKS+=vis.3 nvis.3 \
+ vis.3 snvis.3 \
+ vis.3 strenvisx.3 \
+ vis.3 strnunvis.3 \
+ vis.3 strnunvisx.3 \
+ vis.3 strnvis.3 \
+ vis.3 strnvisx.3 \
+ vis.3 strsenvisx.3 \
+ vis.3 strsnvis.3 \
+ vis.3 strsnvisx.3 \
+ vis.3 strsvis.3 \
+ vis.3 strsvisx.3 \
+ vis.3 strvis.3 \
+ vis.3 strvisx.3 \
+ vis.3 svis.3
+
MLINKS+=wordexp.3 wordfree.3
diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map
index 4cbf07c..2438951 100644
--- a/lib/libc/gen/Symbol.map
+++ b/lib/libc/gen/Symbol.map
@@ -391,10 +391,12 @@ FBSD_1.3 {
pwcache_userdb;
pwcache_groupdb;
snvis;
+ strenvisx;
strnunvis;
strnunvisx;
strnvis;
strnvisx;
+ strsenvisx;
strsnvis;
strsnvisx;
strsvis;
diff --git a/lib/libc/gen/getcontext.3 b/lib/libc/gen/getcontext.3
index 5b801fd..9e3e4fc 100644
--- a/lib/libc/gen/getcontext.3
+++ b/lib/libc/gen/getcontext.3
@@ -35,7 +35,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 26, 2011
+.Dd March 13, 2013
.Dt GETCONTEXT 3
.Os
.Sh NAME
@@ -47,6 +47,8 @@
.In ucontext.h
.Ft int
.Fn getcontext "ucontext_t *ucp"
+.Ft ucontext_t *
+.Fn getcontextx "void"
.Ft int
.Fn setcontext "const ucontext_t *ucp"
.Sh DESCRIPTION
diff --git a/lib/libc/net/nscachedcli.c b/lib/libc/net/nscachedcli.c
index 1323805..b4de0c1 100644
--- a/lib/libc/net/nscachedcli.c
+++ b/lib/libc/net/nscachedcli.c
@@ -75,9 +75,10 @@ safe_write(struct cached_connection_ *connection, const void *data,
nevents = _kevent(connection->write_queue, NULL, 0, &eventlist,
1, &timeout);
if ((nevents == 1) && (eventlist.filter == EVFILT_WRITE)) {
- s_result = _write(connection->sockfd, data + result,
+ s_result = _sendto(connection->sockfd, data + result,
eventlist.data < data_size - result ?
- eventlist.data : data_size - result);
+ eventlist.data : data_size - result, MSG_NOSIGNAL,
+ NULL, 0);
if (s_result == -1)
return (-1);
else
@@ -175,8 +176,8 @@ send_credentials(struct cached_connection_ *connection, int type)
nevents = _kevent(connection->write_queue, NULL, 0, &eventlist, 1,
NULL);
if (nevents == 1 && eventlist.filter == EVFILT_WRITE) {
- result = (_sendmsg(connection->sockfd, &cred_hdr, 0) == -1) ?
- -1 : 0;
+ result = (_sendmsg(connection->sockfd, &cred_hdr,
+ MSG_NOSIGNAL) == -1) ? -1 : 0;
EV_SET(&eventlist, connection->sockfd, EVFILT_WRITE, EV_ADD,
0, 0, NULL);
_kevent(connection->write_queue, &eventlist, 1, NULL, 0, NULL);
diff --git a/lib/libc/stdlib/realpath.3 b/lib/libc/stdlib/realpath.3
index c7384d6..33970fd 100644
--- a/lib/libc/stdlib/realpath.3
+++ b/lib/libc/stdlib/realpath.3
@@ -42,7 +42,7 @@
.Sh SYNOPSIS
.In stdlib.h
.Ft "char *"
-.Fn realpath "const char *pathname" "char *resolved_path"
+.Fn realpath "const char * restrict pathname" "char * restrict resolved_path"
.Sh DESCRIPTION
The
.Fn realpath
diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2
index 59979a3..ab8af51 100644
--- a/lib/libc/sys/chflags.2
+++ b/lib/libc/sys/chflags.2
@@ -232,3 +232,7 @@ and
.Fn fchflags
system calls first appeared in
.Bx 4.4 .
+The
+.Fn lchflags
+system call first appeared in
+.Fx 5.0 .
diff --git a/lib/libipsec/test-policy.c b/lib/libipsec/test-policy.c
index c1dfc79..a24a0b41 100644
--- a/lib/libipsec/test-policy.c
+++ b/lib/libipsec/test-policy.c
@@ -75,14 +75,13 @@ struct req_t {
{ 1, "out ipsec ah/transport esp/use" },
{ 1, "in ipsec ah/transport esp/tunnel" },
{ 0, "in ipsec ah/transport esp/tunnel/::1-::1" },
-{ 0, "in ipsec
- ah / transport
- esp / tunnel / ::1-::2" },
-{ 0, "out ipsec
- ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require
- ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require
- ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require
- " },
+{ 0, "in ipsec\n"
+ "ah / transport\n"
+ "esp / tunnel / ::1-::2" },
+{ 0, "out ipsec\n"
+ "ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require\n"
+ "ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require\n"
+ "ah/transport/::1-::2 esp/tunnel/::3-::4/use ah/transport/::5-::6/require\n" },
{ 0, "out ipsec esp/transport/fec0::10-fec0::11/use" },
};
diff --git a/lib/libncp/CREDITS b/lib/libncp/CREDITS
deleted file mode 100644
index 4338055..0000000
--- a/lib/libncp/CREDITS
+++ /dev/null
@@ -1,27 +0,0 @@
-# $FreeBSD$
-
-In the development of NetWare client for FreeBSD next sources was used:
-
-ncpfs for Linux - written by Volker Lendecke (lendecke@math.uni-goettingen.de),
- thanks to him for giving a permission to publish his code under BSD-style
- license.
-
-"Interrupt List" from Ralf Brown,
-
-Many files from the /sys directory.
-
-NDK documentation from Novell Inc.
-
-
-Also thanks to thouse who gets time to testing, reporting problems and give
-a good suggestions (in alphabet order):
-
-Anatoly A. Orehovsky
-Andrew Petrenko
-Jesus Rodriguez
-Matthew N. Dodd
-Mike Pitt
-Vadim Mikhailov
-
-
-Author - Boris Popov <bp@butya.kz>, <bp@freebsd.org>
diff --git a/lib/libncp/Makefile b/lib/libncp/Makefile
deleted file mode 100644
index d7870a0..0000000
--- a/lib/libncp/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-
-LIB= ncp
-
-SHLIB_MAJOR= 4
-
-DPADD= ${LIBIPX}
-LDADD= -lipx
-
-SRCS= ncpl_subr.c ncpl_bind.c ncpl_queue.c ncpl_file.c ncpl_misc.c \
- ncpl_net.c ncpl_rcfile.c ncpl_conn.c ncpl_nls.c ncpl_msg.c \
- ncpl_rpc.c ncpl_crypt.c ipx.c sap.c
-
-WARNS?= 0
-
-.include <bsd.lib.mk>
diff --git a/lib/libncp/ipx.c b/lib/libncp/ipx.c
deleted file mode 100644
index d658b5a..0000000
--- a/lib/libncp/ipx.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/sysctl.h>
-#include <sys/time.h>
-
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <net/if_var.h>
-#include <net/if_dl.h>
-#include <net/if_types.h>
-#include <net/route.h>
-
-/* IPX */
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-
-#include <ctype.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <netncp/ncp_lib.h>
-
-#define IPX_NODE_LEN 6
-
-typedef u_long IPXNet;
-typedef u_short IPXPort;
-typedef union ipx_host IPXNode;
-
-
-void
-ipx_fprint_node(FILE * file, IPXNode node){
- fprintf(file, "%02X%02X%02X%02X%02X%02X",
- (unsigned char) node.c_host[0],
- (unsigned char) node.c_host[1],
- (unsigned char) node.c_host[2],
- (unsigned char) node.c_host[3],
- (unsigned char) node.c_host[4],
- (unsigned char) node.c_host[5]
- );
-}
-
-void
-ipx_fprint_network(FILE * file, const IPXNet net){
- fprintf(file, "%08X", (u_int32_t)ntohl(net));
-}
-
-void
-ipx_fprint_port(FILE * file, IPXPort port)
-{
- fprintf(file, "%04X", ntohs(port));
-}
-
-void
-ipx_fprint_addr(FILE * file, struct ipx_addr *ipx)
-{
- ipx_fprint_network(file, ipx_netlong(*ipx));
- fprintf(file, ":");
- ipx_fprint_node(file, ipx->x_host);
- fprintf(file, ":");
- ipx_fprint_port(file, ipx->x_port);
-}
-
-void
-ipx_print_node(IPXNode node)
-{
- ipx_fprint_node(stdout, node);
-}
-
-void
-ipx_print_network(IPXNet net)
-{
- ipx_fprint_network(stdout, net);
-}
-
-void
-ipx_print_port(IPXPort port)
-{
- ipx_fprint_port(stdout, port);
-}
-
-void
-ipx_print_addr(struct ipx_addr *ipx)
-{
- ipx_fprint_addr(stdout, ipx);
-}
-
-int
-ipx_sscanf_node(char *buf, unsigned char node[6])
-{
- int i;
- int n[6];
-
- if ((i = sscanf(buf, "%2x%2x%2x%2x%2x%2x",
- &(n[0]), &(n[1]), &(n[2]),
- &(n[3]), &(n[4]), &(n[5]))) != 6)
- {
- return i;
- }
- for (i = 0; i < 6; i++)
- {
- node[i] = n[i];
- }
- return 6;
-}
-
-int
-ipx_sscanf_saddr(char *buf, struct sockaddr_ipx *target)
-{
- char *p;
- struct sockaddr_ipx addr;
- unsigned long sipx_net;
-
- addr.sipx_family = AF_IPX;
-/*!! addr.sipx_type = NCP_PTYPE;*/
-
- if (sscanf(buf, "%lx", &sipx_net) != 1)
- {
- return 1;
- }
- ((union ipx_net_u*)(&addr.sipx_addr.x_net))->long_e = htonl(sipx_net);
- if ((p = strchr(buf, ':')) == NULL){
- return 1;
- }
- p += 1;
- if (ipx_sscanf_node(p, addr.sipx_node) != 6)
- {
- return 1;
- }
- if ((p = strchr(p, ':')) == NULL)
- {
- return 1;
- }
- p += 1;
- if (sscanf(p, "%hx", &addr.sipx_port) != 1)
- {
- return 1;
- }
- addr.sipx_port = htons(addr.sipx_port);
- *target = addr;
- return 0;
-}
-
-
-void ipx_assign_node(IPXNode *dest, IPXNode *src) {
- memcpy(dest, src, IPX_NODE_LEN);
-}
-
-
-static void rt_xaddrs(caddr_t, caddr_t, struct rt_addrinfo *);
-static int if_ipxscan(int addrcount, struct sockaddr_dl *sdl,
- struct if_msghdr *ifm, struct ifa_msghdr *ifam,
- struct ipx_addr *addr);
-
-/*
- * Find an IPX interface.
- * ifname specifies interface name, if NULL search for all interfaces
- * if ifname[0]='0', also all interfaces, but return its name
- * addr on input preferred net address can be specified or 0 for any,
- * on return contains full address (except port)
- * returns 0 if interface was found
- */
-int
-ipx_iffind(char *ifname,struct ipx_addr *addr){
- char name[32];
- int all=0, flags, foundit = 0, addrcount;
- struct if_msghdr *ifm, *nextifm;
- struct ifa_msghdr *ifam;
- struct sockaddr_dl *sdl;
- char *buf, *lim, *next;
- size_t needed;
- int mib[6];
-
- if( ifname!=NULL ) {
- strncpy(name,ifname,sizeof(name)-1);
- if( name[0]==0 )
- all=1;
- } else
- all = 1;
-
- mib[0] = CTL_NET;
- mib[1] = PF_ROUTE;
- mib[2] = 0;
- mib[3] = AF_IPX;
- mib[4] = NET_RT_IFLIST;
- mib[5] = 0;
-
- if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
- return(1);
- if ((buf = malloc(needed)) == NULL)
- return(1);
- if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
- free(buf);
- return(1);
- }
- lim = buf + needed;
-
- next = buf;
- while (next < lim) {
- ifm = (struct if_msghdr *)next;
- if (ifm->ifm_type == RTM_IFINFO) {
- sdl = (struct sockaddr_dl *)(ifm + 1);
- flags = ifm->ifm_flags;
- } else {
- fprintf(stderr, "if_ipxfind: out of sync parsing NET_RT_IFLIST\n");
- fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, ifm->ifm_type);
- fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen);
- fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, lim);
- free(buf);
- return(1);
- }
-
- next += ifm->ifm_msglen;
- ifam = NULL;
- addrcount = 0;
- while (next < lim) {
- nextifm = (struct if_msghdr *)next;
- if (nextifm->ifm_type != RTM_NEWADDR)
- break;
- if (ifam == NULL)
- ifam = (struct ifa_msghdr *)nextifm;
- addrcount++;
- next += nextifm->ifm_msglen;
- }
-
- if (all) {
- if ((flags & IFF_UP) == 0)
- continue; /* not up */
- strncpy(name, sdl->sdl_data, sdl->sdl_nlen);
- name[sdl->sdl_nlen] = '\0';
- } else {
- if (strlen(name) != sdl->sdl_nlen)
- continue; /* not same len */
- if (strncmp(name, sdl->sdl_data, sdl->sdl_nlen) != 0)
- continue; /* not same name */
- }
-
- foundit=if_ipxscan(addrcount, sdl, ifm, ifam, addr);
- if( foundit ) {
- if( ifname!=NULL && ifname[0]==0) {
- strncpy(ifname,sdl->sdl_data, sdl->sdl_nlen);
- ifname[sdl->sdl_nlen]=0;
- }
- break;
- }
- }
- free(buf);
-
- return foundit ? 0:1;
-}
-
-
-int
-if_ipxscan(addrcount, sdl, ifm, ifam, addr)
- int addrcount;
- struct sockaddr_dl *sdl;
- struct if_msghdr *ifm;
- struct ifa_msghdr *ifam;
- struct ipx_addr *addr;
-{
- struct rt_addrinfo info;
- struct sockaddr_ipx *sipx;
- int s;
-
- if ((s = socket(AF_IPX, SOCK_DGRAM, 0)) < 0) {
- perror("ifconfig: socket");
- return 0;
- }
-
- while (addrcount > 0) {
- info.rti_addrs = ifam->ifam_addrs;
- /* Expand the compacted addresses */
- rt_xaddrs((char *)(ifam + 1), ifam->ifam_msglen + (char *)ifam, &info);
- addrcount--;
- ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen);
- if (info.rti_info[RTAX_IFA]->sa_family == AF_IPX) {
- sipx = (struct sockaddr_ipx *)info.rti_info[RTAX_IFA];
- if( ipx_nullnet(sipx->sipx_addr) ) continue;
- if( ipx_nullnet(*addr) ||
- ipx_neteq(sipx->sipx_addr,*addr) ) {
- *addr=sipx->sipx_addr;
- close(s);
- return(1);
- }
- }
- }
- close(s);
- return(0);
-}
-/*
- * Expand the compacted form of addresses as returned via the
- * configuration read via sysctl().
- */
-
-#define ROUNDUP(a) \
- ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
-
-static void
-rt_xaddrs(cp, cplim, rtinfo)
- caddr_t cp, cplim;
- struct rt_addrinfo *rtinfo;
-{
- struct sockaddr *sa;
- int i;
-
- memset(rtinfo->rti_info, 0, sizeof(rtinfo->rti_info));
- for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
- if ((rtinfo->rti_addrs & (1 << i)) == 0)
- continue;
- rtinfo->rti_info[i] = sa = (struct sockaddr *)cp;
- ADVANCE(cp, sa);
- }
-}
-
diff --git a/lib/libncp/ipxsap.h b/lib/libncp/ipxsap.h
deleted file mode 100644
index 2b26b6a..0000000
--- a/lib/libncp/ipxsap.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _IPXSAP_H_
-#define _IPXSAP_H_
-
-#define IPX_SAP_GENERAL_QUERY 1
-#define IPX_SAP_GENERAL_RESPONSE 2
-#define IPX_SAP_NEAREST_QUERY 3
-#define IPX_SAP_NEAREST_RESPONSE 4
-
-
-#define IPX_SAP_MAX_ENTRIES 7
-#define IPX_SAP_SERVER_DOWN 16
-#define IPX_SAP_SERVER_NAME_LEN 48
-#define IPX_SAP_REQUEST_LEN 4
-
-/* Values for server_type */
-#define IPX_SAP_FILE_SERVER 4
-
-struct sap_query {
- u_short query_type; /* net order */
- u_short server_type; /* net order */
-} __packed;
-
-struct sap_entry {
- u_short server_type;
- u_char server_name[IPX_SAP_SERVER_NAME_LEN];
- struct ipx_addr ipx;
- u_short hops;
-} __packed;
-
-struct sap_packet {
- u_short operation;
- struct sap_entry sap_entries[1];
-} __packed;
-
-struct sap_rq {
- struct sockaddr_ipx dest_addr;
- int sock;
- int entries;
- struct sap_packet* buffer;
-};
-/*
-#define sap_name_equal(n1,n2) (strncmp(n1,n2,IPX_SAP_SERVER_NAME_LEN) == 0);
-#define sap_type_equal(t1,t2) (t1==IPX_SAP_GENERAL_RQ || t2==IPX_SAP_GENERAL_RQ || t1==t2);
-*/
-void sap_copy_name(char *dest,char *src);
-int sap_getsock(int *rsock);
-
-
-int sap_rq_init(struct sap_rq* out,int sock);
-int sap_rq_flush(struct sap_rq* out);
-void sap_rq_general(struct sap_rq* out,u_short ser_type);
-void sap_rq_gns_request(struct sap_rq* out,u_short ser_type);
-void sap_rq_response(struct sap_rq* out,u_short type,char *name,struct sockaddr_ipx* addr,u_short hops,int down_allow);
-void sap_rq_gns_response(struct sap_rq* out,u_short type,char * name,struct sockaddr_ipx* addr,u_short hops);
-void sap_rq_set_destination(struct sap_rq* out,struct ipx_addr *dest);
-
-int sap_find_nearest(int server_type, struct sockaddr_ipx *result,char *server_name);
-
-extern int (*sap_sendto_func)(void* buffer,int size,struct sockaddr_ipx* daddr,int sock);
-int ipx_iffind(char *ifname, struct ipx_addr *addr);
-
-#endif /* !_IPXSAP_H_ */
diff --git a/lib/libncp/ncpl_bind.c b/lib/libncp/ncpl_bind.c
deleted file mode 100644
index d00cfa8..0000000
--- a/lib/libncp/ncpl_bind.c
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <string.h>
-#include <netncp/ncp_lib.h>
-
-static void nw_passencrypt(char *old, char *new, char *out);
-
-int
-ncp_get_bindery_object_id(NWCONN_HANDLE connid, u_int16_t object_type,
- const char *object_name, struct ncp_bindery_object *target)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 53);
- ncp_add_word_hl(conn, object_type);
- ncp_add_pstring(conn, object_name);
-
- if ((error = ncp_request(connid, 23, conn)) != 0) {
- return error;
- }
- if (conn->rpsize < 54) {
- return EACCES;
- }
- target->object_id = ncp_reply_dword_hl(conn, 0);
- target->object_type = ncp_reply_word_hl(conn, 4);
- memcpy(target->object_name, ncp_reply_data(conn, 6), 48);
- return 0;
-}
-
-int
-ncp_read_property_value(NWCONN_HANDLE connid, int object_type,
- const char *object_name, int segment, const char *prop_name,
- struct nw_property *target)
-{
- int error;
- struct ncp_buf conn;
- ncp_init_request_s(&conn, 61);
- ncp_add_word_hl(&conn, object_type);
- ncp_add_pstring(&conn, object_name);
- ncp_add_byte(&conn, segment);
- ncp_add_pstring(&conn, prop_name);
-
- if ((error = ncp_request(connid,23,&conn)) != 0) {
- return error;
- }
- memcpy(&(target->value), ncp_reply_data(&conn, 0), 128);
- target->more_flag = ncp_reply_byte(&conn, 128);
- target->property_flag = ncp_reply_byte(&conn, 129);
- return 0;
-}
-
-int
-ncp_scan_bindery_object(NWCONN_HANDLE connid, u_int32_t last_id,
- u_int16_t object_type, const char *search_string,
- struct ncp_bindery_object *target)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 55);
- ncp_add_dword_hl(conn, last_id);
- ncp_add_word_hl(conn, object_type);
- ncp_add_pstring(conn, search_string);
- error = ncp_request(connid, 23, conn);
- if (error) return error;
- target->object_id = ncp_reply_dword_hl(conn, 0);
- target->object_type = ncp_reply_word_hl(conn, 4);
- memcpy(target->object_name, ncp_reply_data(conn, 6),NCP_BINDERY_NAME_LEN);
- target->object_flags = ncp_reply_byte(conn, 54);
- target->object_security = ncp_reply_byte(conn, 55);
- target->object_has_prop = ncp_reply_byte(conn, 56);
- return 0;
-}
-
-int
-ncp_get_bindery_object_name(NWCONN_HANDLE connid, u_int32_t object_id,
- struct ncp_bindery_object *target)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 54);
- ncp_add_dword_hl(conn, object_id);
- if ((error = ncp_request(connid, 23, conn)) != 0)
- return error;
- target->object_id = ncp_reply_dword_hl(conn, 0);
- target->object_type = ncp_reply_word_hl(conn, 4);
- memcpy(target->object_name, ncp_reply_data(conn, 6), 48);
- return 0;
-}
-
-int
-ncp_change_obj_passwd(NWCONN_HANDLE connid,
- const struct ncp_bindery_object *object,
- const u_char *key,
- const u_char *oldpasswd,
- const u_char *newpasswd)
-{
- long id = htonl(object->object_id);
- u_char cryptkey[8];
- u_char newpwd[16]; /* new passwd as stored by server */
- u_char oldpwd[16]; /* old passwd as stored by server */
- u_char len;
- DECLARE_RQ;
-
- memcpy(cryptkey, key, 8);
- nw_keyhash((u_char *)&id, oldpasswd, strlen(oldpasswd), oldpwd);
- nw_keyhash((u_char *)&id, newpasswd, strlen(newpasswd), newpwd);
- nw_encrypt(cryptkey, oldpwd, cryptkey);
- nw_passencrypt(oldpwd, newpwd, newpwd);
- nw_passencrypt(oldpwd + 8, newpwd + 8, newpwd + 8);
- if ((len = strlen(newpasswd)) > 63) {
- len = 63;
- }
- len = ((len ^ oldpwd[0] ^ oldpwd[1]) & 0x7f) | 0x40;
-
- ncp_init_request_s(conn, 75);
- ncp_add_mem(conn, cryptkey, 8);
- ncp_add_word_hl(conn, object->object_type);
- ncp_add_pstring(conn, object->object_name);
- ncp_add_byte(conn, len);
- ncp_add_mem(conn, newpwd, 16);
- return ncp_request(connid, 23, conn);
-}
-
-/*
- * target is a 8-byte buffer
- */
-int
-ncp_get_encryption_key(NWCONN_HANDLE cH, char *target) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 23);
-
- error = ncp_request(cH, 23, conn);
- if (error)
- return error;
- if (conn->rpsize < 8)
- return EACCES;
- memcpy(target, ncp_reply_data(conn, 0), 8);
- return 0;
-}
-
-int
-ncp_keyed_verify_password(NWCONN_HANDLE cH, char *key, char *passwd,
- struct ncp_bindery_object *objinfo)
-{
- u_long id = htonl(objinfo->object_id);
- u_char cryptkey[8];
- u_char buf[128];
- DECLARE_RQ;
-
- nw_keyhash((u_char *)&id, passwd, strlen(passwd), buf);
- nw_encrypt(key, buf, cryptkey);
-
- ncp_init_request_s(conn, 74);
- ncp_add_mem(conn, cryptkey, sizeof(cryptkey));
- ncp_add_word_hl(conn, objinfo->object_type);
- ncp_add_pstring(conn, objinfo->object_name);
-
- return ncp_request(cH, 23, conn);
-}
-
-static char passkeys[256 + 16] = {
- 0x0f, 0x08, 0x05, 0x07, 0x0c, 0x02, 0x0e, 0x09,
- 0x00, 0x01, 0x06, 0x0d, 0x03, 0x04, 0x0b, 0x0a,
- 0x02, 0x0c, 0x0e, 0x06, 0x0f, 0x00, 0x01, 0x08,
- 0x0d, 0x03, 0x0a, 0x04, 0x09, 0x0b, 0x05, 0x07,
- 0x05, 0x02, 0x09, 0x0f, 0x0c, 0x04, 0x0d, 0x00,
- 0x0e, 0x0a, 0x06, 0x08, 0x0b, 0x01, 0x03, 0x07,
- 0x0f, 0x0d, 0x02, 0x06, 0x07, 0x08, 0x05, 0x09,
- 0x00, 0x04, 0x0c, 0x03, 0x01, 0x0a, 0x0b, 0x0e,
- 0x05, 0x0e, 0x02, 0x0b, 0x0d, 0x0a, 0x07, 0x00,
- 0x08, 0x06, 0x04, 0x01, 0x0f, 0x0c, 0x03, 0x09,
- 0x08, 0x02, 0x0f, 0x0a, 0x05, 0x09, 0x06, 0x0c,
- 0x00, 0x0b, 0x01, 0x0d, 0x07, 0x03, 0x04, 0x0e,
- 0x0e, 0x08, 0x00, 0x09, 0x04, 0x0b, 0x02, 0x07,
- 0x0c, 0x03, 0x0a, 0x05, 0x0d, 0x01, 0x06, 0x0f,
- 0x01, 0x04, 0x08, 0x0a, 0x0d, 0x0b, 0x07, 0x0e,
- 0x05, 0x0f, 0x03, 0x09, 0x00, 0x02, 0x06, 0x0c,
- 0x05, 0x03, 0x0c, 0x08, 0x0b, 0x02, 0x0e, 0x0a,
- 0x04, 0x01, 0x0d, 0x00, 0x06, 0x07, 0x0f, 0x09,
- 0x06, 0x00, 0x0b, 0x0e, 0x0d, 0x04, 0x0c, 0x0f,
- 0x07, 0x02, 0x08, 0x0a, 0x01, 0x05, 0x03, 0x09,
- 0x0b, 0x05, 0x0a, 0x0e, 0x0f, 0x01, 0x0c, 0x00,
- 0x06, 0x04, 0x02, 0x09, 0x03, 0x0d, 0x07, 0x08,
- 0x07, 0x02, 0x0a, 0x00, 0x0e, 0x08, 0x0f, 0x04,
- 0x0c, 0x0b, 0x09, 0x01, 0x05, 0x0d, 0x03, 0x06,
- 0x07, 0x04, 0x0f, 0x09, 0x05, 0x01, 0x0c, 0x0b,
- 0x00, 0x03, 0x08, 0x0e, 0x02, 0x0a, 0x06, 0x0d,
- 0x09, 0x04, 0x08, 0x00, 0x0a, 0x03, 0x01, 0x0c,
- 0x05, 0x0f, 0x07, 0x02, 0x0b, 0x0e, 0x06, 0x0d,
- 0x09, 0x05, 0x04, 0x07, 0x0e, 0x08, 0x03, 0x01,
- 0x0d, 0x0b, 0x0c, 0x02, 0x00, 0x0f, 0x06, 0x0a,
- 0x09, 0x0a, 0x0b, 0x0d, 0x05, 0x03, 0x0f, 0x00,
- 0x01, 0x0c, 0x08, 0x07, 0x06, 0x04, 0x0e, 0x02,
- 0x03, 0x0e, 0x0f, 0x02, 0x0d, 0x0c, 0x04, 0x05,
- 0x09, 0x06, 0x00, 0x01, 0x0b, 0x07, 0x0a, 0x08
-};
-
-static void
-nw_passencrypt(char *old, char *new, char *out)
-{
- char *p, v;
- char copy[8];
- int i, di, ax;
-
-#define HIGH(x) (((x) >> 4) & 0xf)
-#define LOW(x) ((x) & 0xf)
- memcpy(copy, new, 8);
-
- for (i = 0; i < 16; i++) {
- for (di = 0, ax = 0, p = old; di < 8; di++, ax += 0x20, p++) {
- v = copy[di] ^ *p;
- copy[di] = (passkeys[HIGH(v) + ax + 0x10] << 4) |
- passkeys[LOW(v) + ax];
- }
- v = old[7];
- for (p = old + 7; p > old; p--) {
- *p = HIGH(p[-1]) | ((*p) << 4);
- }
- *old = HIGH(v) | (*old) << 4;
- bzero(out, 8);
-
- for (di = 0; di < 16; di++) {
- v = passkeys[di + 0x100];
- v = (v & 1) ? HIGH(copy[v / 2]) : LOW(copy[v / 2]);
- out[di / 2] |= ((di & 1) ? v << 4 : v);
- }
- memcpy(copy, out, 8);
- }
-}
diff --git a/lib/libncp/ncpl_conn.c b/lib/libncp/ncpl_conn.c
deleted file mode 100644
index 669f836..0000000
--- a/lib/libncp/ncpl_conn.c
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- *
- * Current scheme to create/open connection:
- * 1. ncp_li_init() - lookup -S [-U] options in command line
- * 2. ncp_li_init() - try to find existing connection
- * 3. ncp_li_init() - if no server name and no accessible connections - bail out
- * 4. This is connection candidate, read .rc file, override with command line
- * and go ahead
- * Note: connection referenced only via ncp_login() call. Although it is
- * possible to get connection handle in other way, it will be unwise to use
- * it, since conn can be destroyed at any time.
- *
- */
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <sys/mount.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <pwd.h>
-#include <grp.h>
-#include <unistd.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_rcfile.h>
-#include <fs/nwfs/nwfs.h>
-
-static char *server_name; /* need a better way ! */
-
-
-
-int
-ncp_li_setserver(struct ncp_conn_loginfo *li, const char *arg) {
- if (strlen(arg) >= NCP_BINDERY_NAME_LEN) {
- ncp_error("server name '%s' too long", 0, arg);
- return ENAMETOOLONG;
- }
- ncp_str_upper(strcpy(li->server, arg));
- return 0;
-}
-
-int
-ncp_li_setuser(struct ncp_conn_loginfo *li, char *arg) {
- if (arg && strlen(arg) >= NCP_BINDERY_NAME_LEN) {
- ncp_error("user name '%s' too long", 0, arg);
- return ENAMETOOLONG;
- }
- if (li->user)
- free(li->user);
- if (arg) {
- li->user = strdup(arg);
- if (li->user == NULL)
- return ENOMEM;
- ncp_str_upper(li->user);
- } else
- li->user = NULL;
- return 0;
-}
-
-int
-ncp_li_setpassword(struct ncp_conn_loginfo *li, const char *passwd) {
- if (passwd && strlen(passwd) >= 127) {
- ncp_error("password too long", 0);
- return ENAMETOOLONG;
- }
- if (li->password) {
- bzero(li->password, strlen(li->password));
- free(li->password);
- }
- if (passwd) {
- li->password = strdup(passwd);
- if (li->password == NULL)
- return ENOMEM;
- } else
- li->password = NULL;
- return 0;
-}
-/*
- * Prescan command line for [-S server] [-U user] arguments
- * and fill li structure with defaults
- */
-int
-ncp_li_init(struct ncp_conn_loginfo *li, int argc, char *argv[]) {
- int opt, error = 0;
- char *arg;
-
- bzero(li,sizeof(*li));
- li->timeout = 15; /* these values should be large enough to handle */
- li->retry_count = 4; /* slow servers, even on ethernet */
- li->access_mode = 0;
- li->password = NULL;
- li->sig_level = 1;
- li->objtype = NCP_BINDERY_USER;
- li->owner = NCP_DEFAULT_OWNER;
- li->group = NCP_DEFAULT_GROUP;
- server_name = NULL;
- if (argv == NULL) return 0;
- while (error == 0 && (opt = ncp_getopt(argc, argv, ":S:U:")) != -1) {
- arg = ncp_optarg;
- switch (opt) {
- case 'S':
- error = ncp_li_setserver(li, arg);
- break;
- case 'U':
- error = ncp_li_setuser(li, arg);
- break;
- }
- }
- ncp_optind = ncp_optreset = 1;
- return error;
-}
-
-void
-ncp_li_done(struct ncp_conn_loginfo *li) {
- if (li->user)
- free(li->user);
- if (li->password)
- free(li->password);
-}
-
-/*
- * Lookup existing connection based on li structure, if connection
- * found, it will be referenced. Otherwise full login sequence performed.
- */
-int
-ncp_li_login(struct ncp_conn_loginfo *li, int *aconnid) {
- int connHandle, error;
-
- if ((error = ncp_conn_scan(li, &connHandle)) == 0) {
- *aconnid = connHandle;
- return 0;
- }
- error = ncp_connect(li, &connHandle);
- if (error) return errno;
- error = ncp_login(connHandle, li->user, li->objtype, li->password);
- if (error) {
- ncp_disconnect(connHandle);
- } else
- *aconnid = connHandle;
- return error;
-}
-
-/*
- * read rc file as follows:
- * 1. read [server] section
- * 2. override with [server:user] section
- * Since abcence of rcfile is not a bug, silently ignore that fact.
- * rcfile never closed to reduce number of open/close operations.
- */
-int
-ncp_li_readrc(struct ncp_conn_loginfo *li) {
- int i, val, error;
- char uname[NCP_BINDERY_NAME_LEN*2+1];
- char *sect = NULL, *p;
-
- /*
- * if info from cmd line incomplete, try to find existing
- * connection and fill server/user from it.
- */
- if (li->server[0] == 0 || li->user == NULL) {
- int connHandle;
- struct ncp_conn_stat cs;
-
- if ((error = ncp_conn_scan(li, &connHandle)) != 0) {
- ncp_error("no default connection found", errno);
- return error;
- }
- ncp_conn_getinfo(connHandle, &cs);
- ncp_li_setserver(li, cs.li.server);
- ncp_li_setuser(li, cs.user);
- ncp_li_setpassword(li, "");
- ncp_disconnect(connHandle);
- }
- if (ncp_open_rcfile()) return 0;
-
- for (i = 0; i < 2; i++) {
- switch (i) {
- case 0:
- sect = li->server;
- break;
- case 1:
- strcat(strcat(strcpy(uname,li->server),":"),li->user ? li->user : "default");
- sect = uname;
- break;
- }
- rc_getstringptr(ncp_rc, sect, "password", &p);
- if (p)
- ncp_li_setpassword(li, p);
- rc_getint(ncp_rc,sect, "timeout", &li->timeout);
- rc_getint(ncp_rc,sect, "retry_count", &li->retry_count);
- rc_getint(ncp_rc,sect, "sig_level", &li->sig_level);
- if (rc_getint(ncp_rc,sect,"access_mode",&val) == 0)
- li->access_mode = val;
- if(rc_getbool(ncp_rc,sect,"bindery",&val) == 0 && val) {
- li->opt |= NCP_OPT_BIND;
- }
- }
- return 0;
-}
-
-/*
- * check for all uncompleted fields
- */
-int
-ncp_li_check(struct ncp_conn_loginfo *li) {
- int error = 0;
- char *p;
-
- do {
- if (li->server[0] == 0) {
- ncp_error("no server name specified", 0);
- error = 1;
- break;
- }
- error = ncp_find_fileserver(li,
- (server_name==NULL) ? AF_IPX : AF_INET, server_name);
- if (error) {
- ncp_error("can't find server %s", error, li->server);
- break;
- }
- if (li->user == NULL || li->user[0] == 0) {
- ncp_error("no user name specified for server %s",
- 0, li->server);
- error = 1;
- break;
- }
- if (li->password == NULL) {
- p = getpass("Netware password:");
- error = ncp_li_setpassword(li, p) ? 1 : 0;
- }
- } while (0);
- return error;
-}
-
-int
-ncp_conn_cnt(void) {
- int error, cnt = 0;
- size_t len = sizeof(cnt);
-
- error = sysctlbyname("net.ncp.conn_cnt", &cnt, &len, NULL, 0);
- if (error) cnt = 0;
- return cnt;
-}
-
-/*
- * Find an existing connection and reference it
- */
-int
-ncp_conn_find(char *server,char *user) {
- struct ncp_conn_args ca;
- int connid, error;
-
- if (server == NULL && user == NULL) {
- error = ncp_conn_scan(NULL,&connid);
- if (error) return -2;
- return connid;
- }
- if (server == NULL)
- return -2;
- ncp_str_upper(server);
- if (user) ncp_str_upper(user);
- bzero(&ca, sizeof(ca));
- ncp_li_setserver(&ca, server);
- ncp_li_setuser(&ca, user);
- error = ncp_conn_scan(&ca,&connid);
- if (error)
- connid = -1;
- return connid;
-}
-
-int
-ncp_li_arg(struct ncp_conn_loginfo *li, int opt, char *arg) {
- int error = 0, sig_level;
- char *p, *cp;
- struct group *gr;
- struct passwd *pw;
-
- switch(opt) {
- case 'S': /* we already fill server/[user] pair */
- case 'U':
- break;
- case 'A':
- server_name = arg;
- break;
- case 'B':
- li->opt |= NCP_OPT_BIND;
- break;
- case 'C':
- li->opt |= NCP_OPT_NOUPCASEPASS;
- break;
- case 'I':
- sig_level = atoi(arg);
- if (sig_level < 0 || sig_level > 3) {
- ncp_error("invalid NCP signature level option `%s'\
- (must be a number between 0 and 3)", 0, arg);
- error = 1;
- }
- li->sig_level = sig_level;
- if (sig_level > 1) li->opt |= NCP_OPT_SIGN;
- break;
- case 'M':
- li->access_mode = strtol(arg, NULL, 8);
- break;
- case 'N':
- ncp_li_setpassword(li, "");
- break;
- case 'O':
- p = strdup(arg);
- cp = strchr(p, ':');
- if (cp) {
- *cp++ = '\0';
- if (*cp) {
- gr = getgrnam(cp);
- if (gr) {
- li->group = gr->gr_gid;
- } else
- ncp_error("invalid group name %s, ignored",
- 0, cp);
- }
- }
- if (*p) {
- pw = getpwnam(p);
- if (pw) {
- li->owner = pw->pw_uid;
- } else
- ncp_error("invalid user name %s, ignored", 0, p);
- }
- endpwent();
- free(p);
- break;
- case 'P':
- li->opt |= NCP_OPT_PERMANENT;
- break;
- case 'R':
- li->retry_count = atoi(arg);
- break;
- case 'W':
- li->timeout = atoi(arg);
- break;
- }
- return error;
-}
-
-void *
-ncp_conn_list(void) {
- int error, cnt = 0;
- size_t len;
- void *p;
-
- cnt = ncp_conn_cnt();
- if (cnt == 0) return NULL;
- len = cnt*(sizeof(struct ncp_conn_stat))+sizeof(int);
- p = malloc(len);
- if (p == NULL) return NULL;
- error = sysctlbyname("net.ncp.conn_stat", p, &len, NULL, 0);
- if (error) {
- free(p);
- p = NULL;
- }
- return p;
-}
-
-
-int
-ncp_conn_setflags(int connid, u_int16_t mask, u_int16_t flags) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_SETFLAGS);
- ncp_add_word_lh(conn, mask);
- ncp_add_word_lh(conn, flags);
- if ((error = ncp_conn_request(connid, conn)) < 0)
- return -1;
- return error;
-}
-
-int
-ncp_login(int connHandle, const char *user, int objtype, const char *password) {
- int error;
- struct ncp_conn_login *p;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_LOGIN);
- p = (struct ncp_conn_login *)&conn->packet[conn->rqsize];
- p->username = (char *)user;
- p->objtype = objtype;
- p->password = (char *)password;
- conn->rqsize += sizeof(*p);
- if ((error = ncp_conn_request(connHandle, conn)) < 0)
- return -1;
- return error;
-}
-
-int
-ncp_connect_addr(struct sockaddr *sa, NWCONN_HANDLE *chp) {
- int error;
- struct ncp_conn_args li;
-
- bzero(&li, sizeof(li));
- bcopy(sa, &li.addr, sa->sa_len);
- /*
- * XXX Temporary !!!. server will be filled in kernel !!!
- */
- strcpy(li.server,ipx_ntoa(li.ipxaddr.sipx_addr));
- error = ncp_connect(&li, chp);
- return error;
-}
-
-int
-ncp_conn_getinfo(int connHandle, struct ncp_conn_stat *ps) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_GETINFO);
- if ((error = ncp_conn_request(connHandle, conn)) < 0)
- return -1;
- memcpy(ps, ncp_reply_data(conn,0), sizeof(*ps));
- return error;
-}
-
-int
-ncp_conn_getuser(int connHandle, char **user) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_GETUSER);
- if ((error = ncp_conn_request(connHandle, conn)) < 0)
- return -1;
- *user = strdup(ncp_reply_data(conn,0));
- return error;
-}
-
-int
-ncp_conn2ref(int connHandle, int *connRef) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_CONN2REF);
- if ((error = ncp_conn_request(connHandle, conn)) < 0)
- return -1;
- *connRef = *((int*)ncp_reply_data(conn,0));
- return error;
-}
-
-int
-ncp_path2conn(char *path, int *connHandle) {
- struct statfs st;
- int d, error;
-
- if ((error = statfs(path, &st)) != 0) return errno;
- if (strcmp(st.f_fstypename,"nwfs") != 0) return EINVAL;
- if ((d = open(path, O_RDONLY)) < 0) return errno;
- if ((error = ioctl(d,NWFSIOC_GETCONN, connHandle)) != 0) return errno;
- close(d);
- return 0;
-}
-
-int
-ncp_conn_dup(NWCONN_HANDLE org, NWCONN_HANDLE *res) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_DUP);
- if ((error = ncp_conn_request(org, conn)) < 0)
- return errno;
- *res = *((int*)ncp_reply_data(conn, 0));
- return 0;
-}
diff --git a/lib/libncp/ncpl_crypt.c b/lib/libncp/ncpl_crypt.c
deleted file mode 100644
index bc304c0..0000000
--- a/lib/libncp/ncpl_crypt.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Routines in this file based on the work of Volker Lendecke,
- * Adapted for ncplib by Boris Popov
- * Please note that ncpl_crypt.c file should be indentical to this one
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-#include <string.h>
-
-/*$*********************************************************
- $*
- $* This code has been taken from DDJ 11/93, from an
- $* article by Pawel Szczerbina.
- $*
- $* Password encryption routines follow.
- $* Converted to C from Barry Nance's Pascal
- $* prog published in the March -93 issue of Byte.
- $*
- $* Adapted to be useable for ncpfs by
- $* Volker Lendecke <lendecke@namu01.gwdg.de> in
- $* October 1995.
- $*
- $********************************************************* */
-
-
-
-typedef unsigned char buf32[32];
-
-static unsigned char encrypttable[256] = {
-0x7, 0x8, 0x0, 0x8, 0x6, 0x4, 0xE, 0x4, 0x5, 0xC, 0x1, 0x7, 0xB, 0xF, 0xA, 0x8,
-0xF, 0x8, 0xC, 0xC, 0x9, 0x4, 0x1, 0xE, 0x4, 0x6, 0x2, 0x4, 0x0, 0xA, 0xB, 0x9,
-0x2, 0xF, 0xB, 0x1, 0xD, 0x2, 0x1, 0x9, 0x5, 0xE, 0x7, 0x0, 0x0, 0x2, 0x6, 0x6,
-0x0, 0x7, 0x3, 0x8, 0x2, 0x9, 0x3, 0xF, 0x7, 0xF, 0xC, 0xF, 0x6, 0x4, 0xA, 0x0,
-0x2, 0x3, 0xA, 0xB, 0xD, 0x8, 0x3, 0xA, 0x1, 0x7, 0xC, 0xF, 0x1, 0x8, 0x9, 0xD,
-0x9, 0x1, 0x9, 0x4, 0xE, 0x4, 0xC, 0x5, 0x5, 0xC, 0x8, 0xB, 0x2, 0x3, 0x9, 0xE,
-0x7, 0x7, 0x6, 0x9, 0xE, 0xF, 0xC, 0x8, 0xD, 0x1, 0xA, 0x6, 0xE, 0xD, 0x0, 0x7,
-0x7, 0xA, 0x0, 0x1, 0xF, 0x5, 0x4, 0xB, 0x7, 0xB, 0xE, 0xC, 0x9, 0x5, 0xD, 0x1,
-0xB, 0xD, 0x1, 0x3, 0x5, 0xD, 0xE, 0x6, 0x3, 0x0, 0xB, 0xB, 0xF, 0x3, 0x6, 0x4,
-0x9, 0xD, 0xA, 0x3, 0x1, 0x4, 0x9, 0x4, 0x8, 0x3, 0xB, 0xE, 0x5, 0x0, 0x5, 0x2,
-0xC, 0xB, 0xD, 0x5, 0xD, 0x5, 0xD, 0x2, 0xD, 0x9, 0xA, 0xC, 0xA, 0x0, 0xB, 0x3,
-0x5, 0x3, 0x6, 0x9, 0x5, 0x1, 0xE, 0xE, 0x0, 0xE, 0x8, 0x2, 0xD, 0x2, 0x2, 0x0,
-0x4, 0xF, 0x8, 0x5, 0x9, 0x6, 0x8, 0x6, 0xB, 0xA, 0xB, 0xF, 0x0, 0x7, 0x2, 0x8,
-0xC, 0x7, 0x3, 0xA, 0x1, 0x4, 0x2, 0x5, 0xF, 0x7, 0xA, 0xC, 0xE, 0x5, 0x9, 0x3,
-0xE, 0x7, 0x1, 0x2, 0xE, 0x1, 0xF, 0x4, 0xA, 0x6, 0xC, 0x6, 0xF, 0x4, 0x3, 0x0,
-0xC, 0x0, 0x3, 0x6, 0xF, 0x8, 0x7, 0xB, 0x2, 0xD, 0xC, 0x6, 0xA, 0xA, 0x8, 0xD
-};
-
-static buf32 encryptkeys = {
- 0x48, 0x93, 0x46, 0x67, 0x98, 0x3D, 0xE6, 0x8D,
- 0xB7, 0x10, 0x7A, 0x26, 0x5A, 0xB9, 0xB1, 0x35,
- 0x6B, 0x0F, 0xD5, 0x70, 0xAE, 0xFB, 0xAD, 0x11,
- 0xF4, 0x47, 0xDC, 0xA7, 0xEC, 0xCF, 0x50, 0xC0
-};
-
-/*
- * Create table-based 16-bytes hash from a 32-bytes array
- */
-static void
-nw_hash(buf32 temp, unsigned char *target) {
- short sum;
- unsigned char b3;
- int s, b2, i;
-
- sum = 0;
-
- for (b2 = 0; b2 <= 1; ++b2) {
- for (s = 0; s <= 31; ++s) {
- b3 = (temp[s] + sum) ^ (temp[(s + sum) & 31] - encryptkeys[s]);
- sum += b3;
- temp[s] = b3;
- }
- }
-
- for (i = 0; i <= 15; ++i) {
- target[i] = encrypttable[temp[2 * i]]
- | (encrypttable[temp[2 * i + 1]] << 4);
- }
-}
-
-
-/*
- * Create a 16-bytes pattern from given buffer based on a four bytes key
- */
-void
-nw_keyhash(const u_char *key, const u_char *buf, int buflen, u_char *target) {
- int b2, d, s;
- buf32 temp;
-
- while (buflen > 0 && buf[buflen - 1] == 0)
- buflen--;
-
- bzero(temp, sizeof(temp));
-
- d = 0;
- while (buflen >= 32) {
- for (s = 0; s <= 31; ++s)
- temp[s] ^= buf[d++];
- buflen -= 32;
- }
- b2 = d;
- if (buflen > 0) {
- for (s = 0; s <= 31; ++s) {
- if (d + buflen == b2) {
- temp[s] ^= encryptkeys[s];
- b2 = d;
- } else
- temp[s] ^= buf[b2++];
- }
- }
- for (s = 0; s <= 31; ++s)
- temp[s] ^= key[s & 3];
-
- nw_hash(temp, target);
-}
-
-/*
- * Create an 8-bytes pattern from an 8-bytes key and 16-bytes of data
- */
-void
-nw_encrypt(const u_char *fra, const u_char *buf, u_char *target) {
- buf32 k;
- int s;
-
- nw_keyhash(fra, buf, 16, k);
- nw_keyhash(fra + 4, buf, 16, k + 16);
-
- for (s = 0; s < 16; s++)
- k[s] ^= k[31 - s];
-
- for (s = 0; s < 8; s++)
- *target++ = k[s] ^ k[15 - s];
-}
-
-
diff --git a/lib/libncp/ncpl_file.c b/lib/libncp/ncpl_file.c
deleted file mode 100644
index 042ae5a..0000000
--- a/lib/libncp/ncpl_file.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_file.h>
-#include <fs/nwfs/nwfs.h>
-
-int
-ncp_read(NWCONN_HANDLE connid, ncp_fh *fh, off_t offset, size_t count, char *target) {
- int result;
- struct ncp_rw rwrq;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_READ);
- rwrq.nrw_fh = *fh;
- rwrq.nrw_base = target;
- rwrq.nrw_cnt = count;
- rwrq.nrw_offset = offset;
- ncp_add_mem(conn, &rwrq, sizeof(rwrq));
- if ((result = ncp_conn_request(connid, conn)) < 0)
- return -1;
- return result;
-}
-
-int
-ncp_write(NWCONN_HANDLE connid, ncp_fh *fh, off_t offset, size_t count, char *source)
-{
- int result;
- struct ncp_rw rwrq;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_WRITE);
- rwrq.nrw_fh = *fh;
- rwrq.nrw_base = source;
- rwrq.nrw_cnt = count;
- rwrq.nrw_offset = offset;
- ncp_add_mem(conn, &rwrq, sizeof(rwrq));
-
- if ((result = ncp_conn_request(connid, conn)) < 0)
- return -1;
- return result;
-}
-
-int
-ncp_geteinfo(char *path, struct nw_entry_info *fi) {
- int d, error;
-
- if ((d = open(path, O_RDONLY)) < 0) return errno;
- if ((error = ioctl(d, NWFSIOC_GETEINFO, fi)) != 0) return errno;
- close(d);
- return 0;
-}
-
-
-int
-ncp_AllocTempDirHandle(char *path, NWDIR_HANDLE *pdh) {
- int d;
-
- if ((d = open(path, O_RDONLY)) < 0) return errno;
- *pdh = d;
- return 0;
-}
-
-int
-ncp_DeallocateDirHandle(NWDIR_HANDLE dh) {
- close(dh);
- return 0;
-}
-
-int
-ncp_GetNSEntryInfo(NWDIR_HANDLE dh, struct nw_entry_info *fi, int *ns) {
- int error;
-
- if ((error = ioctl(dh, NWFSIOC_GETEINFO, fi)) != 0) return errno;
- if ((error = ioctl(dh, NWFSIOC_GETNS, ns)) != 0) return errno;
- return 0;
-}
-
-NWCCODE
-ncp_ScanForDeletedFiles(NWCONN_HANDLE cH, pnuint32 iterHandle,
- pnuint32 volNum, pnuint32 dirBase, nuint8 ns,
- NWDELETED_INFO *entryInfo)
-{
- int error;
- struct nw_entry_info *pfi;
- DECLARE_RQ;
-#define UNITEDT(d,t) (((d) << 16) | (t))
-
- bzero(entryInfo, sizeof(NWDELETED_INFO));
- ncp_init_request(conn);
- ncp_add_byte(conn, 16);
- ncp_add_byte(conn, ns);
- ncp_add_byte(conn, 0); /* data stream */
- ncp_add_dword_lh(conn, IM_ALL & ~(IM_SPACE_ALLOCATED | IM_TOTAL_SIZE | IM_EA | IM_DIRECTORY));
- ncp_add_dword_lh(conn, *iterHandle);
-
- ncp_add_byte(conn, *volNum);
- ncp_add_dword_lh(conn, *dirBase);
- ncp_add_byte(conn, NCP_HF_DIRBASE); /* dirBase */
- ncp_add_byte(conn, 0); /* no component */
- if ((error = ncp_request(cH, 87, conn)) != 0) {
- return error;
- }
- if (conn->rpsize < 0x61) {
- return EBADRPC; /* EACCES ? */
- }
- *iterHandle = entryInfo->sequence = ncp_reply_dword_lh(conn, 0x00);
- entryInfo->deletedTime = ncp_reply_word_lh(conn, 0x04);
- entryInfo->deletedDateAndTime = UNITEDT(ncp_reply_word_lh(conn, 0x06), entryInfo->deletedTime);
- entryInfo->deletorID = ncp_reply_dword_hl(conn, 0x08);
- *volNum = ncp_reply_dword_lh(conn, 0x0C);
- *dirBase = ncp_reply_dword_lh(conn, 0x10);
- entryInfo->parent = ncp_reply_dword_lh(conn, 0x10);
- pfi = (struct nw_entry_info*) ncp_reply_data(conn, 0x14);
- entryInfo->nameLength = pfi->nameLen;
- memcpy(entryInfo->name, pfi->entryName, pfi->nameLen);
- return error;
-}
-
-NWCCODE
-ncp_PurgeDeletedFile(NWCONN_HANDLE cH, nuint32 iterHandle,
- nuint32 volNum, nuint32 dirBase, nuint8 ns)
-{
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, 18);
- ncp_add_byte(conn, ns);
- ncp_add_byte(conn, 0); /* reserved */
- ncp_add_dword_lh(conn, iterHandle);
- ncp_add_dword_lh(conn, volNum);
- ncp_add_dword_lh(conn, dirBase);
- return ncp_request(cH, 87, conn);
-}
-
-
-static void
-ncp_extract_entryInfo(char *data, NW_ENTRY_INFO *entry) {
- u_char l;
- const int info_struct_size = sizeof(NW_ENTRY_INFO) - 257;
-
- memcpy(entry, data, info_struct_size);
- data += info_struct_size;
- l = *data++;
- entry->nameLen = l;
- memcpy(entry->entryName, data, l);
- entry->entryName[l] = '\0';
- return;
-}
-
-NWCCODE
-ncp_ScanNSEntryInfo(NWCONN_HANDLE cH,
- nuint8 namSpc, nuint16 attrs, SEARCH_SEQUENCE *seq,
- pnstr8 searchPattern, nuint32 retInfoMask, NW_ENTRY_INFO *entryInfo)
-{
- int error, l;
- DECLARE_RQ;
-
- if (seq->searchDirNumber == -1) {
- seq->searchDirNumber = 0;
- ncp_init_request(conn);
- ncp_add_byte(conn, 2);
- ncp_add_byte(conn, namSpc);
- ncp_add_byte(conn, 0);
- ncp_add_handle_path(conn, seq->volNumber, seq->dirNumber,
- NCP_HF_DIRBASE, NULL);
- error = ncp_request(cH, 87, conn);
- if (error) return error;
- memcpy(seq, ncp_reply_data(conn, 0), 9);
- }
- ncp_init_request(conn);
- ncp_add_byte(conn, 3);
- ncp_add_byte(conn, namSpc);
- ncp_add_byte(conn, 0); /* dataStream */
- ncp_add_word_lh(conn, attrs); /* SearchAttributes */
- ncp_add_dword_lh(conn, retInfoMask);
- ncp_add_mem(conn, seq, sizeof(*seq));
- l = strlen(searchPattern);
- ncp_add_byte(conn, l);
- ncp_add_mem(conn, searchPattern, l);
- error = ncp_request(cH, 87, conn);
- if (error) return error;
- memcpy(seq, ncp_reply_data(conn, 0), sizeof(*seq));
- ncp_extract_entryInfo(ncp_reply_data(conn, 10), entryInfo);
- return 0;
-}
-
-int
-ncp_NSEntryInfo(NWCONN_HANDLE cH, nuint8 ns, nuint8 vol, nuint32 dirent,
- NW_ENTRY_INFO *entryInfo)
-{
- DECLARE_RQ;
- int error;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, 6);
- ncp_add_byte(conn, ns);
- ncp_add_byte(conn, ns); /* DestNameSpace */
- ncp_add_word_lh(conn, htons(0xff00)); /* get all */
- ncp_add_dword_lh(conn, IM_ALL);
- ncp_add_handle_path(conn, vol, dirent, NCP_HF_DIRBASE, NULL);
- error = ncp_request(cH, 87, conn);
- if (error) return error;
- ncp_extract_entryInfo(ncp_reply_data(conn, 0), entryInfo);
- return 0;
-}
-
-NWCCODE
-NWGetVolumeName(NWCONN_HANDLE cH, u_char volume, char *name) {
- int error, len;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 44);
- ncp_add_byte(conn, volume);
- error = ncp_request(cH, 22, conn);
- if (error) return error;
- len = ncp_reply_byte(conn, 29);
- if (len == 0)
- return ENOENT;
- bcopy(ncp_reply_data(conn, 30), name, len);
- name[len] = 0;
- return 0;
-}
diff --git a/lib/libncp/ncpl_misc.c b/lib/libncp/ncpl_misc.c
deleted file mode 100644
index 67d19a9..0000000
--- a/lib/libncp/ncpl_misc.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * calls that don't fit to any other category
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <strings.h>
-
-#include <netncp/ncp_lib.h>
-
-static time_t
-ncp_nw_to_ctime(struct nw_time_buffer *source) {
- struct tm u_time;
-
- bzero(&u_time,sizeof(struct tm));
- /*
- * XXX: NW 4.x tracks daylight automatically
- */
- u_time.tm_isdst = -1;
- u_time.tm_sec = source->second;
- u_time.tm_min = source->minute;
- u_time.tm_hour = source->hour;
- u_time.tm_mday = source->day;
- u_time.tm_mon = source->month - 1;
- u_time.tm_year = source->year;
-
- if (u_time.tm_year < 80) {
- u_time.tm_year += 100;
- }
- return mktime(&u_time);
-}
-
-int
-ncp_get_file_server_information(NWCONN_HANDLE connid,
- struct ncp_file_server_info *target)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 17);
- if ((error = ncp_request(connid, 23, conn)) != 0)
- return error;
- memcpy(target, ncp_reply_data(conn, 0), sizeof(*target));
- target->MaximumServiceConnections
- = htons(target->MaximumServiceConnections);
- target->ConnectionsInUse
- = htons(target->ConnectionsInUse);
- target->MaxConnectionsEverUsed
- = htons(target->MaxConnectionsEverUsed);
- target->NumberMountedVolumes
- = htons(target->NumberMountedVolumes);
- return 0;
-}
-
-int
-ncp_get_stations_logged_info(NWCONN_HANDLE connid, u_int32_t connection,
- struct ncp_bindery_object *target, time_t *login_time)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 28);
- ncp_add_dword_lh(conn, connection);
-
- if ((error = ncp_request(connid, 23, conn)) != 0)
- return error;
- bzero(target, sizeof(*target));
- target->object_id = ncp_reply_dword_hl(conn, 0);
- target->object_type = ncp_reply_word_hl(conn, 4);
- memcpy(target->object_name, ncp_reply_data(conn, 6),
- sizeof(target->object_name));
- *login_time = ncp_nw_to_ctime((struct nw_time_buffer *)ncp_reply_data(conn, 54));
- return 0;
-}
-
-int
-ncp_get_internet_address(NWCONN_HANDLE connid, u_int32_t connection,
- struct ipx_addr *target, u_int8_t * conn_type)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 26);
- ncp_add_dword_lh(conn, connection);
- error = ncp_request(connid, 23, conn);
- if (error) return error;
- bzero(target, sizeof(*target));
- ipx_netlong(*target) = ncp_reply_dword_lh(conn, 0);
- memcpy(&(target->x_host), ncp_reply_data(conn, 4), 6);
- target->x_port = ncp_reply_word_lh(conn, 10);
- *conn_type = ncp_reply_byte(conn, 12);
- return 0;
-}
-
-NWCCODE
-NWGetObjectConnectionNumbers(NWCONN_HANDLE connHandle,
- pnstr8 pObjName, nuint16 objType,
- pnuint16 pNumConns, pnuint16 pConnHandleList,
- nuint16 maxConns)
-{
- int error, i, n;
- nuint32 lastconn;
- DECLARE_RQ;
-
- lastconn = 0;
- ncp_init_request_s(conn, 27);
- ncp_add_dword_lh(conn, lastconn);
- ncp_add_word_hl(conn, objType);
- ncp_add_pstring(conn, pObjName);
- if ((error = ncp_request(connHandle, 23, conn)) != 0) return error;
- n = min(ncp_reply_byte(conn, 0), maxConns);
- *pNumConns = n;
- for (i = 0; i < n ; i++) {
- *pConnHandleList++ = ncp_reply_dword_lh(conn, i * 4 + 1);
- }
- return 0;
-}
-
-void
-NWUnpackDateTime(nuint32 dateTime, NW_DATE *sDate, NW_TIME *sTime) {
- NWUnpackDate(dateTime >> 16, sDate);
- NWUnpackTime(dateTime & 0xffff, sTime);
-}
-
-void
-NWUnpackDate(nuint16 date, NW_DATE *sDate) {
- sDate->day = date & 0x1f;
- sDate->month = (date >> 5) & 0xf;
- sDate->year = ((date >> 9) & 0x7f) + 1980;
-}
-
-void
-NWUnpackTime(nuint16 time, NW_TIME *sTime) {
- sTime->seconds = time & 0x1f;
- sTime->minutes = (time >> 5) & 0x3f;
- sTime->hours = (time >> 11) & 0x1f;
-}
-
-nuint32
-NWPackDateTime(NW_DATE *sDate, NW_TIME *sTime) {
- return 0;
-}
-
-nuint16
-NWPackDate(NW_DATE *sDate) {
- return 0;
-}
-
-nuint16
-NWPackTime(NW_TIME *sTime) {
- return 0;
-}
-
-time_t
-ncp_UnpackDateTime(nuint32 dateTime) {
- struct tm u_time;
- NW_DATE d;
- NW_TIME t;
-
- NWUnpackDateTime(dateTime, &d, &t);
- bzero(&u_time,sizeof(struct tm));
- u_time.tm_isdst = -1;
- u_time.tm_sec = t.seconds;
- u_time.tm_min = t.minutes;
- u_time.tm_hour = t.hours;
- u_time.tm_mday = d.day;
- u_time.tm_mon = d.month - 1;
- u_time.tm_year = d.year - 1900;
-
- return mktime(&u_time);
-}
-
-int
-ncp_GetFileServerDateAndTime(NWCONN_HANDLE cH, time_t *target) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- if ((error = ncp_request(cH, 20, conn)) != 0)
- return error;
- *target = ncp_nw_to_ctime((struct nw_time_buffer *) ncp_reply_data(conn, 0));
- return 0;
-}
-
-int
-ncp_SetFileServerDateAndTime(NWCONN_HANDLE cH, time_t * source) {
- int year;
- struct tm *utime = localtime(source);
- DECLARE_RQ;
-
- year = utime->tm_year;
- if (year > 99) {
- year -= 100;
- }
- ncp_init_request_s(conn, 202);
- ncp_add_byte(conn, year);
- ncp_add_byte(conn, utime->tm_mon + 1);
- ncp_add_byte(conn, utime->tm_mday);
- ncp_add_byte(conn, utime->tm_hour);
- ncp_add_byte(conn, utime->tm_min);
- ncp_add_byte(conn, utime->tm_sec);
- return ncp_request(cH, 23, conn);
-}
-
-NWCCODE
-NWDownFileServer(NWCONN_HANDLE cH, int force) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 211);
- ncp_add_byte(conn, force ? 0 : 0xff);
- return ncp_request(cH, 23, conn);
-}
-
-NWCCODE
-NWCloseBindery(NWCONN_HANDLE cH) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 68);
- return ncp_request(cH, 23, conn);
-}
-
-NWCCODE
-NWOpenBindery(NWCONN_HANDLE cH) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 69);
- return ncp_request(cH, 23, conn);
-}
-
-NWCCODE
-NWDisableTTS(NWCONN_HANDLE cH) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 207);
- return ncp_request(cH, 23, conn);
-}
-
-NWCCODE
-NWEnableTTS(NWCONN_HANDLE cH) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 208);
- return ncp_request(cH, 23, conn);
-}
-
-NWCCODE
-NWDisableFileServerLogin(NWCONN_HANDLE cH) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 203);
- return ncp_request(cH, 23, conn);
-}
-
-NWCCODE
-NWEnableFileServerLogin(NWCONN_HANDLE cH) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 204);
- return ncp_request(cH, 23, conn);
-}
diff --git a/lib/libncp/ncpl_msg.c b/lib/libncp/ncpl_msg.c
deleted file mode 100644
index f2a6874..0000000
--- a/lib/libncp/ncpl_msg.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_nls.h>
-
-NWCCODE
-NWDisableBroadcasts(NWCONN_HANDLE connHandle) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 2);
- return ncp_request(connHandle, 21, conn);
-}
-
-NWCCODE
-NWEnableBroadcasts(NWCONN_HANDLE connHandle) {
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 3);
- return ncp_request(connHandle, 21, conn);
-}
-
-NWCCODE
-NWBroadcastToConsole(NWCONN_HANDLE connHandle, pnstr8 message) {
- int l, error;
- DECLARE_RQ;
-
- l = strlen(message);
- if (l > 60) return EMSGSIZE;
- ncp_init_request_s(conn, 9);
- ncp_add_byte(conn, l);
- ncp_add_mem_nls(conn, message, l);
- error = ncp_request(connHandle, 21, conn);
- return error;
-}
-
-NWCCODE
-NWSendBroadcastMessage(NWCONN_HANDLE connHandle, pnstr8 message,
- nuint16 connCount, pnuint16 connList, pnuint8 resultList)
-{
- int l, i, error;
- DECLARE_RQ;
-
- l = strlen(message);
- if (l > 255) return EMSGSIZE;
- if (connCount > 350) return EINVAL;
-
- ncp_init_request_s(conn, 0x0A);
- ncp_add_word_lh(conn, connCount);
- for (i = 0; i < connCount; i++)
- ncp_add_dword_lh(conn, connList[i]);
- ncp_add_byte(conn, l);
- ncp_add_mem_nls(conn, message, l);
- error = ncp_request(connHandle, 0x15, conn);
- if (!error) {
- l = ncp_reply_word_lh(conn, 0);
- for (i = 0; i < l; i++)
- resultList[i] = ncp_reply_dword_lh(conn, (i)*4 + 2);
- return 0;
- }
- if (error != 0xfb) return error;
- if (l > 58) return EMSGSIZE;
- ncp_init_request_s(conn, 0);
- ncp_add_byte(conn, connCount);
- for (i = 0; i < connCount; i++)
- ncp_add_byte(conn, connList[i]);
- ncp_add_byte(conn, l);
- ncp_add_mem_nls(conn, message, l);
- error = ncp_request(connHandle, 0x15, conn);
- if (error) return error;
- i = ncp_reply_byte(conn, 0);
- memcpy(resultList, ncp_reply_data(conn, 1), i);
- return 0;
-}
-
-
-NWCCODE
-NWGetBroadcastMessage(NWCONN_HANDLE connHandle, pnstr8 message) {
- int i, error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 0x0B);
- error = ncp_request(connHandle, 0x15, conn);
- if (error) {
- if (error != 0x89fb) return error;
- ncp_init_request_s(conn, 0x01);
- if ((error = ncp_request(connHandle, 0x15, conn)) != 0)
- return error;
- }
- i = ncp_reply_byte(conn, 0);
- if (i == 0) return ENOENT;
- memcpy(message, ncp_reply_data(conn, 1), i);
- message[i] = 0;
- ncp_nls_str_n2u(message, message);
- return 0;
-}
diff --git a/lib/libncp/ncpl_net.c b/lib/libncp/ncpl_net.c
deleted file mode 100644
index e59bc11..0000000
--- a/lib/libncp/ncpl_net.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <sys/syscall.h>
-#include <ctype.h>
-#include <netinet/in.h>
-#include <netipx/ipx.h>
-#include <netdb.h>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "ipxsap.h"
-#include <netncp/ncp_lib.h>
-
-static int ncp_find_server_in(struct ncp_conn_loginfo *li, int type, char *server_name);
-
-static int
-ncp_find_server_ipx(struct ncp_conn_loginfo *li, int type) {
- char server[NCP_BINDERY_NAME_LEN + 1];
- int error;
- char nearest[NCP_BINDERY_NAME_LEN + 1];
- struct nw_property prop;
- struct ipx_addr *n_addr = (struct ipx_addr *) &prop;
-/* struct ncp_conn_loginfo ltmp;*/
- int connid;
-
- bzero(server, sizeof(server));
- bzero(nearest, sizeof(nearest));
-
- strcpy(server, li->server);
- ncp_str_upper(server);
-
- if ((error = sap_find_nearest(type, &li->ipxaddr, nearest)) != 0) {
- return error;
- }
- /* if no server specified return info about nearest */
- if (!li->server[0]) {
- strcpy(li->server, nearest);
- return 0;
- }
-/* printf("%s\n",ipx_ntoa(li->ipxaddr.sipx_addr));*/
- if (strcmp(server, nearest) == 0) {
- return 0;
- }
- /* We have to ask the nearest server for our wanted server */
- li->opt=0;
- if ((error = ncp_connect(li, &connid)) != 0) {
- return error;
- }
- if (ncp_read_property_value(connid, type, server, 1, "NET_ADDRESS", &prop) != 0) {
- ncp_disconnect(connid);
- return EHOSTUNREACH;
- }
- if ((error = ncp_disconnect(connid)) != 0) {
- return error;
- }
- li->ipxaddr.sipx_family = AF_IPX;
- li->ipxaddr.sipx_addr.x_net = n_addr->x_net;
- li->ipxaddr.sipx_port = n_addr->x_port;
- li->ipxaddr.sipx_addr.x_host = n_addr->x_host;
- return 0;
-}
-
-static int
-ncp_find_server_in(struct ncp_conn_loginfo *li, int type, char *server_name) {
- struct hostent* h;
- int l;
-
- h = gethostbyname(server_name);
- if (!h) {
- fprintf(stderr, "Get host address `%s': ", server_name);
- herror(NULL);
- return 1;
- }
- if (h->h_addrtype != AF_INET) {
- fprintf(stderr, "Get host address `%s': Not AF_INET\n", server_name);
- return 1;
- }
- if (h->h_length != 4) {
- fprintf(stderr, "Get host address `%s': Bad address length\n", server_name);
- return 1;
- }
- l = sizeof(struct sockaddr_in);
- bzero(&li->inaddr, l);
- li->inaddr.sin_len = l;
- li->inaddr.sin_family = h->h_addrtype;
- memcpy(&li->inaddr.sin_addr.s_addr, h->h_addr, 4);
- li->inaddr.sin_port = htons(524); /* ncp */
- return 0;
-}
-
-int
-ncp_find_server(struct ncp_conn_loginfo *li, int type, int af, char *name) {
- int error = EHOSTUNREACH;
-
- switch(af) {
- case AF_IPX:
- error = ncp_find_server_ipx(li, type);
- break;
- case AF_INET:
- if (name)
- error = ncp_find_server_in(li, type, name);
- break;
- default:
- error = EPROTONOSUPPORT;
- }
- return error;
-}
-
-int
-ncp_find_fileserver(struct ncp_conn_loginfo *li, int af, char *name) {
- return ncp_find_server(li, NCP_BINDERY_FSERVER, af, name);
-}
diff --git a/lib/libncp/ncpl_nls.c b/lib/libncp/ncpl_nls.c
deleted file mode 100644
index 14a26e5..0000000
--- a/lib/libncp/ncpl_nls.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Copyright (c) 1999-2002, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-/*
- * Languages support. Currently is very primitive.
- */
-#include <sys/types.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <locale.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_cfg.h>
-#include <netncp/ncp_nls.h>
-
-#ifndef NCP_NLS_DEFAULT
-#define NCP_NLS_DEFAULT NCP_NLS_AS_IS
-#endif
-
-/*
- * TODO: Make all tables dynamically loadable.
- */
-#ifdef NCP_NLS_KOI2CP866
-/* Russian tables from easy-cyrillic:
- * Copyright (C) 1993-1994 by Andrey A. Chernov, Moscow, Russia
- */
-static u_int8_t alt2koi8[] = {
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x5f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa,
- 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0,
- 0xf2, 0xf3, 0xf4, 0xf5, 0xe6, 0xe8, 0xe3, 0xfe,
- 0xfb, 0xfd, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1,
- 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda,
- 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
- 0x90, 0x91, 0x92, 0x81, 0x87, 0xb2, 0xb4, 0xa7,
- 0xa6, 0xb5, 0xa1, 0xa8, 0xae, 0xad, 0xac, 0x83,
- 0x84, 0x89, 0x88, 0x86, 0x80, 0x8a, 0xaf, 0xb0,
- 0xab, 0xa5, 0xbb, 0xb8, 0xb1, 0xa0, 0xbe, 0xb9,
- 0xba, 0xb6, 0xb7, 0xaa, 0xa9, 0xa2, 0xa4, 0xbd,
- 0xbc, 0x85, 0x82, 0x8d, 0x8c, 0x8e, 0x8f, 0x8b,
- 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde,
- 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1,
- 0xb3, 0xa3, 0x99, 0x98, 0x93, 0x9b, 0x9f, 0x97,
- 0x9c, 0x95, 0x9e, 0x96, 0xbf, 0x9d, 0x94, 0x9a
-};
-
-static u_int8_t koi82alt[] = {
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x5f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0xc4, 0xb3, 0xda, 0xbf, 0xc0, 0xd9, 0xc3, 0xb4, /* 0x80 */
- 0xc2, 0xc1, 0xc5, 0xdf, 0xdc, 0xdb, 0xdd, 0xde,
- 0xb0, 0xb1, 0xb2, 0xf4, 0xfe, 0xf9, 0xfb, 0xf7,
- 0xf3, 0xf2, 0xff, 0xf5, 0xf8, 0xfd, 0xfa, 0xf6,
- 0xcd, 0xba, 0xd5, 0xf1, 0xd6, 0xc9, 0xb8, 0xb7,
- 0xbb, 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6,
- 0xc7, 0xcc, 0xb5, 0xf0, 0xb6, 0xb9, 0xd1, 0xd2,
- 0xcb, 0xcf, 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0xfc,
- 0xee, 0xa0, 0xa1, 0xe6, 0xa4, 0xa5, 0xe4, 0xa3,
- 0xe5, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae,
- 0xaf, 0xef, 0xe0, 0xe1, 0xe2, 0xe3, 0xa6, 0xa2,
- 0xec, 0xeb, 0xa7, 0xe8, 0xed, 0xe9, 0xe7, 0xea,
- 0x9e, 0x80, 0x81, 0x96, 0x84, 0x85, 0x94, 0x83,
- 0x95, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e,
- 0x8f, 0x9f, 0x90, 0x91, 0x92, 0x93, 0x86, 0x82, /* 0xf0 */
- 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a
-};
-
-#endif
-
-/*
- * Characters mapping for codepages used in Sweden.
- */
-static u_int8_t se_nw2unix[] = {
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x5f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0xe1, 0xe2, 0xf7, 0xe7, 0xE4, 0xc4, 0xE5, 0xfa, /* 0x80 */
- 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xC4, 0xC5,
- 0xf2, 0xf3, 0xf4, 0xf5, 0xF6, 0xe8, 0xe3, 0xfe, /* 0x90 */
- 0xfb, 0xD6, 0xff, 0xf9, 0xf8, 0xfc, 0xe0, 0xf1,
- 0xc1, 0xc2, 0xd7, 0xc7, 0xc4, 0xc5, 0xd6, 0xda, /* 0xA0 */
- 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
- 0x90, 0x91, 0x92, 0x81, 0x87, 0xb2, 0xb4, 0xa7, /* 0xB0 */
- 0xa6, 0xb5, 0xa1, 0xa8, 0xae, 0xad, 0xac, 0x83,
- 0x84, 0x89, 0x88, 0x86, 0x80, 0x8a, 0xaf, 0xb0, /* 0xC0 */
- 0xab, 0xa5, 0xbb, 0xb8, 0xb1, 0xa0, 0xbe, 0xb9,
- 0xba, 0xb6, 0xb7, 0xaa, 0xa9, 0xa2, 0xa4, 0xbd, /* 0xD0 */
- 0xbc, 0x85, 0x82, 0x8d, 0x8c, 0x8e, 0x8f, 0x8b,
- 0xd2, 0xd3, 0xd4, 0xd5, 0xc6, 0xc8, 0xc3, 0xde, /* 0xE0 */
- 0xdb, 0xdd, 0xdf, 0xd9, 0xd8, 0xdc, 0xc0, 0xd1,
- 0xb3, 0xa3, 0x99, 0x98, 0x93, 0x9b, 0x9f, 0x97, /* 0xF0 */
- 0x9c, 0x95, 0x9e, 0x96, 0xbf, 0x9d, 0x94, 0x9a
-};
-
-static u_int8_t se_unix2nw[] = {
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x5f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0xc4, 0xb3, 0xda, 0xbf, 0xc0, 0xd9, 0xc3, 0xb4, /* 0x80 */
- 0xc2, 0xc1, 0xc5, 0xdf, 0xdc, 0xdb, 0xdd, 0xde,
- 0xb0, 0xb1, 0xb2, 0xf4, 0xfe, 0xf9, 0xfb, 0xf7, /* 0x90 */
- 0xf3, 0xf2, 0xff, 0xf5, 0xf8, 0xfd, 0xfa, 0xf6,
- 0xcd, 0xba, 0xd5, 0xf1, 0xd6, 0xc9, 0xb8, 0xb7, /* 0xA0 */
- 0xbb, 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6,
- 0xc7, 0xcc, 0xb5, 0xf0, 0xb6, 0xb9, 0xd1, 0xd2, /* 0xB0 */
- 0xcb, 0xcf, 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0xfc,
- 0xee, 0xa0, 0xa1, 0xe6, 0x8E, 0x8F, 0xe4, 0xa3, /* 0xC0 */
- 0xe5, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae,
- 0xaf, 0xef, 0xe0, 0xe1, 0xe2, 0xe3, 0x99, 0xa2, /* 0xD0 */
- 0xec, 0xeb, 0xa7, 0xe8, 0xed, 0xe9, 0xe7, 0xea,
- 0x9e, 0x80, 0x81, 0x96, 0x84, 0x86, 0x94, 0x83, /* 0xE0 */
- 0x95, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e,
- 0x8f, 0x9f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x82, /* 0xf0 */
- 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a
-};
-
-/*
- * Characters mapping for codepages used in Germany.
- */
-static u_int8_t de_nw2unix[] = {
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0xb6, 0xa7, 0x5f, 0x5f, /* 0x10 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7, /* 0x80 */
- 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5,
- 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9, /* 0x90 */
- 0xff, 0xd6, 0xdc, 0xa2, 0xa3, 0xa5, 0x5f, 0x5f,
- 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba, /* 0xA0 */
- 0xbf, 0x5f, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xB0 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xC0 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0xD0 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0xdf, 0x5f, 0x5f, 0x5f, 0x5f, 0xb5, 0x5f, /* 0xE0 */
- 0x5f, 0x5f, 0x5f, 0xf0, 0x5f, 0xf8, 0x5f, 0x5f,
- 0x5f, 0xb1, 0x5f, 0x5f, 0x5f, 0x5f, 0xf7, 0x5f, /* 0xF0 */
- 0xb0, 0x5f, 0xb7, 0x5f, 0x5f, 0xb2, 0x5f, 0xa0
-};
-
-static u_int8_t de_unix2nw[] = {
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x80 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x90 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0xff, 0xad, 0x9b, 0x9c, 0x5f, 0x9d, 0x5f, 0x15, /* 0xA0 */
- 0x5f, 0x5f, 0xa6, 0xae, 0xaa, 0x5f, 0x5f, 0x5f,
- 0xf8, 0xf1, 0xfd, 0x5f, 0x5f, 0xe6, 0x14, 0xfa, /* 0xB0 */
- 0x5f, 0x5f, 0xa7, 0xaf, 0xac, 0xab, 0x5f, 0xa8,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x8e, 0x8f, 0x92, 0x80, /* 0xC0 */
- 0x5f, 0x90, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0xa5, 0x5f, 0x5f, 0x5f, 0x5f, 0x99, 0x5f, /* 0xD0 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x9a, 0x5f, 0x5f, 0xe1,
- 0x85, 0xa0, 0x83, 0x5f, 0x84, 0x86, 0x91, 0x87, /* 0xE0 */
- 0x8a, 0x82, 0x88, 0x89, 0x8d, 0xa1, 0x8c, 0x8b,
- 0xeb, 0xa4, 0x95, 0xa2, 0x93, 0x5f, 0x94, 0xf6, /* 0xF0 */
- 0xed, 0x97, 0xa3, 0x96, 0x81, 0x5f, 0x5f, 0x98
-};
-
-
-static u_int8_t def2lower[256];
-static u_int8_t def2upper[256];
-
-/*
- * List of available charsets
- */
-struct ncp_nlsdesc {
- int scheme;
- char *name;
- struct ncp_nlstables nls;
-};
-
-static struct ncp_nlsdesc ncp_nlslist[] = {
- {NCP_NLS_AS_IS, NCP_NLS_AS_IS_NAME,
- {def2lower, def2upper, NULL, NULL, 0}
- },
-#ifdef NCP_NLS_KOI2CP866
- {NCP_NLS_KOI_866, NCP_NLS_KOI_866_NAME,
- {def2lower, def2upper, alt2koi8, koi82alt, 0}
- },
-#endif
- {NCP_NLS_SE, NCP_NLS_SE_NAME,
- {def2lower, def2upper, se_nw2unix, se_unix2nw, 0}
- },
- {NCP_NLS_DE, NCP_NLS_DE_NAME,
- {def2lower, def2upper, de_nw2unix, de_unix2nw, 0}
- },
- {0}
-};
-
-struct ncp_nlstables ncp_nls;
-
-int
-ncp_nls_setlocale(char *name) {
- int i;
-
- ncp_nls.to_lower = def2lower;
- ncp_nls.to_upper = def2upper;
- if (setlocale(LC_CTYPE, name) == NULL) {
- fprintf(stderr, "Can't set locale '%s'\n", name);
- return EINVAL;
- }
- for (i = 0; i < 256; i++) {
- ncp_nls.to_lower[i] = tolower(i);
- ncp_nls.to_upper[i] = toupper(i);
- }
- return 0;
-}
-
-int
-ncp_nls_setrecode(int scheme) {
- struct ncp_nlsdesc *nd;
-
- if (scheme == 0) {
-#if NCP_NLS_DEFAULT
- scheme = NCP_NLS_DEFAULT;
-#else
- scheme = NCP_NLS_AS_IS;
-#endif
- }
- for (nd = ncp_nlslist; nd->name; nd++) {
- if (nd->scheme != scheme) continue;
- ncp_nls.u2n = nd->nls.u2n;
- ncp_nls.n2u = nd->nls.n2u;
- return ncp_nls_setlocale("");
- }
- fprintf(stderr, "Character conversion scheme %d was not compiled in\n", scheme);
- return EINVAL;
-}
-
-int
-ncp_nls_setrecodebyname(char *name) {
- struct ncp_nlsdesc *nd;
-
- for (nd = ncp_nlslist; nd->name; nd++) {
- if (strcmp(nd->name, name) != 0) continue;
- ncp_nls.u2n = nd->nls.u2n;
- ncp_nls.n2u = nd->nls.n2u;
- return 0;
- }
- fprintf(stderr, "Character conversion scheme %s was not compiled in\n", name);
- return EINVAL;
-}
-
-char *
-ncp_nls_str_n2u(char *dst, const char *src) {
- char *p;
-
- if (ncp_nls.n2u == NULL) {
- return strcpy(dst, src);
- }
- p = dst;
- while (*src)
- *p++ = ncp_nls.n2u[(u_char)*(src++)];
- *p = 0;
- return dst;
-}
-
-char *
-ncp_nls_str_u2n(char *dst, const char *src) {
- char *p;
-
- if (ncp_nls.u2n == NULL) {
- return strcpy(dst, src);
- }
- p = dst;
- while (*src)
- *p++ = ncp_nls.u2n[(u_char)*(src++)];
- *p = 0;
- return dst;
-}
-
-char *
-ncp_nls_mem_n2u(char *dst, const char *src, int size) {
- char *p;
-
- if (size == 0) return NULL;
- if (ncp_nls.n2u == NULL) {
- return memcpy(dst, src, size);
- }
- for(p = dst; size; size--, p++)
- *p = ncp_nls.n2u[(u_char)*(src++)];
- return dst;
-}
-
-char *
-ncp_nls_mem_u2n(char *dst, const char *src, int size) {
- char *p;
-
- if (size == 0) return NULL;
- if (ncp_nls.u2n == NULL) {
- return strcpy(dst, src);
- }
- for(p = dst; size; size--, p++)
- *p = ncp_nls.u2n[(u_char)*(src++)];
- return dst;
-}
-
-char *
-ncp_str_upper(char *s) {
- char *p = s;
- while (*s) {
- *s = toupper(*s);
- s++;
- }
- return p;
-}
diff --git a/lib/libncp/ncpl_queue.c b/lib/libncp/ncpl_queue.c
deleted file mode 100644
index 0512ce9..0000000
--- a/lib/libncp/ncpl_queue.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * NetWare queue interface
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <netncp/ncp_lib.h>
-
-int
-ncp_create_queue_job_and_file(NWCONN_HANDLE connid, u_int32_t queue_id,
- struct queue_job *job)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 121);
- ncp_add_dword_hl(conn, queue_id);
- ncp_add_mem(conn, &(job->j), sizeof(job->j));
-
- if ((error = ncp_request(connid, 23, conn)) != 0)
- return error;
- memcpy(&(job->j), ncp_reply_data(conn, 0), 78);
- ConvertToNWfromDWORD(job->j.JobFileHandle, &job->file_handle);
- return 0;
-}
-
-int
-ncp_close_file_and_start_job(NWCONN_HANDLE connid, u_int32_t queue_id,
- struct queue_job *job)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 127);
- ncp_add_dword_hl(conn, queue_id);
- ncp_add_dword_lh(conn, job->j.JobNumber);
- error = ncp_request(connid, 23, conn);
- return error;
-}
-
-int
-ncp_attach_to_queue(NWCONN_HANDLE connid, u_int32_t queue_id) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 111);
- ncp_add_dword_hl(conn, queue_id);
- error = ncp_request(connid, 23, conn);
- return error;
-}
-
-int
-ncp_detach_from_queue(NWCONN_HANDLE connid, u_int32_t queue_id) {
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 112);
- ncp_add_dword_hl(conn, queue_id);
- error= ncp_request(connid, 23, conn);
- return error;
-}
-
-int
-ncp_service_queue_job(NWCONN_HANDLE connid, u_int32_t queue_id,
- u_int16_t job_type, struct queue_job *job)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 124);
- ncp_add_dword_hl(conn, queue_id);
- ncp_add_word_hl(conn, job_type);
- if ((error = ncp_request(connid, 23, conn)) != 0) {
- return error;
- }
- memcpy(&(job->j), ncp_reply_data(conn, 0), 78);
- ConvertToNWfromDWORD(job->j.JobFileHandle, &job->file_handle);
- return error;
-}
-
-int
-ncp_finish_servicing_job(NWCONN_HANDLE connid, u_int32_t queue_id,
- u_int32_t job_number, u_int32_t charge_info)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 131);
- ncp_add_dword_hl(conn, queue_id);
- ncp_add_dword_lh(conn, job_number);
- ncp_add_dword_hl(conn, charge_info);
-
- error = ncp_request(connid, 23, conn);
- return error;
-}
-
-int
-ncp_abort_servicing_job(NWCONN_HANDLE connid, u_int32_t queue_id,
- u_int32_t job_number)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 132);
- ncp_add_dword_hl(conn, queue_id);
- ncp_add_dword_lh(conn, job_number);
- error = ncp_request(connid, 23, conn);
- return error;
-}
-
-int
-ncp_get_queue_length(NWCONN_HANDLE connid, u_int32_t queue_id,
- u_int32_t *queue_length)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn, 125);
- ncp_add_dword_hl(conn, queue_id);
-
- if ((error = ncp_request(connid, 23, conn)) != 0)
- return error;
- if (conn->rpsize < 12) {
- ncp_printf("ncp_reply_size %d < 12\n", conn->rpsize);
- return EINVAL;
- }
- if (ncp_reply_dword_hl(conn,0) != queue_id) {
- printf("Ouch! Server didn't reply with same queue id in ncp_get_queue_length!\n");
- return EINVAL;
- }
- *queue_length = ncp_reply_dword_lh(conn,8);
- return error;
-}
-
-int
-ncp_get_queue_job_ids(NWCONN_HANDLE connid, u_int32_t queue_id,
- u_int32_t queue_section, u_int32_t *length1, u_int32_t *length2,
- u_int32_t ids[])
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn,129);
- ncp_add_dword_hl(conn, queue_id);
- ncp_add_dword_lh(conn, queue_section);
-
- if ((error = ncp_request(connid, 23, conn)) != 0)
- return error;
- if (conn->rpsize < 8) {
- ncp_printf("ncp_reply_size %d < 8\n", conn->rpsize);
- return EINVAL;
- }
- *length2 = ncp_reply_dword_lh(conn,4);
- if (conn->rpsize < 8 + 4*(*length2)) {
- ncp_printf("ncp_reply_size %d < %d\n", conn->rpsize, 8+4*(*length2));
- return EINVAL;
- }
- if (ids) {
- int count = min(*length1, *length2)*sizeof(u_int32_t);
- int pos;
-
- for (pos=0; pos<count; pos+=sizeof(u_int32_t)) {
- *ids++ = ncp_reply_dword_lh(conn, 8+pos);
- }
- }
- *length1 = ncp_reply_dword_lh(conn,0);
- return error;
-}
-
-int
-ncp_get_queue_job_info(NWCONN_HANDLE connid, u_int32_t queue_id,
- u_int32_t job_id, struct nw_queue_job_entry *jobdata)
-{
- int error;
- DECLARE_RQ;
-
- ncp_init_request_s(conn,122);
- ncp_add_dword_hl(conn, queue_id);
- ncp_add_dword_lh(conn, job_id);
-
- if ((error = ncp_request(connid, 23, conn)) != 0)
- return error;
-
- if (conn->rpsize < sizeof(struct nw_queue_job_entry)) {
- ncp_printf("ncp_reply_size %d < %d\n", conn->rpsize,sizeof(struct nw_queue_job_entry));
- return EINVAL;
- }
- memcpy(jobdata,ncp_reply_data(conn,0), sizeof(struct nw_queue_job_entry));
- return error;
-}
diff --git a/lib/libncp/ncpl_rcfile.c b/lib/libncp/ncpl_rcfile.c
deleted file mode 100644
index deb16c7..0000000
--- a/lib/libncp/ncpl_rcfile.c
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/queue.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <pwd.h>
-#include <unistd.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_rcfile.h>
-#include <netncp/ncp_cfg.h>
-
-#define NWFS_CFG_FILE NCP_PREFIX"/etc/nwfs.conf"
-
-struct rcfile *ncp_rc = NULL;
-
-SLIST_HEAD(rcfile_head, rcfile);
-static struct rcfile_head pf_head = {NULL};
-
-int rc_merge(char *filename,struct rcfile **rcfile);
-static struct rcfile* rc_find(char *filename);
-static struct rcsection *rc_findsect(struct rcfile *rcp, char *sectname);
-static struct rcsection *rc_addsect(struct rcfile *rcp, char *sectname);
-static int rc_sect_free(struct rcsection *rsp);
-static struct rckey *rc_sect_findkey(struct rcsection *rsp, char *keyname);
-static struct rckey *rc_sect_addkey(struct rcsection *rsp, char *name, char *value);
-static void rc_key_free(struct rckey *p);
-static void rc_parse(struct rcfile *rcp);
-
-
-/*
- * open rcfile and load its content, if already open - return previous handle
- */
-int
-rc_open(char *filename,char *mode,struct rcfile **rcfile) {
- struct rcfile *rcp;
- FILE *f;
-
- rcp = rc_find(filename);
- if( rcp ) {
- *rcfile = rcp;
- return 0;
- }
- f = fopen (filename, mode);
- if (f==NULL)
- return errno;
- rcp = malloc(sizeof(struct rcfile));
- if (rcp==NULL) {
- fclose(f);
- return ENOMEM;
- }
- bzero(rcp, sizeof(struct rcfile));
- rcp->rf_name = strdup (filename);
- rcp->rf_f = f;
- SLIST_INSERT_HEAD(&pf_head, rcp, rf_next);
- rc_parse(rcp);
- *rcfile = rcp;
- return 0;
-}
-
-int
-rc_merge(char *filename,struct rcfile **rcfile) {
- struct rcfile *rcp = *rcfile;
- FILE *f, *t;
-
- if (rcp == NULL) {
- return rc_open(filename,"r",rcfile);
- }
- f = fopen (filename, "r");
- if (f==NULL)
- return errno;
- t = rcp->rf_f;
- rcp->rf_f = f;
- rc_parse(rcp);
- rcp->rf_f = t;
- fclose(f);
- return 0;
-}
-
-int
-rc_close(struct rcfile *rcp) {
- struct rcsection *p,*n;
-
- fclose(rcp->rf_f);
- for(p = SLIST_FIRST(&rcp->rf_sect);p;) {
- n = p;
- p = SLIST_NEXT(p,rs_next);
- rc_sect_free(n);
- }
- free(rcp->rf_name);
- SLIST_REMOVE(&pf_head, rcp, rcfile, rf_next);
- free(rcp);
- return 0;
-}
-
-static struct rcfile*
-rc_find(char *filename) {
- struct rcfile *p;
-
- SLIST_FOREACH(p, &pf_head, rf_next)
- if (strcmp (filename, p->rf_name)==0)
- return p;
- return 0;
-}
-
-static struct rcsection *
-rc_findsect(struct rcfile *rcp, char *sectname) {
- struct rcsection *p;
-
- SLIST_FOREACH(p, &rcp->rf_sect, rs_next)
- if (strcmp(p->rs_name, sectname)==0)
- return p;
- return NULL;
-}
-
-static struct rcsection *
-rc_addsect(struct rcfile *rcp, char *sectname) {
- struct rcsection *p;
-
- p = rc_findsect(rcp, sectname);
- if (p) return p;
- p = malloc(sizeof(*p));
- if (!p) return NULL;
- p->rs_name = strdup(sectname);
- SLIST_INIT(&p->rs_keys);
- SLIST_INSERT_HEAD(&rcp->rf_sect, p, rs_next);
- return p;
-}
-
-static int
-rc_sect_free(struct rcsection *rsp) {
- struct rckey *p,*n;
-
- for(p = SLIST_FIRST(&rsp->rs_keys);p;) {
- n = p;
- p = SLIST_NEXT(p,rk_next);
- rc_key_free(n);
- }
- free(rsp->rs_name);
- free(rsp);
- return 0;
-}
-
-static struct rckey *
-rc_sect_findkey(struct rcsection *rsp, char *keyname) {
- struct rckey *p;
-
- SLIST_FOREACH(p, &rsp->rs_keys, rk_next)
- if (strcmp(p->rk_name, keyname)==0)
- return p;
- return NULL;
-}
-
-static struct rckey *
-rc_sect_addkey(struct rcsection *rsp, char *name, char *value) {
- struct rckey *p;
-
- p = rc_sect_findkey(rsp, name);
- if (p) {
- free(p->rk_value);
- } else {
- p = malloc(sizeof(*p));
- if (!p) return NULL;
- SLIST_INSERT_HEAD(&rsp->rs_keys, p, rk_next);
- p->rk_name = strdup(name);
- }
- p->rk_value = value ? strdup(value) : strdup("");
- return p;
-}
-
-void
-rc_sect_delkey(struct rcsection *rsp, struct rckey *p) {
-
- SLIST_REMOVE(&rsp->rs_keys,p,rckey,rk_next);
- rc_key_free(p);
- return;
-}
-
-static void
-rc_key_free(struct rckey *p){
- free(p->rk_value);
- free(p->rk_name);
- free(p);
-}
-
-enum { stNewLine, stHeader, stSkipToEOL, stGetKey, stGetValue};
-
-static void
-rc_parse(struct rcfile *rcp) {
- FILE *f = rcp->rf_f;
- int state = stNewLine, c;
- struct rcsection *rsp = NULL;
- struct rckey *rkp = NULL;
- char buf[2048];
- char *next = buf, *last = &buf[sizeof(buf)-1];
-
- while ((c = getc (f)) != EOF) {
- if (c == '\r')
- continue;
- if (state == stNewLine) {
- next = buf;
- if (isspace(c))
- continue; /* skip leading junk */
- if (c == '[') {
- state = stHeader;
- rsp = NULL;
- continue;
- }
- if (c == '#' || c == ';') {
- state = stSkipToEOL;
- } else { /* something meaningfull */
- state = stGetKey;
- }
- }
- if (state == stSkipToEOL || next == last) {/* ignore long lines */
- if (c == '\n'){
- state = stNewLine;
- next = buf;
- }
- continue;
- }
- if (state == stHeader) {
- if (c == ']') {
- *next = 0;
- next = buf;
- rsp = rc_addsect(rcp, buf);
- state = stSkipToEOL;
- } else
- *next++ = c;
- continue;
- }
- if (state == stGetKey) {
- if (c == ' ' || c == '\t')/* side effect: 'key name='*/
- continue; /* become 'keyname=' */
- if (c == '\n') { /* silently ignore ... */
- state = stNewLine;
- continue;
- }
- if (c != '=') {
- *next++ = c;
- continue;
- }
- *next = 0;
- if (rsp == NULL) {
- fprintf(stderr, "Key '%s' defined before section\n", buf);
- state = stSkipToEOL;
- continue;
- }
- rkp = rc_sect_addkey(rsp, buf, NULL);
- next = buf;
- state = stGetValue;
- continue;
- }
- /* only stGetValue left */
- if (state != stGetValue) {
- fprintf(stderr, "Well, I can't parse file '%s'\n",rcp->rf_name);
- state = stSkipToEOL;
- }
- if (c != '\n') {
- *next++ = c;
- continue;
- }
- *next = 0;
- rkp->rk_value = strdup(buf);
- state = stNewLine;
- rkp = NULL;
- } /* while */
- if (c == EOF && state == stGetValue) {
- *next = 0;
- rkp->rk_value = strdup(buf);
- }
- return;
-}
-
-int
-rc_getstringptr(struct rcfile *rcp,char *section, char *key,char **dest) {
- struct rcsection *rsp;
- struct rckey *rkp;
-
- *dest = NULL;
- rsp = rc_findsect(rcp, section);
- if (!rsp) return ENOENT;
- rkp = rc_sect_findkey(rsp,key);
- if (!rkp) return ENOENT;
- *dest = rkp->rk_value;
- return 0;
-}
-
-int
-rc_getstring(struct rcfile *rcp,char *section, char *key,int maxlen,char *dest) {
- char *value;
- int error;
-
- error = rc_getstringptr(rcp, section, key, &value);
- if (error) return error;
- if (strlen(value) >= maxlen) {
- fprintf(stderr, "line too long for key '%s' in section '%s', max = %d\n",key, section, maxlen);
- return EINVAL;
- }
- strcpy(dest,value);
- return 0;
-}
-
-int
-rc_getint(struct rcfile *rcp,char *section, char *key,int *value) {
- struct rcsection *rsp;
- struct rckey *rkp;
-
- rsp = rc_findsect(rcp, section);
- if (!rsp) return ENOENT;
- rkp = rc_sect_findkey(rsp,key);
- if (!rkp) return ENOENT;
- errno = 0;
- *value = strtol(rkp->rk_value,NULL,0);
- if (errno) {
- fprintf(stderr, "invalid int value '%s' for key '%s' in section '%s'\n",rkp->rk_value,key,section);
- return errno;
- }
- return 0;
-}
-
-/*
- * 1,yes,true
- * 0,no,false
- */
-int
-rc_getbool(struct rcfile *rcp,char *section, char *key,int *value) {
- struct rcsection *rsp;
- struct rckey *rkp;
- char *p;
-
- rsp = rc_findsect(rcp, section);
- if (!rsp) return ENOENT;
- rkp = rc_sect_findkey(rsp,key);
- if (!rkp) return ENOENT;
- p = rkp->rk_value;
- while (*p && isspace(*p)) p++;
- if (*p == '0' || strcasecmp(p,"no") == 0 || strcasecmp(p,"false") == 0) {
- *value = 0;
- return 0;
- }
- if (*p == '1' || strcasecmp(p,"yes") == 0 || strcasecmp(p,"true") == 0) {
- *value = 1;
- return 0;
- }
- fprintf(stderr, "invalid boolean value '%s' for key '%s' in section '%s' \n",p, key, section);
- return EINVAL;
-}
-
-/*
- * first read ~/.nwfsrc, next try to merge NWFS_CFG_FILE
- */
-int
-ncp_open_rcfile(void) {
- char *home, *fn;
- int error;
-
- home = getenv("HOME");
- if (home) {
- fn = malloc(strlen(home) + 20);
- sprintf(fn, "%s/.nwfsrc", home);
- error = rc_open(fn,"r",&ncp_rc);
- free (fn);
- }
- error = rc_merge(NWFS_CFG_FILE, &ncp_rc);
- if( ncp_rc == NULL ) {
- printf("Warning: no cfg files found.\n");
- return 1;
- }
- return 0;
-}
-
diff --git a/lib/libncp/ncpl_rpc.c b/lib/libncp/ncpl_rpc.c
deleted file mode 100644
index 87c601a..0000000
--- a/lib/libncp/ncpl_rpc.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * NetWare RPCs
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <netncp/ncp_lib.h>
-
-struct ncp_rpc_rq {
- nuint16 len; /* HL */
- nuint8 subfn;
- nuint32 reserved[4];
- nuint8 flags[4];
-} __attribute__ ((packed));
-
-struct ncp_rpc_rp {
- nuint32 rpccode;
- nuint32 reserved[4];
- nuint32 rpcval;
-} __attribute__ ((packed));
-
-static NWCCODE
-ncp_rpc(NWCONN_HANDLE cH, int rpcfn,
- const nuint8* rpcarg, char* arg1, char *arg2,
- nuint32* rpcval) {
- NWCCODE error;
- NW_FRAGMENT rq[4], rp;
- struct ncp_rpc_rq rqh;
- struct ncp_rpc_rp rph;
-
- rqh.subfn = rpcfn;
- if (rpcarg)
- bcopy(rpcarg, rqh.reserved, 4 * 4 + 4);
- else
- bzero(rqh.reserved, 4 * 4 + 4);
- rq[0].fragAddress = (char*)&rqh;
- rq[0].fragSize = sizeof(rqh);
- rq[1].fragAddress = arg1;
- rq[1].fragSize = strlen(arg1) + 1;
- rq[2].fragAddress = arg2;
- rq[2].fragSize = arg2 ? (strlen(arg2) + 1) : 0;
- rqh.len = htons(rq[2].fragSize + rq[1].fragSize + sizeof(rqh) - 2);
- rp.fragAddress = (char*)&rph;
- rp.fragSize = sizeof(rph);
- error = NWRequest(cH, 131, 3, rq, 1, &rp);
- if (error) return error;
- if (rp.fragSize < 4) return EBADRPC;
- error = rph.rpccode;
- if (error) return error;
- if (rpcval) {
- if (rp.fragSize < 24)
- return EBADRPC;
- *rpcval = rph.rpcval;
- }
- return 0;
-}
-
-NWCCODE
-NWSMLoadNLM(NWCONN_HANDLE cH, pnstr8 cmd) {
- return ncp_rpc(cH, 1, NULL, cmd, NULL, NULL);
-}
-
-NWCCODE
-NWSMUnloadNLM(NWCONN_HANDLE cH, pnstr8 cmd) {
- return ncp_rpc(cH, 2, NULL, cmd, NULL, NULL);
-}
-
-NWCCODE
-NWSMMountVolume(NWCONN_HANDLE cH, pnstr8 volName, nuint32* volnum) {
- return ncp_rpc(cH, 3, NULL, volName, NULL, volnum);
-}
-
-NWCCODE
-NWSMDismountVolumeByName(NWCONN_HANDLE cH, pnstr8 vol) {
- return ncp_rpc(cH, 4, NULL, vol, NULL, NULL);
-}
-
-struct ncp_set_hdr {
- nuint32 typeFlag; /* 0 - str, 1 - value */
- nuint32 value;
- nuint32 pad[20 - 4 - 4];
-} __attribute__ ((packed));
-
-NWCCODE
-NWSMSetDynamicCmdIntValue(NWCONN_HANDLE cH, pnstr8 setCommandName, nuint32 cmdValue) {
- struct ncp_set_hdr rq;
-
- memset(&rq, 0, sizeof(rq));
- rq.typeFlag = 1;
- rq.value = cmdValue;
- return ncp_rpc(cH, 6, (char*)&rq, setCommandName, NULL, NULL);
-}
-
-NWCCODE
-NWSMSetDynamicCmdStrValue(NWCONN_HANDLE cH, pnstr8 setCommandName,
- pnstr8 cmdValue) {
- return ncp_rpc(cH, 6, NULL, setCommandName, cmdValue, NULL);
-}
-
-NWCCODE
-NWSMExecuteNCFFile(NWCONN_HANDLE cH, pnstr8 NCFFileName) {
- return ncp_rpc(cH, 7, NULL, NCFFileName, NULL, NULL);
-}
diff --git a/lib/libncp/ncpl_subr.c b/lib/libncp/ncpl_subr.c
deleted file mode 100644
index 3c328ce..0000000
--- a/lib/libncp/ncpl_subr.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/errno.h>
-#include <sys/sysctl.h>
-#include <sys/ioctl.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <paths.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_rcfile.h>
-#include <netncp/ncp_nls.h>
-/*#include <netncp/ncp_cfg.h>*/
-#include <netncp/ncpio.h>
-
-#define _PATH_NCP _PATH_DEV NCP_NAME
-
-void
-ncp_add_word_lh(struct ncp_buf *conn, u_int16_t x) {
- setwle(conn->packet, conn->rqsize, x);
- conn->rqsize += 2;
- return;
-}
-
-void
-ncp_add_dword_lh(struct ncp_buf *conn, u_int32_t x) {
- setdle(conn->packet, conn->rqsize, x);
- conn->rqsize += 4;
- return;
-}
-
-void
-ncp_add_word_hl(struct ncp_buf *conn, u_int16_t x){
- setwbe(conn->packet, conn->rqsize, x);
- conn->rqsize += 2;
- return;
-}
-
-void
-ncp_add_dword_hl(struct ncp_buf *conn, u_int32_t x) {
- setdbe(conn->packet, conn->rqsize, x);
- conn->rqsize += 4;
- return;
-}
-
-void
-ncp_add_mem(struct ncp_buf *conn, const void *source, int size) {
- memcpy(conn->packet+conn->rqsize, source, size);
- conn->rqsize += size;
- return;
-}
-
-void
-ncp_add_mem_nls(struct ncp_buf *conn, const void *source, int size) {
- ncp_nls_mem_u2n(conn->packet+conn->rqsize, source, size);
- conn->rqsize += size;
- return;
-}
-
-void
-ncp_add_pstring(struct ncp_buf *conn, const char *s) {
- int len = strlen(s);
- if (len > 255) {
- ncp_printf("ncp_add_pstring: string too long: %s\n", s);
- len = 255;
- }
- ncp_add_byte(conn, len);
- ncp_add_mem(conn, s, len);
- return;
-}
-
-void
-ncp_add_handle_path(struct ncp_buf *conn, nuint32 volNumber, nuint32 dirNumber,
- int handleFlag, const char *path)
-{
- ncp_add_byte(conn, volNumber);
- ncp_add_dword_lh(conn, dirNumber);
- ncp_add_byte(conn, handleFlag);
- if (path) {
- ncp_add_byte(conn, 1); /* 1 component */
- ncp_add_pstring(conn, path);
- } else {
- ncp_add_byte(conn, 0);
- }
-}
-
-void
-ncp_init_request(struct ncp_buf *conn) {
- conn->rqsize = 0;
- conn->rpsize = 0;
-}
-
-void
-ncp_init_request_s(struct ncp_buf *conn, int subfn) {
- ncp_init_request(conn);
- ncp_add_word_lh(conn, 0);
- ncp_add_byte(conn, subfn);
-}
-
-u_int16_t
-ncp_reply_word_hl(struct ncp_buf *conn, int offset) {
- return getwbe(ncp_reply_data(conn, offset), 0);
-}
-
-u_int16_t
-ncp_reply_word_lh(struct ncp_buf *conn, int offset) {
- return getwle(ncp_reply_data(conn, offset), 0);
-}
-
-u_int32_t
-ncp_reply_dword_hl(struct ncp_buf *conn, int offset) {
- return getdbe(ncp_reply_data(conn, offset), 0);
-}
-
-u_int32_t
-ncp_reply_dword_lh(struct ncp_buf *conn, int offset) {
- return getdle(ncp_reply_data(conn, offset), 0);
-}
-
-
-int
-ncp_connect(struct ncp_conn_args *li, int *connHandle) {
- struct ncpioc_connect args;
- int fd, r;
- if ((fd = open(_PATH_NCP, O_RDWR)) < 0)
- return (errno);
- args.ioc_li = li;
- args.ioc_connhandle = connHandle;
- errno = 0;
- (void)ioctl(fd, NCPIOC_CONNECT, &args);
- r = errno;
- close(fd);
- return (r);
-}
-
-int
-ncp_disconnect(int cH) {
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_CONNCLOSE);
- return ncp_conn_request(cH, conn);
-}
-
-int
-ncp_request(int connHandle,int function, struct ncp_buf *ncpbuf){
- struct ncpioc_request args;
- int fd, r;
- if ((fd = open(_PATH_NCP, O_RDWR)) < 0)
- return (errno);
- args.ioc_connhandle = connHandle;
- args.ioc_fn = function;
- args.ioc_ncpbuf = ncpbuf;
- errno = 0;
- (void)ioctl(fd, NCPIOC_REQUEST, &args);
- r = errno;
- close(fd);
- return (r);
-}
-
-int
-ncp_conn_request(int connHandle, struct ncp_buf *ncpbuf){
- return (ncp_request(connHandle, NCP_CONN, ncpbuf));
-}
-
-int
-ncp_conn_scan(struct ncp_conn_loginfo *li, int *connid) {
- struct ncpioc_connscan args;
- int fd, r;
- if ((fd = open(_PATH_NCP, O_RDWR)) < 0)
- return (errno);
- args.ioc_li = li;
- args.ioc_connhandle = connid;
- errno = 0;
- (void)ioctl(fd, NCPIOC_CONNSCAN, &args);
- r = errno;
- close(fd);
- return (r);
-}
-
-NWCCODE
-NWRequest(NWCONN_HANDLE cH, nuint16 fn,
- nuint16 nrq, NW_FRAGMENT* rq,
- nuint16 nrp, NW_FRAGMENT* rp)
-{
- int error;
- struct ncp_conn_frag nf;
- DECLARE_RQ;
-
- ncp_init_request(conn);
- ncp_add_byte(conn, NCP_CONN_FRAG);
- nf.fn = fn;
- nf.rqfcnt = nrq;
- nf.rqf = rq;
- nf.rpf = rp;
- nf.rpfcnt = nrp;
- ncp_add_mem(conn, &nf, sizeof(nf));
- error = ncp_conn_request(cH, conn);
- return error;
-}
-
-
-int
-ncp_initlib(void){
- int error;
- int kv;
- size_t kvlen = sizeof(kv);
- static int ncp_initialized;
-
- if (ncp_initialized)
- return 0;
- error = sysctlbyname("net.ncp.version", &kv, &kvlen, NULL, 0);
- if (error) {
- if (errno == ENOENT)
- fprintf(stderr, "Kernel module ncp is not loaded.\n");
- else
- fprintf(stderr, "%s: kernel module is old, please recompile it.\n", __func__);
- return error;
- }
- if (NCP_VERSION != kv) {
- fprintf(stderr, "%s: kernel module version(%d) don't match library(%d).\n", __func__, kv, NCP_VERSION);
- return EINVAL;
- }
- if ((error = ncp_nls_setrecode(0)) != 0) {
- fprintf(stderr, "%s: can't initialise recode\n", __func__);
- return error;
- }
- if ((error = ncp_nls_setlocale("")) != 0) {
- fprintf(stderr, "%s: can't initialise locale\n", __func__);
- return error;
- }
- ncp_initialized++;
- return 0;
-}
-
-
-/*
- */
-int ncp_opterr = 1, /* if error message should be printed */
- ncp_optind = 1, /* index into parent argv vector */
- ncp_optopt, /* character checked for validity */
- ncp_optreset; /* reset getopt */
-char *ncp_optarg; /* argument associated with option */
-
-#define BADCH (int)'?'
-#define BADARG (int)':'
-#define EMSG ""
-
-int
-ncp_getopt(nargc, nargv, ostr)
- int nargc;
- char * const *nargv;
- const char *ostr;
-{
- static char *place = EMSG; /* option letter processing */
- char *oli; /* option letter list index */
- int tmpind;
-
- if (ncp_optreset || !*place) { /* update scanning pointer */
- ncp_optreset = 0;
- tmpind = ncp_optind;
- while (1) {
- if (tmpind >= nargc) {
- place = EMSG;
- return (-1);
- }
- if (*(place = nargv[tmpind]) != '-') {
- tmpind++;
- continue; /* lookup next option */
- }
- if (place[1] && *++place == '-') { /* found "--" */
- ncp_optind = ++tmpind;
- place = EMSG;
- return (-1);
- }
- ncp_optind = tmpind;
- break;
- }
- } /* option letter okay? */
- if ((ncp_optopt = (int)*place++) == (int)':' ||
- !(oli = strchr(ostr, ncp_optopt))) {
- /*
- * if the user didn't specify '-' as an option,
- * assume it means -1.
- */
- if (ncp_optopt == (int)'-')
- return (-1);
- if (!*place)
- ++ncp_optind;
- if (ncp_opterr && *ostr != ':')
- (void)fprintf(stderr,
- "%s: illegal option -- %c\n", _getprogname(), ncp_optopt);
- return (BADCH);
- }
- if (*++oli != ':') { /* don't need argument */
- ncp_optarg = NULL;
- if (!*place)
- ++ncp_optind;
- }
- else { /* need an argument */
- if (*place) /* no white space */
- ncp_optarg = place;
- else if (nargc <= ++ncp_optind) { /* no arg */
- place = EMSG;
- if (*ostr == ':')
- return (BADARG);
- if (ncp_opterr)
- (void)fprintf(stderr,
- "%s: option requires an argument -- %c\n",
- _getprogname(), ncp_optopt);
- return (BADCH);
- }
- else /* white space */
- ncp_optarg = nargv[ncp_optind];
- place = EMSG;
- ++ncp_optind;
- }
- return (ncp_optopt); /* dump back option letter */
-}
-/*
- * misc options parsing routines
- */
-int
-ncp_args_parserc(struct ncp_args *na, char *sect, ncp_setopt_t *set_callback) {
- int len, error;
-
- for (; na->opt; na++) {
- switch (na->at) {
- case NCA_STR:
- if (rc_getstringptr(ncp_rc,sect,na->name,&na->str) == 0) {
- len = strlen(na->str);
- if (len > na->ival) {
- fprintf(stderr,"rc: Argument for option '%c' (%s) too long\n",na->opt,na->name);
- return EINVAL;
- }
- set_callback(na);
- }
- break;
- case NCA_BOOL:
- error = rc_getbool(ncp_rc,sect,na->name,&na->ival);
- if (error == ENOENT) break;
- if (error) return EINVAL;
- set_callback(na);
- break;
- case NCA_INT:
- if (rc_getint(ncp_rc,sect,na->name,&na->ival) == 0) {
- if (((na->flag & NAFL_HAVEMIN) &&
- (na->ival < na->min)) ||
- ((na->flag & NAFL_HAVEMAX) &&
- (na->ival > na->max))) {
- fprintf(stderr,"rc: Argument for option '%c' (%s) should be in [%d-%d] range\n",na->opt,na->name,na->min,na->max);
- return EINVAL;
- }
- set_callback(na);
- };
- break;
- default:
- break;
- }
- }
- return 0;
-}
-
-int
-ncp_args_parseopt(struct ncp_args *na, int opt, char *optarg, ncp_setopt_t *set_callback) {
- int len;
-
- for (; na->opt; na++) {
- if (na->opt != opt) continue;
- switch (na->at) {
- case NCA_STR:
- na->str = optarg;
- if (optarg) {
- len = strlen(na->str);
- if (len > na->ival) {
- fprintf(stderr,"opt: Argument for option '%c' (%s) too long\n",na->opt,na->name);
- return EINVAL;
- }
- set_callback(na);
- }
- break;
- case NCA_BOOL:
- na->ival = 0;
- set_callback(na);
- break;
- case NCA_INT:
- errno = 0;
- na->ival = strtol(optarg, NULL, 0);
- if (errno) {
- fprintf(stderr,"opt: Invalid integer value for option '%c' (%s).\n",na->opt,na->name);
- return EINVAL;
- }
- if (((na->flag & NAFL_HAVEMIN) &&
- (na->ival < na->min)) ||
- ((na->flag & NAFL_HAVEMAX) &&
- (na->ival > na->max))) {
- fprintf(stderr,"opt: Argument for option '%c' (%s) should be in [%d-%d] range\n",na->opt,na->name,na->min,na->max);
- return EINVAL;
- }
- set_callback(na);
- break;
- default:
- break;
- }
- break;
- }
- return 0;
-}
-
-/*
- * Print a (descriptive) error message
- * error values:
- * 0 - no specific error code available;
- * -999..-1 - NDS error
- * 1..32767 - system error
- * the rest - requester error;
- */
-void
-ncp_error(const char *fmt, int error, ...) {
- va_list ap;
-
- fprintf(stderr, "%s: ", _getprogname());
- va_start(ap, error);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
- if (error == -1)
- error = errno;
- if (error > -1000 && error < 0) {
- fprintf(stderr, ": dserr = %d\n", error);
- } else if (error & 0x8000) {
- fprintf(stderr, ": nwerr = %04x\n", error);
- } else if (error) {
- fprintf(stderr, ": syserr = %s\n", strerror(error));
- } else
- fprintf(stderr, "\n");
-}
-
-char *
-ncp_printb(char *dest, int flags, const struct ncp_bitname *bnp) {
- int first = 1;
-
- strcpy(dest, "<");
- for(; bnp->bn_bit; bnp++) {
- if (flags & bnp->bn_bit) {
- strcat(dest, bnp->bn_name);
- first = 0;
- }
- if (!first && (flags & bnp[1].bn_bit))
- strcat(dest, "|");
- }
- strcat(dest, ">");
- return dest;
-}
diff --git a/lib/libncp/sap.c b/lib/libncp/sap.c
deleted file mode 100644
index c7f8da1..0000000
--- a/lib/libncp/sap.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <arpa/inet.h>
-#include <netipx/ipx.h>
-#include <errno.h>
-#include <unistd.h>
-#include "ipxsap.h"
-
-/*
- * TODO: These should go to ipx headers
- */
-#define ipx_set_net(x,y) ((x).x_net.s_net[0] = (y).x_net.s_net[0]); \
- ((x).x_net.s_net[1]=(y).x_net.s_net[1])
-#define ipx_set_nullnet(x) ((x).x_net.s_net[0]=0); ((x).x_net.s_net[1]=0)
-#define ipx_set_nullhost(x) ((x).x_host.s_host[0] = 0); \
- ((x).x_host.s_host[1] = 0); ((x).x_host.s_host[2] = 0)
-#define ipx_set_wildnet(x) ((x).x_net.s_net[0] = 0xFFFF); \
- ((x).x_net.s_net[1]=0xFFFF)
-#define ipx_set_wildhost(x) ((x).x_host.s_host[0] = 0xFFFF); \
- ((x).x_host.s_host[1] = 0xFFFF); ((x).x_host.s_host[2] = 0xFFFF);
-
-
-static struct sap_packet* sap_packet_alloc(int entries);
-static int sap_size(int entries, u_short operation);
-int (*sap_sendto_func)(void*,int,struct sockaddr_ipx*,int sock)=NULL;
-
-static int
-sap_sendto(void* buffer, int size, struct sockaddr_ipx* daddr, int sock)
-{
- if (sap_sendto_func)
- return sap_sendto_func(buffer,size,daddr,sock);
- return sendto(sock, (char*)buffer, size, 0,
- (struct sockaddr*)daddr, sizeof(*daddr));
-}
-
-static struct sap_packet*
-sap_packet_alloc(int entries)
-{
- if (entries > IPX_SAP_MAX_ENTRIES)
- return NULL;
- return
- (struct sap_packet*)malloc(sap_size(entries, IPX_SAP_GENERAL_RESPONSE));
-}
-
-static int
-sap_size(int entries, u_short operation)
-{
- if (entries <= 0)
- return 0;
- switch (operation) {
- case IPX_SAP_GENERAL_QUERY:
- return entries == 1 ? IPX_SAP_REQUEST_LEN : 0;
- case IPX_SAP_GENERAL_RESPONSE:
- if (entries > IPX_SAP_MAX_ENTRIES)
- return 0;
- return sizeof(struct sap_packet) + (entries - 1) * sizeof(struct sap_entry);
- case IPX_SAP_NEAREST_QUERY:
- return entries == 1 ? IPX_SAP_REQUEST_LEN : 0;
- case IPX_SAP_NEAREST_RESPONSE:
- return entries == 1 ? sizeof(struct sap_packet) : 0;
- default:
- return 0;
- }
-}
-
-void
-sap_copyname(char *dest, const char *src)
-{
- bzero(dest, IPX_SAP_SERVER_NAME_LEN);
- strncpy(dest, src, IPX_SAP_SERVER_NAME_LEN - 1);
-}
-
-int
-sap_rq_init(struct sap_rq* rq, int sock)
-{
- rq->buffer = sap_packet_alloc(IPX_SAP_MAX_ENTRIES);
- if (rq->buffer == NULL)
- return 0;
- rq->entries = 0;
- rq->buffer->operation = htons(IPX_SAP_GENERAL_QUERY);
- rq->dest_addr.sipx_family = AF_IPX;
- rq->dest_addr.sipx_len = sizeof(struct sockaddr_ipx);
- rq->sock = sock;
- return 1;
-}
-
-int
-sap_rq_flush(struct sap_rq* rq)
-{
- int result;
-
- if (rq->entries == 0)
- return 0;
- result = sap_sendto(rq->buffer,
- sap_size(rq->entries, ntohs(rq->buffer->operation)),
- &rq->dest_addr, rq->sock);
- rq->entries = 0;
- return result;
-}
-
-void
-sap_rq_general_query(struct sap_rq* rq, u_short ser_type)
-{
- struct sap_entry* sep;
-
- sap_rq_flush(rq);
- rq->buffer->operation = htons(IPX_SAP_GENERAL_QUERY);
- sep = rq->buffer->sap_entries + rq->entries++;
- sep->server_type = htons(ser_type);
-}
-
-void
-sap_rq_gns_request(struct sap_rq* rq, u_short ser_type)
-{
- struct sap_entry* sep;
-
- sap_rq_flush(rq);
- rq->buffer->operation = htons(IPX_SAP_NEAREST_QUERY);
- sep = rq->buffer->sap_entries + rq->entries++;
- sep->server_type = htons(ser_type);
-}
-
-void
-sap_rq_general_response(struct sap_rq* rq,u_short type,char *name,struct sockaddr_ipx* addr, u_short hops,int down_allow)
-{
- struct sap_entry* sep;
-
- if (hops >= IPX_SAP_SERVER_DOWN && !down_allow) return;
- if (rq->entries >= IPX_SAP_MAX_ENTRIES)
- sap_rq_flush(rq);
- if (rq->buffer->operation != htons(IPX_SAP_GENERAL_RESPONSE)){
- sap_rq_flush(rq);
- rq->buffer->operation = htons(IPX_SAP_GENERAL_RESPONSE);
- }
- sep = rq->buffer->sap_entries + rq->entries;
- sep->server_type = htons(type);
- sap_copyname(sep->server_name, name);
- memcpy(&sep->ipx, &addr->sipx_addr, sizeof(struct ipx_addr));
- sep->hops = htons(hops);
- rq->entries++;
-}
-
-void
-sap_rq_gns_response(struct sap_rq* rq,u_short type,char *name,struct sockaddr_ipx* addr,u_short hops)
-{
- struct sap_entry* sep;
-
- if (hops >= IPX_SAP_SERVER_DOWN) return;
- sap_rq_flush(rq);
- rq->buffer->operation = htons(IPX_SAP_NEAREST_RESPONSE);
- sep = rq->buffer->sap_entries + rq->entries;
- sep->server_type = htons(type);
- sap_copyname(sep->server_name, name);
- memcpy(&sep->ipx, &addr->sipx_addr, sizeof(struct ipx_addr));
- sep->hops = htons(hops);
- rq->entries++;
-}
-
-void
-sap_rq_set_destination(struct sap_rq* rq,struct ipx_addr *dest)
-{
- sap_rq_flush(rq);
- memcpy(&rq->dest_addr.sipx_addr,dest,sizeof(struct ipx_addr));
-}
-
-int
-sap_getsock(int *rsock) {
- struct sockaddr_ipx sap_addr;
- int opt, sock, slen;
-
- sock = socket(AF_IPX, SOCK_DGRAM, 0);
- if (sock < 0)
- return (errno);
- slen = sizeof(sap_addr);
- bzero(&sap_addr, slen);
- sap_addr.sipx_family = AF_IPX;
- sap_addr.sipx_len = slen;
- if (bind(sock, (struct sockaddr*)&sap_addr, slen) == -1) {
- close(sock);
- return(errno);
- }
- opt = 1;
- if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &opt, sizeof(opt)) != 0){
- close(sock);
- return(errno);
- }
- *rsock = sock;
- return(0);
-}
-
-static int
-sap_recv(int sock,void *buf,int len,int flags, int timeout){
- fd_set rd, wr, ex;
- struct timeval tv;
- int result;
-
- FD_ZERO(&rd);
- FD_ZERO(&wr);
- FD_ZERO(&ex);
- FD_SET(sock, &rd);
-
- tv.tv_sec = timeout;
- tv.tv_usec = 0;
-
- if ((result = select(sock + 1, &rd, &wr, &ex, &tv)) == -1) {
- return result;
- }
- if (FD_ISSET(sock, &rd)) {
- result = recv(sock, buf, len, flags);
- } else {
- errno = ETIMEDOUT;
- result = -1;
- }
- return result;
-}
-
-int
-sap_find_nearest(int server_type, struct sockaddr_ipx *daddr, char *server_name)
-{
- struct ipx_addr addr;
- char data[1024];
- int sock, error, packets, len;
- struct sap_packet *reply = (struct sap_packet*)&data;
- struct sap_rq sap_rq;
-
- error = sap_getsock(&sock);
- if (error)
- return error;
- bzero(&addr, sizeof(addr));
- /* BAD: we should enum all ifs (and nets ?) */
- if (ipx_iffind(NULL, &addr) != 0) {
- return (EPROTONOSUPPORT);
- }
- ipx_set_wildhost(addr);
- addr.x_port = htons(IPXPORT_SAP);
-
- if (!sap_rq_init(&sap_rq, sock)) {
- close(sock);
- return(ENOMEM);
- }
- sap_rq_set_destination(&sap_rq, &addr);
- sap_rq_gns_request(&sap_rq, server_type);
- sap_rq_flush(&sap_rq);
- packets = 5;
- do {
- len = sap_recv(sock, data, sizeof(data), 0, 1);
- if (len >= 66 &&
- ntohs(reply->operation) == IPX_SAP_NEAREST_RESPONSE)
- break;
- if (len < 0)
- packets--;
- } while (packets > 0);
-
- if (packets == 0) {
- close(sock);
- return ENETDOWN;
- }
-
- daddr->sipx_addr = reply->sap_entries[0].ipx;
- daddr->sipx_family = AF_IPX;
- daddr->sipx_len = sizeof(struct sockaddr_ipx);
- sap_copyname(server_name, reply->sap_entries[0].server_name);
- errno = 0;
- close(sock);
- return 0;
-}
diff --git a/lib/libnetgraph/msg.c b/lib/libnetgraph/msg.c
index 534d1d1..c946459 100644
--- a/lib/libnetgraph/msg.c
+++ b/lib/libnetgraph/msg.c
@@ -234,7 +234,7 @@ NgDeliverMsg(int cs, const char *path,
}
/* Wait for reply if there should be one. */
- if (msg->header.cmd & NGM_HASREPLY) {
+ if (msg->header.cmd & NGM_HASREPLY && !(msg->header.flags & NGF_RESP)) {
struct pollfd rfds;
int n;
diff --git a/lib/libprocstat/nwfs.c b/lib/libprocstat/nwfs.c
deleted file mode 100644
index 006f9aa..0000000
--- a/lib/libprocstat/nwfs.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * Copyright (c) 2005-2009 Stanislav Sedov <stas@FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/vnode.h>
-#define _KERNEL
-#include <sys/mount.h>
-#undef _KERNEL
-
-#include <netinet/in.h>
-
-#include <assert.h>
-#include <err.h>
-#include <kvm.h>
-#include <stdlib.h>
-
-#include <fs/nwfs/nwfs.h>
-#include <fs/nwfs/nwfs_node.h>
-
-#include "libprocstat.h"
-#include "common_kvm.h"
-
-int
-nwfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn)
-{
- struct mount mnt;
- struct nwnode node;
- int error;
-
- assert(kd);
- assert(vn);
- error = kvm_read_all(kd, (unsigned long)VTONW(vp), &node, sizeof(node));
- if (error != 0) {
- warnx("can't read nwfs fnode at %p", (void *)VTONW(vp));
- return (1);
- }
- error = kvm_read_all(kd, (unsigned long)getvnodemount(vp), &mnt,
- sizeof(mnt));
- if (error != 0) {
- warnx("can't read mount at %p for vnode %p",
- (void *)getvnodemount(vp), vp);
- return (1);
- }
- vn->vn_fileid = node.n_fid.f_id;
- if (vn->vn_fileid == 0)
- vn->vn_fileid = NWFS_ROOT_INO;
- vn->vn_fsid = mnt.mnt_stat.f_fsid.val[0];
- return (0);
-}
diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile
index 9c2c9b4..66dd795 100644
--- a/lib/libusb/Makefile
+++ b/lib/libusb/Makefile
@@ -37,6 +37,19 @@ SRCS+= libusb10_io.c
CFLAGS+= -DCOMPAT_32BIT
.endif
+#
+# Cross platform support
+#
+# Examples:
+# make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h
+# make COMPAT_32BIT=YES LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h
+#
+.if defined(LIBUSB_GLOBAL_INCLUDE_FILE)
+CFLAGS+= -DLIBUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\"
+CFLAGS+= -DUSB_GLOBAL_INCLUDE_FILE=\"${LIBUSB_GLOBAL_INCLUDE_FILE}\"
+CFLAGS+= -I ../../sys
+.endif
+
.include <bsd.lib.mk>
# LibUSB v1.0
diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h
index 1675f46..225b539 100644
--- a/lib/libusb/libusb.h
+++ b/lib/libusb/libusb.h
@@ -27,8 +27,11 @@
#ifndef __LIBUSB_H__
#define __LIBUSB_H__
+#ifndef LIBUSB_GLOBAL_INCLUDE_FILE
+#include <stdint.h>
#include <sys/time.h>
#include <sys/types.h>
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/lib/libusb/libusb01.c b/lib/libusb/libusb01.c
index 17edb0e..30a1430 100644
--- a/lib/libusb/libusb01.c
+++ b/lib/libusb/libusb01.c
@@ -28,11 +28,16 @@
* This file contains the emulation layer for LibUSB v0.1 from sourceforge.
*/
-#include <sys/queue.h>
-
+#ifdef LIBUSB_GLOBAL_INCLUDE_FILE
+#include LIBUSB_GLOBAL_INCLUDE_FILE
+#else
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <sys/queue.h>
+#endif
#include "libusb20.h"
#include "libusb20_desc.h"
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c
index 256d67e..0212296 100644
--- a/lib/libusb/libusb10.c
+++ b/lib/libusb/libusb10.c
@@ -25,17 +25,23 @@
* SUCH DAMAGE.
*/
-#include <sys/fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/queue.h>
-
+#ifdef LIBUSB_GLOBAL_INCLUDE_FILE
+#include LIBUSB_GLOBAL_INCLUDE_FILE
+#else
#include <assert.h>
#include <errno.h>
#include <poll.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
+#include <time.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/queue.h>
+#include <sys/endian.h>
+#endif
#define libusb_device_handle libusb20_device
@@ -1331,7 +1337,7 @@ failure:
/* make sure our event loop spins the done handler */
dummy = 0;
- write(dev->ctx->ctrl_pipe[1], &dummy, sizeof(dummy));
+ err = write(dev->ctx->ctrl_pipe[1], &dummy, sizeof(dummy));
}
/* The following function must be called unlocked */
diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h
index d2a2bd7..f1e5460 100644
--- a/lib/libusb/libusb10.h
+++ b/lib/libusb/libusb10.h
@@ -27,7 +27,9 @@
#ifndef __LIBUSB10_H__
#define __LIBUSB10_H__
+#ifndef LIBUSB_GLOBAL_INCLUDE_FILE
#include <sys/queue.h>
+#endif
#define GET_CONTEXT(ctx) (((ctx) == NULL) ? usbi_default_context : (ctx))
#define UNEXPORTED __attribute__((__visibility__("hidden")))
diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c
index 11e201f..d2f3f53 100644
--- a/lib/libusb/libusb10_desc.c
+++ b/lib/libusb/libusb10_desc.c
@@ -24,10 +24,15 @@
* SUCH DAMAGE.
*/
-#include <sys/queue.h>
-
+#ifdef LIBUSB_GLOBAL_INCLUDE_FILE
+#include LIBUSB_GLOBAL_INCLUDE_FILE
+#else
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <sys/queue.h>
+#endif
#define libusb_device_handle libusb20_device
diff --git a/lib/libusb/libusb10_io.c b/lib/libusb/libusb10_io.c
index 302fdb8..489ceb7 100644
--- a/lib/libusb/libusb10_io.c
+++ b/lib/libusb/libusb10_io.c
@@ -24,15 +24,20 @@
* SUCH DAMAGE.
*/
-#include <sys/queue.h>
-
+#ifdef LIBUSB_GLOBAL_INCLUDE_FILE
+#include LIBUSB_GLOBAL_INCLUDE_FILE
+#else
#include <errno.h>
#include <poll.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <sys/queue.h>
+#include <sys/endian.h>
+#endif
#define libusb_device_handle libusb20_device
diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c
index ce75511..644eda4 100644
--- a/lib/libusb/libusb20.c
+++ b/lib/libusb/libusb20.c
@@ -24,13 +24,17 @@
* SUCH DAMAGE.
*/
-#include <sys/queue.h>
-
+#ifdef LIBUSB_GLOBAL_INCLUDE_FILE
+#include LIBUSB_GLOBAL_INCLUDE_FILE
+#else
#include <ctype.h>
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
+#include <sys/queue.h>
+#endif
#include "libusb20.h"
#include "libusb20_desc.h"
diff --git a/lib/libusb/libusb20.h b/lib/libusb/libusb20.h
index 81928b1..4a57b49 100644
--- a/lib/libusb/libusb20.h
+++ b/lib/libusb/libusb20.h
@@ -29,13 +29,9 @@
#ifndef _LIBUSB20_H_
#define _LIBUSB20_H_
-#include <sys/endian.h>
-#include <sys/time.h>
-#include <sys/types.h>
-
+#ifndef LIBUSB_GLOBAL_INCLUDE_FILE
#include <stdint.h>
-#include <string.h>
-#include <time.h>
+#endif
#ifdef __cplusplus
extern "C" {
diff --git a/lib/libusb/libusb20_desc.c b/lib/libusb/libusb20_desc.c
index e2fa5b5..22077b6 100644
--- a/lib/libusb/libusb20_desc.c
+++ b/lib/libusb/libusb20_desc.c
@@ -24,11 +24,15 @@
* SUCH DAMAGE.
*/
-#include <sys/queue.h>
-
+#ifdef LIBUSB_GLOBAL_INCLUDE_FILE
+#include LIBUSB_GLOBAL_INCLUDE_FILE
+#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
+#include <sys/queue.h>
+#endif
#include "libusb20.h"
#include "libusb20_desc.h"
diff --git a/lib/libusb/libusb20_desc.h b/lib/libusb/libusb20_desc.h
index a069ee9..48e2715 100644
--- a/lib/libusb/libusb20_desc.h
+++ b/lib/libusb/libusb20_desc.h
@@ -45,6 +45,10 @@
#ifndef _LIBUSB20_DESC_H_
#define _LIBUSB20_DESC_H_
+#ifndef LIBUSB_GLOBAL_INCLUDE_FILE
+#include <stdint.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/lib/libusb/libusb20_ugen20.c b/lib/libusb/libusb20_ugen20.c
index bff8e02..0846eb4 100644
--- a/lib/libusb/libusb20_ugen20.c
+++ b/lib/libusb/libusb20_ugen20.c
@@ -24,24 +24,28 @@
* SUCH DAMAGE.
*/
-#include <sys/queue.h>
-#include <sys/types.h>
-
+#ifdef LIBUSB_GLOBAL_INCLUDE_FILE
+#include LIBUSB_GLOBAL_INCLUDE_FILE
+#else
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-
-#include "libusb20.h"
-#include "libusb20_desc.h"
-#include "libusb20_int.h"
+#include <time.h>
+#include <sys/queue.h>
+#include <sys/types.h>
+#endif
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usb_ioctl.h>
+#include "libusb20.h"
+#include "libusb20_desc.h"
+#include "libusb20_int.h"
+
static libusb20_init_backend_t ugen20_init_backend;
static libusb20_open_device_t ugen20_open_device;
static libusb20_close_device_t ugen20_close_device;
diff --git a/lib/libusb/libusb_global_linux.h b/lib/libusb/libusb_global_linux.h
new file mode 100644
index 0000000..cbdd2c6
--- /dev/null
+++ b/lib/libusb/libusb_global_linux.h
@@ -0,0 +1,69 @@
+/* $FreeBSD$ */
+/*-
+ * Copyright (c) 2013 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _LIBUSB_GLOBAL_LINUX_H_
+#define _LIBUSB_GLOBAL_LINUX_H_
+
+#define _XOPEN_SOURCE
+#define _BSD_SOURCE
+#define _POSIX_SOURCE
+#define _POSIX_C_SOURCE 200809
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <time.h>
+#include <unistd.h>
+#include <alloca.h>
+#include <string.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <pthread.h>
+#include <sys/queue.h>
+#include <sys/ioctl.h>
+#include <sys/poll.h>
+#include <sys/time.h>
+#include <dev/usb/usb_endian.h>
+#include <dev/usb/usb_freebsd.h>
+
+#ifndef __aligned
+#define __aligned(x) __attribute__((__aligned__(x)))
+#endif
+
+#ifndef __packed
+#define __packed __attribute__((__packed__))
+#endif
+
+#ifndef strlcpy
+#define strlcpy(d,s,len) do { \
+ strncpy(d,s,len); \
+ ((char *)d)[(len) - 1] = 0; \
+} while (0)
+#endif
+
+#endif /* _LIBUSB_GLOBAL_LINUX_H_ */
diff --git a/lib/libusb/usb.h b/lib/libusb/usb.h
index dc3959e..d7bbaa5 100644
--- a/lib/libusb/usb.h
+++ b/lib/libusb/usb.h
@@ -27,10 +27,11 @@
#ifndef _LIBUSB20_COMPAT_01_H_
#define _LIBUSB20_COMPAT_01_H_
+#ifndef LIBUSB_GLOBAL_INCLUDE_FILE
+#include <stdint.h>
#include <sys/param.h>
#include <sys/endian.h>
-
-#include <stdint.h>
+#endif
/* USB interface class codes */
diff --git a/lib/libutil/gr_util.c b/lib/libutil/gr_util.c
index 8df3999..6f74507 100644
--- a/lib/libutil/gr_util.c
+++ b/lib/libutil/gr_util.c
@@ -50,7 +50,7 @@ static char group_file[PATH_MAX];
static char tempname[PATH_MAX];
static int initialized;
static size_t grmemlen(const struct group *, const char *, int *);
-static struct group *grcopy(const struct group *gr, struct group *newgr, const char *, int ndx);
+static struct group *grcopy(const struct group *gr, char *mem, const char *, int ndx);
/*
* Initialize statics
@@ -361,26 +361,30 @@ gr_equal(const struct group *gr1, const struct group *gr2)
if (gr1->gr_gid != gr2->gr_gid)
return (false);
- /* Check all members in both groups. */
- if (gr1->gr_mem == NULL || gr2->gr_mem == NULL) {
- if (gr1->gr_mem != gr2->gr_mem)
- return (false);
- } else {
- for (gr1_ndx = 0; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++) {
- for (gr2_ndx = 0;; gr2_ndx++) {
- if (gr2->gr_mem[gr2_ndx] == NULL)
- return (false);
- if (strcmp(gr1->gr_mem[gr1_ndx],
- gr2->gr_mem[gr2_ndx]) == 0) {
- break;
- }
- }
+ /* Check all members in both groups.
+ * getgrnam can return gr_mem with a pointer to NULL.
+ * gr_dup and gr_add strip out this superfluous NULL, setting
+ * gr_mem to NULL for no members.
+ */
+ if (gr1->gr_mem != NULL && gr2->gr_mem != NULL) {
+ int i;
+
+ for (i = 0; gr1->gr_mem[i] != NULL; i++) {
+ if (strcmp(gr1->gr_mem[i], gr2->gr_mem[i]) != 0)
+ return (false);
}
-
- /* Check that group2 does not have more members than group1. */
- if (gr2->gr_mem[gr1_ndx] != NULL)
- return (false);
}
+ /* Count number of members in both structs */
+ gr2_ndx = 0;
+ if (gr2->gr_mem != NULL)
+ for(; gr2->gr_mem[gr2_ndx] != NULL; gr2_ndx++)
+ /* empty */;
+ gr1_ndx = 0;
+ if (gr1->gr_mem != NULL)
+ for(; gr1->gr_mem[gr1_ndx] != NULL; gr1_ndx++)
+ /* empty */;
+ if (gr1_ndx != gr2_ndx)
+ return (false);
return (true);
}
@@ -439,21 +443,21 @@ gr_dup(const struct group *gr)
struct group *
gr_add(const struct group *gr, const char *newmember)
{
- struct group *newgr;
+ char *mem;
size_t len;
int num_mem;
num_mem = 0;
len = grmemlen(gr, newmember, &num_mem);
/* Create new group and copy old group into it. */
- if ((newgr = malloc(len)) == NULL)
+ if ((mem = malloc(len)) == NULL)
return (NULL);
- return (grcopy(gr, newgr, newmember, num_mem));
+ return (grcopy(gr, mem, newmember, num_mem));
}
/* It is safer to walk the pointers given at gr_mem since there is no
- * guarantee the gr_mem + strings are continguous in the given struct group
- * but compact the new group into the following form.
+ * guarantee the gr_mem + strings are contiguous in the given struct group
+ * but compactify the new group into the following form.
*
* The new struct is laid out like this in memory. The example given is
* for a group with two members only.
@@ -474,23 +478,21 @@ gr_add(const struct group *gr, const char *newmember)
* }
*/
/*
- * Copy the guts of a group plus given name to a preallocated group struct
+ * Copy the contents of a group plus given name to a preallocated group struct
*/
static struct group *
-grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx)
+grcopy(const struct group *gr, char *dst, const char *name, int ndx)
{
- char *dst;
int i;
+ struct group *newgr;
- if (name != NULL)
- ndx++;
- /* point new gr_mem to end of struct + 1 if there are names */
- if (ndx != 0)
- newgr->gr_mem = (char **)(newgr + 1);
- else
+ newgr = (struct group *)(void *)dst; /* avoid alignment warning */
+ dst += sizeof(*newgr);
+ if (ndx != 0) {
+ newgr->gr_mem = (char **)(void *)(dst); /* avoid alignment warning */
+ dst += (ndx + 1) * sizeof(*newgr->gr_mem);
+ } else
newgr->gr_mem = NULL;
- /* point dst after the end of all the gr_mem pointers in newgr */
- dst = (char *)&newgr->gr_mem[ndx + 1];
if (gr->gr_name != NULL) {
newgr->gr_name = dst;
dst = stpcpy(dst, gr->gr_name) + 1;
@@ -502,17 +504,23 @@ grcopy(const struct group *gr, struct group *newgr, const char *name, int ndx)
} else
newgr->gr_passwd = NULL;
newgr->gr_gid = gr->gr_gid;
- if (ndx != 0) {
- for (i = 0; gr->gr_mem[i] != NULL; i++) {
+ i = 0;
+ /* Original group struct might have a NULL gr_mem */
+ if (gr->gr_mem != NULL) {
+ for (; gr->gr_mem[i] != NULL; i++) {
newgr->gr_mem[i] = dst;
dst = stpcpy(dst, gr->gr_mem[i]) + 1;
}
- if (name != NULL) {
- newgr->gr_mem[i++] = dst;
- dst = stpcpy(dst, name) + 1;
- }
- newgr->gr_mem[i] = NULL;
}
+ /* If name is not NULL, newgr->gr_mem is known to be not NULL */
+ if (name != NULL) {
+ newgr->gr_mem[i++] = dst;
+ dst = stpcpy(dst, name) + 1;
+ }
+ /* if newgr->gr_mem is not NULL add NULL marker */
+ if (newgr->gr_mem != NULL)
+ newgr->gr_mem[i] = NULL;
+
return (newgr);
}
@@ -533,18 +541,22 @@ grmemlen(const struct group *gr, const char *name, int *num_mem)
len += strlen(gr->gr_name) + 1;
if (gr->gr_passwd != NULL)
len += strlen(gr->gr_passwd) + 1;
+ i = 0;
if (gr->gr_mem != NULL) {
- for (len = i = 0; gr->gr_mem[i] != NULL; i++) {
+ for (; gr->gr_mem[i] != NULL; i++) {
len += strlen(gr->gr_mem[i]) + 1;
len += sizeof(*gr->gr_mem);
}
- *num_mem = i;
}
if (name != NULL) {
+ i++;
len += strlen(name) + 1;
- if (gr->gr_mem == NULL)
- len += sizeof(*gr->gr_mem);
+ len += sizeof(*gr->gr_mem);
}
+ /* Allow for NULL pointer */
+ if (i != 0)
+ len += sizeof(*gr->gr_mem);
+ *num_mem = i;
return(len);
}
diff --git a/lib/libutil/pidfile.c b/lib/libutil/pidfile.c
index bca0315..7949e9e 100644
--- a/lib/libutil/pidfile.c
+++ b/lib/libutil/pidfile.c
@@ -126,20 +126,25 @@ pidfile_open(const char *path, mode_t mode, pid_t *pidptr)
fd = flopen(pfh->pf_path,
O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode);
if (fd == -1) {
- if (errno == EWOULDBLOCK && pidptr != NULL) {
- count = 20;
- rqtp.tv_sec = 0;
- rqtp.tv_nsec = 5000000;
- for (;;) {
- errno = pidfile_read(pfh->pf_path, pidptr);
- if (errno != EAGAIN || --count == 0)
- break;
- nanosleep(&rqtp, 0);
- }
- if (errno == EAGAIN)
- *pidptr = -1;
- if (errno == 0 || errno == EAGAIN)
+ if (errno == EWOULDBLOCK) {
+ if (pidptr == NULL) {
errno = EEXIST;
+ } else {
+ count = 20;
+ rqtp.tv_sec = 0;
+ rqtp.tv_nsec = 5000000;
+ for (;;) {
+ errno = pidfile_read(pfh->pf_path,
+ pidptr);
+ if (errno != EAGAIN || --count == 0)
+ break;
+ nanosleep(&rqtp, 0);
+ }
+ if (errno == EAGAIN)
+ *pidptr = -1;
+ if (errno == 0 || errno == EAGAIN)
+ errno = EEXIST;
+ }
}
free(pfh);
return (NULL);
diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8
index cc29f71..99a1762 100644
--- a/sbin/ccdconfig/ccdconfig.8
+++ b/sbin/ccdconfig/ccdconfig.8
@@ -234,14 +234,14 @@ RAID controllers (see GENERIC),
or software RAID systems such as
.Xr geom 8
and
-.Xr vinum 8 .
+.Xr gvinum 8 .
.Sh SEE ALSO
.Xr dd 1 ,
.Xr ccd 4 ,
.Xr disklabel 8 ,
.Xr fdisk 8 ,
-.Xr rc 8 ,
-.Xr vinum 8
+.Xr gvinum 8 ,
+.Xr rc 8
.Sh HISTORY
The
.Nm
diff --git a/sbin/ffsinfo/ffsinfo.8 b/sbin/ffsinfo/ffsinfo.8
index aacf428..9753cf7 100644
--- a/sbin/ffsinfo/ffsinfo.8
+++ b/sbin/ffsinfo/ffsinfo.8
@@ -125,9 +125,9 @@ with all available information.
.Xr dumpfs 8 ,
.Xr fsck 8 ,
.Xr growfs 8 ,
+.Xr gvinum 8 ,
.Xr newfs 8 ,
-.Xr tunefs 8 ,
-.Xr vinum 8
+.Xr tunefs 8
.Sh HISTORY
The
.Nm
diff --git a/sbin/geom/class/concat/gconcat.8 b/sbin/geom/class/concat/gconcat.8
index 2e1b79d..b797a1c 100644
--- a/sbin/geom/class/concat/gconcat.8
+++ b/sbin/geom/class/concat/gconcat.8
@@ -183,11 +183,11 @@ growfs /dev/concat/data
.Xr loader.conf 5 ,
.Xr geom 8 ,
.Xr growfs 8 ,
+.Xr gvinum 8 ,
.Xr mount 8 ,
.Xr newfs 8 ,
.Xr sysctl 8 ,
-.Xr umount 8 ,
-.Xr vinum 8
+.Xr umount 8
.Sh HISTORY
The
.Nm
diff --git a/sbin/geom/class/mirror/gmirror.8 b/sbin/geom/class/mirror/gmirror.8
index baaa827..58ff8af 100644
--- a/sbin/geom/class/mirror/gmirror.8
+++ b/sbin/geom/class/mirror/gmirror.8
@@ -340,11 +340,11 @@ there.
.Xr geom 4 ,
.Xr dumpon 8 ,
.Xr geom 8 ,
+.Xr gvinum 8 ,
.Xr mount 8 ,
.Xr newfs 8 ,
.Xr savecore 8 ,
-.Xr umount 8 ,
-.Xr vinum 8
+.Xr umount 8
.Sh HISTORY
The
.Nm
diff --git a/sbin/geom/class/raid/graid.8 b/sbin/geom/class/raid/graid.8
index 4af4125..22763bd 100644
--- a/sbin/geom/class/raid/graid.8
+++ b/sbin/geom/class/raid/graid.8
@@ -314,7 +314,7 @@ Exit status is 0 on success, and non-zero if the command fails.
.Sh SEE ALSO
.Xr geom 4 ,
.Xr geom 8 ,
-.Xr vinum 8
+.Xr gvinum 8
.Sh HISTORY
The
.Nm
diff --git a/sbin/geom/class/stripe/gstripe.8 b/sbin/geom/class/stripe/gstripe.8
index ee70184..b53e83f 100644
--- a/sbin/geom/class/stripe/gstripe.8
+++ b/sbin/geom/class/stripe/gstripe.8
@@ -232,11 +232,11 @@ for
.Xr atacontrol 8 ,
.Xr ccdconfig 8 ,
.Xr geom 8 ,
+.Xr gvinum 8 ,
.Xr mount 8 ,
.Xr newfs 8 ,
.Xr sysctl 8 ,
-.Xr umount 8 ,
-.Xr vinum 8
+.Xr umount 8
.Sh HISTORY
The
.Nm
diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8
index 4753d79..5d36276 100644
--- a/sbin/gvinum/gvinum.8
+++ b/sbin/gvinum/gvinum.8
@@ -388,7 +388,10 @@ documentation were added by
.An "Chris Jones"
through the 2005 Google Summer
of Code program.
-.Ic a partial rewrite of gvinum was done by "Lukas Ertl" and "Ulf Lilleengen"
+A partial rewrite of gvinum was done by
+.An "Lukas Ertl"
+and
+.An "Ulf Lilleengen"
through the 2007 Google Summer of Code program.
The documentation have been updated to reflect the new functionality.
.Sh AUTHORS
@@ -419,9 +422,9 @@ This may leave data unprotected and is perhaps unwise.
Currently,
.Nm
does not yet fully implement all of the functions found in
-.Xr vinum 4 .
+.Nm vinum .
Specifically, the following commands from
-.Xr vinum 4
+.Nm vinum
are not supported:
.Bl -tag -width indent
.It Ic debug
diff --git a/sbin/hastctl/hastctl.8 b/sbin/hastctl/hastctl.8
index 9266fc0..bdca80d 100644
--- a/sbin/hastctl/hastctl.8
+++ b/sbin/hastctl/hastctl.8
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 10, 2011
+.Dd March 14, 2013
.Dt HASTCTL 8
.Os
.Sh NAME
@@ -49,6 +49,11 @@
.Aq init | primary | secondary
.Ar all | name ...
.Nm
+.Cm list
+.Op Fl d
+.Op Fl c Ar config
+.Op Ar all | name ...
+.Nm
.Cm status
.Op Fl d
.Op Fl c Ar config
@@ -139,8 +144,11 @@ GEOM provider
.Pa /dev/hast/<name>
will not be created on secondary node.
.El
+.It Cm list
+Present verbose status of the configured resources.
.It Cm status
-Present status of the configured resources.
+Present terse (and more easy machine-parseable) status of the configured
+resources.
.It Cm dump
Dump metadata stored on local component for the configured resources.
.El
diff --git a/sbin/hastctl/hastctl.c b/sbin/hastctl/hastctl.c
index 3dfde03..883a298 100644
--- a/sbin/hastctl/hastctl.c
+++ b/sbin/hastctl/hastctl.c
@@ -31,21 +31,11 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
-#include <sys/disk.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
#include <libutil.h>
-#include <limits.h>
-#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
-#include <sysexits.h>
#include <unistd.h>
#include <activemap.h>
@@ -70,7 +60,8 @@ enum {
CMD_CREATE,
CMD_ROLE,
CMD_STATUS,
- CMD_DUMP
+ CMD_DUMP,
+ CMD_LIST
};
static __dead2 void
@@ -85,6 +76,9 @@ usage(void)
" %s role [-d] [-c config] <init | primary | secondary> all | name ...\n",
getprogname());
fprintf(stderr,
+ " %s list [-d] [-c config] [all | name ...]\n",
+ getprogname());
+ fprintf(stderr,
" %s status [-d] [-c config] [all | name ...]\n",
getprogname());
fprintf(stderr,
@@ -297,7 +291,7 @@ control_set_role(struct nv *nv, const char *newrole)
}
static int
-control_status(struct nv *nv)
+control_list(struct nv *nv)
{
unsigned int ii;
const char *str;
@@ -361,6 +355,43 @@ control_status(struct nv *nv)
return (ret);
}
+static int
+control_status(struct nv *nv)
+{
+ unsigned int ii;
+ const char *str;
+ int error, hprinted, ret;
+
+ hprinted = 0;
+ ret = 0;
+
+ for (ii = 0; ; ii++) {
+ str = nv_get_string(nv, "resource%u", ii);
+ if (str == NULL)
+ break;
+ if (!hprinted) {
+ printf("Name\tStatus\t Role\t\tComponents\n");
+ hprinted = 1;
+ }
+ printf("%s\t", str);
+ error = nv_get_int16(nv, "error%u", ii);
+ if (error != 0) {
+ if (ret == 0)
+ ret = error;
+ printf("ERR%d\n", error);
+ continue;
+ }
+ str = nv_get_string(nv, "status%u", ii);
+ printf("%-9s", (str != NULL) ? str : "-");
+ printf("%-15s", nv_get_string(nv, "role%u", ii));
+ printf("%s\t",
+ nv_get_string(nv, "localpath%u", ii));
+ printf("%s\n",
+ nv_get_string(nv, "remoteaddr%u", ii));
+ }
+ return (ret);
+}
+
int
main(int argc, char *argv[])
{
@@ -381,6 +412,9 @@ main(int argc, char *argv[])
} else if (strcmp(argv[1], "role") == 0) {
cmd = CMD_ROLE;
optstr = "c:dh";
+ } else if (strcmp(argv[1], "list") == 0) {
+ cmd = CMD_LIST;
+ optstr = "c:dh";
} else if (strcmp(argv[1], "status") == 0) {
cmd = CMD_STATUS;
optstr = "c:dh";
@@ -469,8 +503,19 @@ main(int argc, char *argv[])
for (ii = 0; ii < argc - 1; ii++)
nv_add_string(nv, argv[ii + 1], "resource%d", ii);
break;
+ case CMD_LIST:
+ /* Obtain verbose status of the given resources. */
+ nv = nv_alloc();
+ nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd");
+ if (argc == 0)
+ nv_add_string(nv, "all", "resource%d", 0);
+ else {
+ for (ii = 0; ii < argc; ii++)
+ nv_add_string(nv, argv[ii], "resource%d", ii);
+ }
+ break;
case CMD_STATUS:
- /* Obtain status of the given resources. */
+ /* Obtain brief status of the given resources. */
nv = nv_alloc();
nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd");
if (argc == 0)
@@ -524,6 +569,9 @@ main(int argc, char *argv[])
case CMD_ROLE:
error = control_set_role(nv, argv[0]);
break;
+ case CMD_LIST:
+ error = control_list(nv);
+ break;
case CMD_STATUS:
error = control_status(nv);
break;
diff --git a/sbin/hastd/hastd.8 b/sbin/hastd/hastd.8
index 457b837..b614f36 100644
--- a/sbin/hastd/hastd.8
+++ b/sbin/hastd/hastd.8
@@ -51,7 +51,7 @@ Only one machine (cluster node) can actively use storage provided by
This machine is called primary.
The
.Nm
-daemon operates on block level, which makes it transparent for file
+daemon operates on block level, which makes it transparent to file
systems and applications.
.Pp
There is one main
@@ -68,7 +68,7 @@ The exact format is:
hastd: <resource name> (<role>)
.Ed
.Pp
-When (and only when)
+If (and only if)
.Nm
operates in primary role for the given resource, corresponding
.Pa /dev/hast/<name>
@@ -77,8 +77,8 @@ File systems and applications can use this provider to send I/O
requests to.
Every write, delete and flush operation
.Dv ( BIO_WRITE , BIO_DELETE , BIO_FLUSH )
-is send to local component and synchronously replicated
-to the remote (secondary) node if it is available.
+is send to local component and replicated to the remote (secondary) node if it
+is available.
Read operations
.Dv ( BIO_READ )
are handled locally unless I/O error occurs or local version of the data
diff --git a/sbin/hastd/secondary.c b/sbin/hastd/secondary.c
index febdc05..c0c67c6 100644
--- a/sbin/hastd/secondary.c
+++ b/sbin/hastd/secondary.c
@@ -582,7 +582,7 @@ requnpack(struct hast_resource *res, struct hio *hio, struct nv *nv)
hio->hio_error = EINVAL;
goto end;
}
- if (hio->hio_length > MAXPHYS) {
+ if (hio->hio_cmd != HIO_DELETE && hio->hio_length > MAXPHYS) {
pjdlog_error("Data length is too large (%ju > %ju).",
(uintmax_t)hio->hio_length, (uintmax_t)MAXPHYS);
hio->hio_error = EINVAL;
diff --git a/sbin/hastd/subr.c b/sbin/hastd/subr.c
index ae6f984..440061e 100644
--- a/sbin/hastd/subr.c
+++ b/sbin/hastd/subr.c
@@ -31,14 +31,15 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#ifdef HAVE_CAPSICUM
-#include <sys/capability.h>
-#endif
#include <sys/param.h>
#include <sys/disk.h>
#include <sys/ioctl.h>
#include <sys/jail.h>
#include <sys/stat.h>
+#ifdef HAVE_CAPSICUM
+#include <sys/capability.h>
+#include <geom/gate/g_gate.h>
+#endif
#include <errno.h>
#include <fcntl.h>
@@ -224,22 +225,53 @@ drop_privs(const struct hast_resource *res)
return (-1);
}
- /*
- * Until capsicum doesn't allow ioctl(2) we cannot use it to sandbox
- * primary and secondary worker processes, as primary uses GGATE
- * ioctls and secondary uses ioctls to handle BIO_DELETE and BIO_FLUSH.
- * For now capsicum is only used to sandbox hastctl.
- */
#ifdef HAVE_CAPSICUM
- if (res == NULL) {
- capsicum = (cap_enter() == 0);
- if (!capsicum) {
- pjdlog_common(LOG_DEBUG, 1, errno,
- "Unable to sandbox using capsicum");
+ capsicum = (cap_enter() == 0);
+ if (!capsicum) {
+ pjdlog_common(LOG_DEBUG, 1, errno,
+ "Unable to sandbox using capsicum");
+ } else if (res != NULL) {
+ static const unsigned long geomcmds[] = {
+ DIOCGDELETE,
+ DIOCGFLUSH
+ };
+
+ PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY ||
+ res->hr_role == HAST_ROLE_SECONDARY);
+
+ if (cap_rights_limit(res->hr_localfd,
+ CAP_FLOCK | CAP_IOCTL | CAP_PREAD | CAP_PWRITE) == -1) {
+ pjdlog_errno(LOG_ERR,
+ "Unable to limit capability rights on local descriptor");
+ }
+ if (cap_ioctls_limit(res->hr_localfd, geomcmds,
+ sizeof(geomcmds) / sizeof(geomcmds[0])) == -1) {
+ pjdlog_errno(LOG_ERR,
+ "Unable to limit allowed GEOM ioctls");
}
- } else
+
+ if (res->hr_role == HAST_ROLE_PRIMARY) {
+ static const unsigned long ggatecmds[] = {
+ G_GATE_CMD_MODIFY,
+ G_GATE_CMD_START,
+ G_GATE_CMD_DONE,
+ G_GATE_CMD_DESTROY
+ };
+
+ if (cap_rights_limit(res->hr_ggatefd, CAP_IOCTL) == -1) {
+ pjdlog_errno(LOG_ERR,
+ "Unable to limit capability rights to CAP_IOCTL on ggate descriptor");
+ }
+ if (cap_ioctls_limit(res->hr_ggatefd, ggatecmds,
+ sizeof(ggatecmds) / sizeof(ggatecmds[0])) == -1) {
+ pjdlog_errno(LOG_ERR,
+ "Unable to limit allowed ggate ioctls");
+ }
+ }
+ }
+#else
+ capsicum = false;
#endif
- capsicum = false;
/*
* Better be sure that everything succeeded.
diff --git a/sbin/recoverdisk/recoverdisk.c b/sbin/recoverdisk/recoverdisk.c
index caa8ebd..af0d88e 100644
--- a/sbin/recoverdisk/recoverdisk.c
+++ b/sbin/recoverdisk/recoverdisk.c
@@ -156,7 +156,7 @@ main(int argc, char * const argv[])
int error, state;
u_char *buf;
u_int sectorsize;
- u_int stripesize;
+ off_t stripesize;
time_t t1, t2;
struct stat sb;
u_int n, snapshot = 60;
diff --git a/share/examples/Makefile b/share/examples/Makefile
index 5657d3e..a3be98c 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -52,9 +52,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \
csh/dot.cshrc \
cvsup/README \
cvsup/cvs-supfile \
- cvsup/ports-supfile \
- cvsup/refuse \
- cvsup/refuse.README \
cvsup/stable-supfile \
cvsup/standard-supfile \
diskless/ME \
diff --git a/share/examples/cvsup/README b/share/examples/cvsup/README
index 19ae270..0bf2932 100644
--- a/share/examples/cvsup/README
+++ b/share/examples/cvsup/README
@@ -19,8 +19,6 @@ To maintain the sources for the FreeBSD-current release, use:
standard-supfile Main source tree
- ports-supfile Ports collection
-
To maintain the sources for the FreeBSD-stable release, use:
stable-supfile Main source tree
@@ -28,7 +26,7 @@ To maintain the sources for the FreeBSD-stable release, use:
To maintain a copy of the CVS repository containing all versions of
FreeBSD, use:
- cvs-supfile Main source tree and ports collection
+ cvs-supfile Main source tree collection
IMPORTANT: Before you use any of the supfiles in this directory,
you will need to edit in an appropriate "host" setting. See:
diff --git a/share/examples/cvsup/cvs-supfile b/share/examples/cvsup/cvs-supfile
index f46d051..b501272 100644
--- a/share/examples/cvsup/cvs-supfile
+++ b/share/examples/cvsup/cvs-supfile
@@ -43,9 +43,8 @@
# prefix=/home/ncvs
# This specifies where to place the requested files. A
# setting of "/home/ncvs" will place all of the files
-# requested in /home/ncvs (e.g., "/home/ncvs/src/bin",
-# "/home/ncvs/ports/archivers"). The prefix directory
-# must exist in order to run CVSup.
+# requested in /home/ncvs (e.g., "/home/ncvs/src/bin").
+# The prefix directory must exist in order to run CVSup.
# Defaults that apply to all the collections
#
@@ -68,13 +67,6 @@
# mega-collection. It includes all of the individual "src-*" collections.
src-all
-## Ports Collection.
-#
-# The easiest way to get the ports tree is to use the "ports-all"
-# mega-collection. It includes all of the individual "ports-*"
-# collections,
-ports-all
-
## Projects
#
# This collection retrieves the projects tree of the FreeBSD
diff --git a/share/examples/cvsup/ports-supfile b/share/examples/cvsup/ports-supfile
deleted file mode 100644
index f37af41..0000000
--- a/share/examples/cvsup/ports-supfile
+++ /dev/null
@@ -1,74 +0,0 @@
-# $FreeBSD$
-#
-# BEWARE, CVS is deprecated and no longer supported by the FreeBSD project.
-#
-# The primary development work happens in Subversion and is temporarily
-# exported to the legacy CVS system with significant time delays.
-#
-# You should NOT set up a new consumer of FreeBSD source code via CVS.
-# Please see:
-# http://www.freebsd.org/doc/handbook/svn.html
-# http://www.freebsd.org/doc/handbook/svn-mirrors.html
-#
-# csup (CVS Update Protocol) allows you to download the latest CVS
-# tree (or any branch of development therefrom) to your system easily
-# and efficiently
-# _
-# __ ____ _ _ __ _ __ (_)_ __ __ _
-# \ \ /\ / / _` | '__| '_ \| | '_ \ / _` |
-# \ V V / (_| | | | | | | | | | | (_| |
-# \_/\_/ \__,_|_| |_| |_|_|_| |_|\__, |
-# |___/
-# cvsup for ports is being phased out as of 28 February 2013 and its
-# use is discouraged. Users are advised to migrate to portsnap
-# or svn directly.
-#
-# Note that this only updates the tree contents and does not
-# update what is actually installed.
-#
-# You may wish to change some of the settings in this file to better
-# suit your system:
-#
-# host=CHANGE_THIS.FreeBSD.org
-# This specifies the server host which will supply the
-# file updates. You must change it to one of the CVSup
-# mirror sites listed in the FreeBSD Handbook at
-# http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
-# You can override this setting on the command line
-# with cvsup's "-h host" option.
-#
-# base=/var/db
-# This specifies the root where csup will store information
-# about the collections you have transferred to your system.
-# A setting of "/var/db" will generate this information in
-# /var/db/sup. You can override the "base" setting on the
-# command line with cvsup's "-b base" option. This directory
-# must exist in order to run CVSup.
-#
-# prefix=/usr
-# This specifies where to place the requested files. A
-# setting of "/usr" will place all of the files requested
-# in "/usr/ports" (e.g., "/usr/ports/devel", "/usr/ports/lang").
-# The prefix directory must exist in order to run CVSup.
-
-# Defaults that apply to all the collections
-#
-# IMPORTANT: Change the next line to use one of the CVSup mirror sites
-# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS.
-*default host=CHANGE_THIS.FreeBSD.org
-*default base=/var/db
-*default prefix=/usr
-*default release=cvs tag=.
-*default delete use-rel-suffix
-
-# If you seem to be limited by CPU rather than network or disk bandwidth, try
-# commenting out the following line. (Normally, today's CPUs are fast enough
-# that you want to run compression.)
-*default compress
-
-## Ports Collection.
-#
-# The easiest way to get the ports tree is to use the "ports-all"
-# mega-collection. It includes all of the individual "ports-*"
-# collections,
-ports-all
diff --git a/share/examples/cvsup/refuse b/share/examples/cvsup/refuse
deleted file mode 100644
index c257f71..0000000
--- a/share/examples/cvsup/refuse
+++ /dev/null
@@ -1,13 +0,0 @@
-ports/arabic
-ports/chinese
-ports/french
-ports/german
-ports/hebrew
-ports/hungarian
-ports/japanese
-ports/korean
-ports/polish
-ports/portuguese
-ports/russian
-ports/ukrainian
-ports/vietnamese
diff --git a/share/examples/cvsup/refuse.README b/share/examples/cvsup/refuse.README
deleted file mode 100644
index 4b90962..0000000
--- a/share/examples/cvsup/refuse.README
+++ /dev/null
@@ -1,44 +0,0 @@
-$FreeBSD$
-
-This describes the "refuse" file found in this directory. The
-explanation cannot be put inside the file itself because:
-
- COMMENTS ARE NOT ALLOWED IN refuse FILES!
-
-Each line of the refuse file contains one or more filename patterns
-separated by white space. Everything matched by a pattern will be
-left untouched by CVSup. If a pattern matches a directory, then
-everything beneath that directory will be left alone.
-
-You can copy "refuse" to your sup directory and add or remove
-whatever you like. The example supfiles in this directory set
-CVSup's base directory to "/var/db". The sup directory is in the base
-directory; i.e., it is "/var/db/sup". If you have changed your base
-directory, your sup directory is /path/to/base/sup.
-
-If you are an English speaker and don't wish to receive the
-non-English ports, use the following patterns:
-
- ports/arabic
- ports/chinese
- ports/french
- ports/german
- ports/hebrew
- ports/hungarian
- ports/japanese
- ports/korean
- ports/polish
- ports/portuguese
- ports/russian
- ports/ukrainian
- ports/vietnamese
-
-Note that this is *not* a supported configuration and may result
-in ports builds breaking.
-
-Use refuse files with care. Some parts of the src distribution
-depend on files in completely different parts.
-
-For more information about refuse files see cvsup(1), which is
-installed by the "cvsup" and "cvsup-bin" ports. See also the CVSup
-FAQ at <http://www.cvsup.org/faq.html>.
diff --git a/share/examples/cvsup/stable-supfile b/share/examples/cvsup/stable-supfile
index 54f6e89..b520f8d 100644
--- a/share/examples/cvsup/stable-supfile
+++ b/share/examples/cvsup/stable-supfile
@@ -46,21 +46,6 @@
# in "/usr/src" (e.g., "/usr/src/bin", "/usr/src/lib").
# The prefix directory must exist in order to run CVSup.
#
-###############################################################################
-#
-# DANGER! WARNING! LOOK OUT! VORSICHT!
-#
-# If you add any of the ports collections to this file, be sure to
-# specify them with a "tag" value set to ".", like this:
-#
-# ports-all tag=.
-#
-# If you leave out the "tag=." portion, CVSup will delete all of
-# the files in your ports. That is because the ports
-# collections do not use the same tags as the main part of the FreeBSD
-# source tree.
-#
-###############################################################################
# Defaults that apply to all the collections
#
diff --git a/share/examples/nwclient/dot.nwfsrc b/share/examples/nwclient/dot.nwfsrc
deleted file mode 100644
index 03bc1d0..0000000
--- a/share/examples/nwclient/dot.nwfsrc
+++ /dev/null
@@ -1,78 +0,0 @@
-# $FreeBSD$
-#
-# Example for .nwfsrc file
-#
-# ncplib lookups configuration files in next order:
-# 1. ~/.nwfsrc
-# 2. /etc/nwfs.conf - if this file found it will
-# override values with same keys from user files.
-#
-#
-# This file consist of a set of sections. Each section started by section name
-# surrounded by square brackets:
-# [section_name]
-#
-# End of the section marked either by new section or by the end of file.
-# Each section can contain zero or more parameters:
-# [section_name]
-# key=value
-#
-# where 'key' is a represents parameter name and 'value' a value assigned
-# to this parameter.
-#
-# NetWare library uses next forms of section names:
-# [SERVER]
-# [SERVER:USER]
-# [SERVER:QUEUE]
-#
-# When user issues any ncp* command that requires create of new connection
-# to a NetWare server, library function lookups for parameters in the
-# corresponding section. First it looks in the [SERVER] section and then in
-# the [SERVER:USER] section. Please note that server and user names should be
-# in the upper case.
-#
-
-# Following parameters are valid for [SERVER] or [SERVER:USER] section:
-[BHOME:SUPERVISOR]
-# if you don't use password leave value empty
-password=I_DONT_TELL_YOU
-
-# how many retries before error, default 10
-retry_count=10
-
-# timeout for request to complete
-timeout=5
-
-# access mode to connection, default 0700
-access_mode=0700
-
-# signature level, default 0 - no signatures
-sig_level=0
-
-# force bindery login, default no
-bindery=no
-
-# default print queue for user, default is none
-# print_queue=QE_BJ
-
-
-[ANOTHERSERVER:PLAINUSER]
-# in this case user have an empty password
-password=
-
-# Defaults for printer queues defined as [SERVER:QUEUE]
-# communication parameters taken from [SERVER:USER] section
-# see man ncprint(1) for queue parameters description
-# note: if any banner related option is specified, banner will be printed.
-[BHOME:QE_BJ]
-#path_name=/etc
-#file_name=passwd
-#banner_name=My Job
-#job_desc=Printing from FreeBSD
-
-#lines=66
-#rows=80
-copies=1
-tab_size=8
-no_form_feed=yes
-#form_number=0
diff --git a/share/examples/nwclient/nwfs.sh.sample b/share/examples/nwclient/nwfs.sh.sample
deleted file mode 100644
index cb8b631..0000000
--- a/share/examples/nwclient/nwfs.sh.sample
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-# Location: /usr/local/etc/rc.d/nwfs.sh
-#
-# Simple script to mount NetWare volumes at startup.
-# It assumes that all mount points described in fstab file and password
-# entries listed in /root/.nwfsrc file. See mount_nwfs(8) for details.
-#
-
-mount=/sbin/mount
-umount=/sbin/umount
-HOME=/root; export HOME
-vols="/nw/sys /nw/vol1"
-
-if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
- echo -n "Mounting NetWare volumes: "
- for vol in ${vols}; do
- $mount $vol
- echo -n "$vol "
- done
- echo "Done"
-elif [ "x$1" = "xstop" ]; then
- echo -n "Unmounting NetWare mount points: "
- for vol in ${vols}; do
- $umount $vol
- echo -n "$vol "
- done
- echo "Done"
-else
- echo "Unknown command $1"
-fi
-
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index cdd7474..bd67533 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -525,7 +525,6 @@ MAN= aac.4 \
vge.4 \
viapm.4 \
${_viawd.4} \
- vinum.4 \
${_virtio.4} \
${_virtio_balloon.4} \
${_virtio_blk.4} \
diff --git a/share/man/man4/cas.4 b/share/man/man4/cas.4
index 0c0f5d7..36a5ab1 100644
--- a/share/man/man4/cas.4
+++ b/share/man/man4/cas.4
@@ -44,7 +44,7 @@ Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
-if_cas="YES"
+if_cas_load="YES"
.Ed
.Sh DESCRIPTION
The
diff --git a/share/man/man4/ccd.4 b/share/man/man4/ccd.4
index 8da0e36..4c95fb8 100644
--- a/share/man/man4/ccd.4
+++ b/share/man/man4/ccd.4
@@ -279,9 +279,9 @@ device special files
.Xr config 8 ,
.Xr disklabel 8 ,
.Xr fsck 8 ,
+.Xr gvinum 8 ,
.Xr mount 8 ,
-.Xr newfs 8 ,
-.Xr vinum 8
+.Xr newfs 8
.Sh HISTORY
The concatenated disk driver was originally written at the University of
Utah.
diff --git a/share/man/man4/geom.4 b/share/man/man4/geom.4
index 0a1b24e..4606676 100644
--- a/share/man/man4/geom.4
+++ b/share/man/man4/geom.4
@@ -34,12 +34,47 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 25, 2006
+.Dd March 14, 2013
.Dt GEOM 4
.Os
.Sh NAME
.Nm GEOM
.Nd "modular disk I/O request transformation framework"
+.Sh SYNOPSIS
+.Cd options GEOM_AES
+.Cd options GEOM_BDE
+.Cd options GEOM_BSD
+.Cd options GEOM_CACHE
+.Cd options GEOM_CONCAT
+.Cd options GEOM_ELI
+.Cd options GEOM_FOX
+.Cd options GEOM_GATE
+.Cd options GEOM_JOURNAL
+.Cd options GEOM_LABEL
+.Cd options GEOM_LINUX_LVM
+.Cd options GEOM_MBR
+.Cd options GEOM_MIRROR
+.Cd options GEOM_MULTIPATH
+.Cd options GEOM_NOP
+.Cd options GEOM_PART_APM
+.Cd options GEOM_PART_BSD
+.Cd options GEOM_PART_EBR
+.Cd options GEOM_PART_EBR_COMPAT
+.Cd options GEOM_PART_GPT
+.Cd options GEOM_PART_LDM
+.Cd options GEOM_PART_MBR
+.Cd options GEOM_PART_PC98
+.Cd options GEOM_PART_VTOC8
+.Cd options GEOM_PC98
+.Cd options GEOM_RAID
+.Cd options GEOM_RAID3
+.Cd options GEOM_SHSEC
+.Cd options GEOM_STRIPE
+.Cd options GEOM_SUNLABEL
+.Cd options GEOM_UZIP
+.Cd options GEOM_VIRSTOR
+.Cd options GEOM_VOL
+.Cd options GEOM_ZERO
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/sge.4 b/share/man/man4/sge.4
index 5d6ecf8..70d839e 100644
--- a/share/man/man4/sge.4
+++ b/share/man/man4/sge.4
@@ -43,7 +43,7 @@ Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
-if_sge="YES"
+if_sge_load="YES"
.Ed
.Sh DESCRIPTION
The
diff --git a/share/man/man4/udp.4 b/share/man/man4/udp.4
index 03d6db2..1092f5a 100644
--- a/share/man/man4/udp.4
+++ b/share/man/man4/udp.4
@@ -103,29 +103,6 @@ transport level may be used with
.Tn UDP ;
see
.Xr ip 4 .
-.Sh ERRORS
-A socket operation may fail with one of the following errors returned:
-.Bl -tag -width Er
-.It Bq Er EISCONN
-when trying to establish a connection on a socket which
-already has one, or when trying to send a datagram with the destination
-address specified and the socket is already connected;
-.It Bq Er ENOTCONN
-when trying to send a datagram, but
-no destination address is specified, and the socket has not been
-connected;
-.It Bq Er ENOBUFS
-when the system runs out of memory for
-an internal data structure;
-.It Bq Er EADDRINUSE
-when an attempt
-is made to create a socket with a port which has already been
-allocated;
-.It Bq Er EADDRNOTAVAIL
-when an attempt is made to create a
-socket with a network address for which no network interface
-exists.
-.El
.Sh MIB VARIABLES
The
.Nm
@@ -154,6 +131,29 @@ listening, do not return an ICMP port unreachable message.
See
.Xr blackhole 4 . )
.El
+.Sh ERRORS
+A socket operation may fail with one of the following errors returned:
+.Bl -tag -width Er
+.It Bq Er EISCONN
+when trying to establish a connection on a socket which
+already has one, or when trying to send a datagram with the destination
+address specified and the socket is already connected;
+.It Bq Er ENOTCONN
+when trying to send a datagram, but
+no destination address is specified, and the socket has not been
+connected;
+.It Bq Er ENOBUFS
+when the system runs out of memory for
+an internal data structure;
+.It Bq Er EADDRINUSE
+when an attempt
+is made to create a socket with a port which has already been
+allocated;
+.It Bq Er EADDRNOTAVAIL
+when an attempt is made to create a
+socket with a network address for which no network interface
+exists.
+.El
.Sh SEE ALSO
.Xr getsockopt 2 ,
.Xr recv 2 ,
diff --git a/share/man/man4/vinum.4 b/share/man/man4/vinum.4
deleted file mode 100644
index 4a59cb9..0000000
--- a/share/man/man4/vinum.4
+++ /dev/null
@@ -1,1171 +0,0 @@
-.\" Hey, Emacs, edit this file in -*- nroff-fill -*- mode
-.\"-
-.\" Copyright (c) 1997, 1998, 2003
-.\" Nan Yang Computer Services Limited. All rights reserved.
-.\"
-.\" This software is distributed under the so-called ``Berkeley
-.\" License'':
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by Nan Yang Computer
-.\" Services Limited.
-.\" 4. Neither the name of the Company nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" This software is provided ``as is'', and any express or implied
-.\" warranties, including, but not limited to, the implied warranties of
-.\" merchantability and fitness for a particular purpose are disclaimed.
-.\" In no event shall the company or contributors be liable for any
-.\" direct, indirect, incidental, special, exemplary, or consequential
-.\" damages (including, but not limited to, procurement of substitute
-.\" goods or services; loss of use, data, or profits; or business
-.\" interruption) however caused and on any theory of liability, whether
-.\" in contract, strict liability, or tort (including negligence or
-.\" otherwise) arising in any way out of the use of this software, even if
-.\" advised of the possibility of such damage.
-.\"
-.\" $FreeBSD$
-.\"
-.Dd May 16, 2002
-.Dt VINUM 4
-.Os
-.Sh NAME
-.Nm vinum
-.Nd Logical Volume Manager
-.Sh SYNOPSIS
-.Cd "device vinum"
-.Sh DESCRIPTION
-.Nm
-is a logical volume manager inspired by, but not derived from, the Veritas
-Volume Manager.
-It provides the following features:
-.Bl -bullet
-.It
-It provides device-independent logical disks, called
-.Em volumes .
-Volumes are
-not restricted to the size of any disk on the system.
-.It
-The volumes consist of one or more
-.Em plexes ,
-each of which contain the
-entire address space of a volume.
-This represents an implementation of RAID-1
-(mirroring).
-Multiple plexes can also be used for:
-.\" XXX What about sparse plexes? Do we want them?
-.Bl -bullet
-.It
-Increased read throughput.
-.Nm
-will read data from the least active disk, so if a volume has plexes on multiple
-disks, more data can be read in parallel.
-.Nm
-reads data from only one plex, but it writes data to all plexes.
-.It
-Increased reliability.
-By storing plexes on different disks, data will remain
-available even if one of the plexes becomes unavailable.
-In comparison with a
-RAID-5 plex (see below), using multiple plexes requires more storage space, but
-gives better performance, particularly in the case of a drive failure.
-.It
-Additional plexes can be used for on-line data reorganization.
-By attaching an
-additional plex and subsequently detaching one of the older plexes, data can be
-moved on-line without compromising access.
-.It
-An additional plex can be used to obtain a consistent dump of a file system.
-By
-attaching an additional plex and detaching at a specific time, the detached plex
-becomes an accurate snapshot of the file system at the time of detachment.
-.\" Make sure to flush!
-.El
-.It
-Each plex consists of one or more logical disk slices, called
-.Em subdisks .
-Subdisks are defined as a contiguous block of physical disk storage.
-A plex may
-consist of any reasonable number of subdisks (in other words, the real limit is
-not the number, but other factors, such as memory and performance, associated
-with maintaining a large number of subdisks).
-.It
-A number of mappings between subdisks and plexes are available:
-.Bl -bullet
-.It
-.Em "Concatenated plexes"
-consist of one or more subdisks, each of which
-is mapped to a contiguous part of the plex address space.
-.It
-.Em "Striped plexes"
-consist of two or more subdisks of equal size.
-The file
-address space is mapped in
-.Em stripes ,
-integral fractions of the subdisk
-size.
-Consecutive plex address space is mapped to stripes in each subdisk in
-turn.
-.if t \{\
-.ig
-.\" FIXME
-.br
-.ne 1.5i
-.PS
-move right 2i
-down
-SD0: box
-SD1: box
-SD2: box
-
-"plex 0" at SD0.n+(0,.2)
-"subdisk 0" rjust at SD0.w-(.2,0)
-"subdisk 1" rjust at SD1.w-(.2,0)
-"subdisk 2" rjust at SD2.w-(.2,0)
-.PE
-..
-.\}
-The subdisks of a striped plex must all be the same size.
-.It
-.Em "RAID-5 plexes"
-require at least three equal-sized subdisks.
-They
-resemble striped plexes, except that in each stripe, one subdisk stores parity
-information.
-This subdisk changes in each stripe: in the first stripe, it is the
-first subdisk, in the second it is the second subdisk, etc.
-In the event of a
-single disk failure,
-.Nm
-will recover the data based on the information stored on the remaining subdisks.
-This mapping is particularly suited to read-intensive access.
-The subdisks of a
-RAID-5 plex must all be the same size.
-.\" Make sure to flush!
-.El
-.It
-.Em Drives
-are the lowest level of the storage hierarchy.
-They represent disk special
-devices.
-.It
-.Nm
-offers automatic startup.
-Unlike
-.Ux
-file systems,
-.Nm
-volumes contain all the configuration information needed to ensure that they are
-started correctly when the subsystem is enabled.
-This is also a significant
-advantage over the Veritas\(tm File System.
-This feature regards the presence
-of the volumes.
-It does not mean that the volumes will be mounted
-automatically, since the standard startup procedures with
-.Pa /etc/fstab
-perform this function.
-.El
-.Sh KERNEL CONFIGURATION
-.Nm
-is currently supplied as a KLD module, and does not require
-configuration.
-As with other KLDs, it is absolutely necessary to match the KLD
-to the version of the operating system.
-Failure to do so will cause
-.Nm
-to issue an error message and terminate.
-.Pp
-It is possible to configure
-.Nm
-in the kernel, but this is not recommended.
-To do so, add this line to the
-kernel configuration file:
-.Pp
-.D1 Cd "device vinum"
-.Ss Debug Options
-The current version of
-.Nm ,
-both the kernel module and the user program
-.Xr gvinum 8 ,
-include significant debugging support.
-It is not recommended to remove
-this support at the moment, but if you do you must remove it from both the
-kernel and the user components.
-To do this, edit the files
-.Pa /usr/src/sbin/vinum/Makefile
-and
-.Pa /usr/src/sys/modules/vinum/Makefile
-and edit the
-.Va CFLAGS
-variable to remove the
-.Li -DVINUMDEBUG
-option.
-If you have
-configured
-.Nm
-into the kernel, either specify the line
-.Pp
-.D1 Cd "options VINUMDEBUG"
-.Pp
-in the kernel configuration file or remove the
-.Li -DVINUMDEBUG
-option from
-.Pa /usr/src/sbin/vinum/Makefile
-as described above.
-.Pp
-If the
-.Va VINUMDEBUG
-variables do not match,
-.Xr gvinum 8
-will fail with a message
-explaining the problem and what to do to correct it.
-.Ss Other Options
-.Cd "options VINUM_AUTOSTART"
-.Pp
-Make
-.Nm
-automatically scan all available disks at attach time.
-This is a deprecated way that is primarily intended for environments
-that do not want to rely on kernel environment variables set by
-.Xr loader 8 .
-.Pp
-.Nm
-was previously available in two versions: a freely available version which did
-not contain RAID-5 functionality, and a full version including RAID-5
-functionality, which was available only from Cybernet Systems Inc.
-The present
-version of
-.Nm
-includes the RAID-5 functionality.
-.Sh RUNNING VINUM
-.Nm
-is part of the base
-.Fx
-system.
-It does not require installation.
-To start it, start the
-.Xr gvinum 8
-program, which will load the KLD if it is not already present.
-Before using
-.Nm ,
-it must be configured.
-See
-.Xr gvinum 8
-for information on how to create a
-.Nm
-configuration.
-.Pp
-Normally, you start a configured version of
-.Nm
-at boot time.
-Set the variable
-.Va start_vinum
-in
-.Pa /etc/rc.conf
-to
-.Dq Li YES
-to start
-.Nm
-at boot time.
-(See
-.Xr rc.conf 5
-for more details.)
-.Pp
-If
-.Nm
-is loaded as a KLD (the recommended way), the
-.Nm vinum Cm stop
-command will unload it
-(see
-.Xr gvinum 8 ) .
-You can also do this with the
-.Xr kldunload 8
-command.
-.Pp
-The KLD can only be unloaded when idle, in other words when no volumes are
-mounted and no other instances of the
-.Xr gvinum 8
-program are active.
-Unloading the KLD does not harm the data in the volumes.
-.Ss Configuring and Starting Objects
-Use the
-.Xr gvinum 8
-utility to configure and start
-.Nm
-objects.
-.Sh AUTOMATIC STARTUP
-The
-.Nm
-subsystem can be automatically started at attach time.
-There are two kernel environment variables that can be set in
-.Xr loader.conf 5
-to accomplish this.
-.Bl -tag -width ".Va vinum.autostart" -offset indent
-.It Va vinum.autostart
-If this variable is set (to any value), the attach function will attempt
-to scan all available disks for valid
-.Nm
-configuration records.
-This is the preferred way if automatic startup is desired.
-.Pp
-Example:
-.Dl vinum.autostart="YES"
-.It Va vinum.drives
-Alternatively, this variable can enumerate a list of disk devices
-to scan for configuration records.
-Note that only the
-.Dq bare
-device names need to be given, since
-.Nm
-will automatically scan all possible slices and partitions.
-.Pp
-Example:
-.Dl vinum.drives="da0 da1"
-.El
-.Pp
-If automatic startup is used, it is not necessary to set the
-.Va start_vinum
-variable of
-.Xr rc.conf 5 .
-Note that if
-.Nm
-is to supply to the volume for the root file system, it is necessary
-to start the subsystem early.
-This can be achieved by specifying
-.Pp
-.Dl vinum_load="YES"
-.Pp
-in
-.Xr loader.conf 5 .
-.Sh IOCTL CALLS
-.Xr ioctl 2
-calls are intended for the use of the
-.Xr gvinum 8
-configuration program only.
-They are described in the header file
-.Pa /sys/dev/vinum/vinumio.h .
-.Ss Disk Labels
-Conventional disk special devices have a
-.Em "disk label"
-in the second sector of the device.
-This disk label describes the layout of the partitions within
-the device.
-.Nm
-does not subdivide volumes, so volumes do not contain a physical disk label.
-For convenience,
-.Nm
-implements the ioctl calls
-.Dv DIOCGDINFO
-(get disk label),
-.Dv DIOCGPART
-(get partition information),
-.Dv DIOCWDINFO
-(write partition information) and
-.Dv DIOCSDINFO
-(set partition information).
-.Dv DIOCGDINFO
-and
-.Dv DIOCGPART
-refer to an internal
-representation of the disk label which is not present on the volume.
-As a
-result, the
-.Fl r
-option of
-.Xr disklabel 8 ,
-which reads the
-.Dq "raw disk" ,
-will fail.
-.Pp
-In general,
-.Xr disklabel 8
-serves no useful purpose on a
-.Nm
-volume.
-If you run it, it will show you
-three partitions,
-.Ql a ,
-.Ql b
-and
-.Ql c ,
-all the same except for the
-.Va fstype ,
-for example:
-.Bd -literal
-3 partitions:
-# size offset fstype [fsize bsize bps/cpg]
- a: 2048 0 4.2BSD 1024 8192 0 # (Cyl. 0 - 0)
- b: 2048 0 swap # (Cyl. 0 - 0)
- c: 2048 0 unused 0 0 # (Cyl. 0 - 0)
-.Ed
-.Pp
-.Nm
-ignores the
-.Dv DIOCWDINFO
-and
-.Dv DIOCSDINFO
-ioctls, since there is nothing to change.
-As a result, any attempt to modify the disk label will be silently ignored.
-.Sh MAKING FILE SYSTEMS
-Since
-.Nm
-volumes do not contain partitions, the names do not need to conform to the
-standard rules for naming disk partitions.
-For a physical disk partition, the
-last letter of the device name specifies the partition identifier (a to h).
-.Nm
-volumes need not conform to this convention, but if they do not,
-.Xr newfs 8
-will complain that it cannot determine the partition.
-To solve this problem,
-use the
-.Fl v
-flag to
-.Xr newfs 8 .
-For example, if you have a volume
-.Pa concat ,
-use the following command to create a UFS file system on it:
-.Pp
-.Dl "newfs -v /dev/vinum/concat"
-.Sh OBJECT NAMING
-.Nm
-assigns default names to plexes and subdisks, although they may be overridden.
-We do not recommend overriding the default names.
-Experience with the
-Veritas\(tm
-volume manager, which allows arbitrary naming of objects, has shown that this
-flexibility does not bring a significant advantage, and it can cause confusion.
-.Pp
-Names may contain any non-blank character, but it is recommended to restrict
-them to letters, digits and the underscore characters.
-The names of volumes,
-plexes and subdisks may be up to 64 characters long, and the names of drives may
-up to 32 characters long.
-When choosing volume and plex names, bear in mind
-that automatically generated plex and subdisk names are longer than the name
-from which they are derived.
-.Bl -bullet
-.It
-When
-.Nm
-creates or deletes objects, it creates a directory
-.Pa /dev/vinum ,
-in which it makes device entries for each volume it finds.
-It also creates
-subdirectories,
-.Pa /dev/vinum/plex
-and
-.Pa /dev/vinum/sd ,
-in which it stores device entries for plexes and subdisks.
-In addition, it creates two more directories,
-.Pa /dev/vinum/vol
-and
-.Pa /dev/vinum/drive ,
-in which it stores hierarchical information for volumes and drives.
-.It
-In addition,
-.Nm
-creates three super-devices,
-.Pa /dev/vinum/control ,
-.Pa /dev/vinum/Control
-and
-.Pa /dev/vinum/controld .
-.Pa /dev/vinum/control
-is used by
-.Xr gvinum 8
-when it has been compiled without the
-.Dv VINUMDEBUG
-option,
-.Pa /dev/vinum/Control
-is used by
-.Xr gvinum 8
-when it has been compiled with the
-.Dv VINUMDEBUG
-option, and
-.Pa /dev/vinum/controld
-is used by the
-.Nm
-daemon.
-The two control devices for
-.Xr gvinum 8
-are used to synchronize the debug status of kernel and user modules.
-.It
-Unlike
-.Ux
-drives,
-.Nm
-volumes are not subdivided into partitions, and thus do not contain a disk
-label.
-Unfortunately, this confuses a number of utilities, notably
-.Xr newfs 8 ,
-which normally tries to interpret the last letter of a
-.Nm
-volume name as a partition identifier.
-If you use a volume name which does not
-end in the letters
-.Ql a
-to
-.Ql c ,
-you must use the
-.Fl v
-flag to
-.Xr newfs 8
-in order to tell it to ignore this convention.
-.\"
-.It
-Plexes do not need to be assigned explicit names.
-By default, a plex name is
-the name of the volume followed by the letters
-.Pa .p
-and the number of the
-plex.
-For example, the plexes of volume
-.Pa vol3
-are called
-.Pa vol3.p0 , vol3.p1
-and so on.
-These names can be overridden, but it is not recommended.
-.It
-Like plexes, subdisks are assigned names automatically, and explicit naming is
-discouraged.
-A subdisk name is the name of the plex followed by the letters
-.Pa .s
-and a number identifying the subdisk.
-For example, the subdisks of
-plex
-.Pa vol3.p0
-are called
-.Pa vol3.p0.s0 , vol3.p0.s1
-and so on.
-.It
-By contrast,
-.Em drives
-must be named.
-This makes it possible to move a drive to a different location
-and still recognize it automatically.
-Drive names may be up to 32 characters
-long.
-.El
-.Ss Example
-Assume the
-.Nm
-objects described in the section
-.Sx "CONFIGURATION FILE"
-in
-.Xr gvinum 8 .
-The directory
-.Pa /dev/vinum
-looks like:
-.Bd -literal -offset indent
-# ls -lR /dev/vinum
-total 5
-brwxr-xr-- 1 root wheel 25, 2 Mar 30 16:08 concat
-brwx------ 1 root wheel 25, 0x40000000 Mar 30 16:08 control
-brwx------ 1 root wheel 25, 0x40000001 Mar 30 16:08 controld
-drwxrwxrwx 2 root wheel 512 Mar 30 16:08 drive
-drwxrwxrwx 2 root wheel 512 Mar 30 16:08 plex
-drwxrwxrwx 2 root wheel 512 Mar 30 16:08 rvol
-drwxrwxrwx 2 root wheel 512 Mar 30 16:08 sd
-brwxr-xr-- 1 root wheel 25, 3 Mar 30 16:08 strcon
-brwxr-xr-- 1 root wheel 25, 1 Mar 30 16:08 stripe
-brwxr-xr-- 1 root wheel 25, 0 Mar 30 16:08 tinyvol
-drwxrwxrwx 7 root wheel 512 Mar 30 16:08 vol
-brwxr-xr-- 1 root wheel 25, 4 Mar 30 16:08 vol5
-
-/dev/vinum/drive:
-total 0
-brw-r----- 1 root operator 4, 15 Oct 21 16:51 drive2
-brw-r----- 1 root operator 4, 31 Oct 21 16:51 drive4
-
-/dev/vinum/plex:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x10000002 Mar 30 16:08 concat.p0
-brwxr-xr-- 1 root wheel 25, 0x10010002 Mar 30 16:08 concat.p1
-brwxr-xr-- 1 root wheel 25, 0x10000003 Mar 30 16:08 strcon.p0
-brwxr-xr-- 1 root wheel 25, 0x10010003 Mar 30 16:08 strcon.p1
-brwxr-xr-- 1 root wheel 25, 0x10000001 Mar 30 16:08 stripe.p0
-brwxr-xr-- 1 root wheel 25, 0x10000000 Mar 30 16:08 tinyvol.p0
-brwxr-xr-- 1 root wheel 25, 0x10000004 Mar 30 16:08 vol5.p0
-brwxr-xr-- 1 root wheel 25, 0x10010004 Mar 30 16:08 vol5.p1
-
-/dev/vinum/sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20000002 Mar 30 16:08 concat.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100002 Mar 30 16:08 concat.p0.s1
-brwxr-xr-- 1 root wheel 25, 0x20010002 Mar 30 16:08 concat.p1.s0
-brwxr-xr-- 1 root wheel 25, 0x20000003 Mar 30 16:08 strcon.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100003 Mar 30 16:08 strcon.p0.s1
-brwxr-xr-- 1 root wheel 25, 0x20010003 Mar 30 16:08 strcon.p1.s0
-brwxr-xr-- 1 root wheel 25, 0x20110003 Mar 30 16:08 strcon.p1.s1
-brwxr-xr-- 1 root wheel 25, 0x20000001 Mar 30 16:08 stripe.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100001 Mar 30 16:08 stripe.p0.s1
-brwxr-xr-- 1 root wheel 25, 0x20000000 Mar 30 16:08 tinyvol.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100000 Mar 30 16:08 tinyvol.p0.s1
-brwxr-xr-- 1 root wheel 25, 0x20000004 Mar 30 16:08 vol5.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100004 Mar 30 16:08 vol5.p0.s1
-brwxr-xr-- 1 root wheel 25, 0x20010004 Mar 30 16:08 vol5.p1.s0
-brwxr-xr-- 1 root wheel 25, 0x20110004 Mar 30 16:08 vol5.p1.s1
-
-/dev/vinum/vol:
-total 5
-brwxr-xr-- 1 root wheel 25, 2 Mar 30 16:08 concat
-drwxr-xr-x 4 root wheel 512 Mar 30 16:08 concat.plex
-brwxr-xr-- 1 root wheel 25, 3 Mar 30 16:08 strcon
-drwxr-xr-x 4 root wheel 512 Mar 30 16:08 strcon.plex
-brwxr-xr-- 1 root wheel 25, 1 Mar 30 16:08 stripe
-drwxr-xr-x 3 root wheel 512 Mar 30 16:08 stripe.plex
-brwxr-xr-- 1 root wheel 25, 0 Mar 30 16:08 tinyvol
-drwxr-xr-x 3 root wheel 512 Mar 30 16:08 tinyvol.plex
-brwxr-xr-- 1 root wheel 25, 4 Mar 30 16:08 vol5
-drwxr-xr-x 4 root wheel 512 Mar 30 16:08 vol5.plex
-
-/dev/vinum/vol/concat.plex:
-total 2
-brwxr-xr-- 1 root wheel 25, 0x10000002 Mar 30 16:08 concat.p0
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 concat.p0.sd
-brwxr-xr-- 1 root wheel 25, 0x10010002 Mar 30 16:08 concat.p1
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 concat.p1.sd
-
-/dev/vinum/vol/concat.plex/concat.p0.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20000002 Mar 30 16:08 concat.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100002 Mar 30 16:08 concat.p0.s1
-
-/dev/vinum/vol/concat.plex/concat.p1.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20010002 Mar 30 16:08 concat.p1.s0
-
-/dev/vinum/vol/strcon.plex:
-total 2
-brwxr-xr-- 1 root wheel 25, 0x10000003 Mar 30 16:08 strcon.p0
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 strcon.p0.sd
-brwxr-xr-- 1 root wheel 25, 0x10010003 Mar 30 16:08 strcon.p1
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 strcon.p1.sd
-
-/dev/vinum/vol/strcon.plex/strcon.p0.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20000003 Mar 30 16:08 strcon.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100003 Mar 30 16:08 strcon.p0.s1
-
-/dev/vinum/vol/strcon.plex/strcon.p1.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20010003 Mar 30 16:08 strcon.p1.s0
-brwxr-xr-- 1 root wheel 25, 0x20110003 Mar 30 16:08 strcon.p1.s1
-
-/dev/vinum/vol/stripe.plex:
-total 1
-brwxr-xr-- 1 root wheel 25, 0x10000001 Mar 30 16:08 stripe.p0
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 stripe.p0.sd
-
-/dev/vinum/vol/stripe.plex/stripe.p0.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20000001 Mar 30 16:08 stripe.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100001 Mar 30 16:08 stripe.p0.s1
-
-/dev/vinum/vol/tinyvol.plex:
-total 1
-brwxr-xr-- 1 root wheel 25, 0x10000000 Mar 30 16:08 tinyvol.p0
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 tinyvol.p0.sd
-
-/dev/vinum/vol/tinyvol.plex/tinyvol.p0.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20000000 Mar 30 16:08 tinyvol.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100000 Mar 30 16:08 tinyvol.p0.s1
-
-/dev/vinum/vol/vol5.plex:
-total 2
-brwxr-xr-- 1 root wheel 25, 0x10000004 Mar 30 16:08 vol5.p0
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 vol5.p0.sd
-brwxr-xr-- 1 root wheel 25, 0x10010004 Mar 30 16:08 vol5.p1
-drwxr-xr-x 2 root wheel 512 Mar 30 16:08 vol5.p1.sd
-
-/dev/vinum/vol/vol5.plex/vol5.p0.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20000004 Mar 30 16:08 vol5.p0.s0
-brwxr-xr-- 1 root wheel 25, 0x20100004 Mar 30 16:08 vol5.p0.s1
-
-/dev/vinum/vol/vol5.plex/vol5.p1.sd:
-total 0
-brwxr-xr-- 1 root wheel 25, 0x20010004 Mar 30 16:08 vol5.p1.s0
-brwxr-xr-- 1 root wheel 25, 0x20110004 Mar 30 16:08 vol5.p1.s1
-.Ed
-.Pp
-In the case of unattached plexes and subdisks, the naming is reversed.
-Subdisks
-are named after the disk on which they are located, and plexes are named after
-the subdisk.
-.\" XXX
-.Bf -symbolic
-This mapping is still to be determined.
-.Ef
-.Ss Object States
-Each
-.Nm
-object has a
-.Em state
-associated with it.
-.Nm
-uses this state to determine the handling of the object.
-.Ss Volume States
-Volumes may have the following states:
-.Bl -hang -width 14n
-.It Em down
-The volume is completely inaccessible.
-.It Em up
-The volume is up and at least partially functional.
-Not all plexes may be
-available.
-.El
-.Ss "Plex States"
-Plexes may have the following states:
-.Bl -hang -width 14n
-.It Em referenced
-A plex entry which has been referenced as part of a volume, but which is
-currently not known.
-.It Em faulty
-A plex which has gone completely down because of I/O errors.
-.It Em down
-A plex which has been taken down by the administrator.
-.It Em initializing
-A plex which is being initialized.
-.El
-.Pp
-The remaining states represent plexes which are at least partially up.
-.Bl -hang -width 14n
-.It Em corrupt
-A plex entry which is at least partially up.
-Not all subdisks are available,
-and an inconsistency has occurred.
-If no other plex is uncorrupted, the volume
-is no longer consistent.
-.It Em degraded
-A RAID-5 plex entry which is accessible, but one subdisk is down, requiring
-recovery for many I/O requests.
-.It Em flaky
-A plex which is really up, but which has a reborn subdisk which we do not
-completely trust, and which we do not want to read if we can avoid it.
-.It Em up
-A plex entry which is completely up.
-All subdisks are up.
-.El
-.Ss "Subdisk States"
-Subdisks can have the following states:
-.Bl -hang -width 14n
-.It Em empty
-A subdisk entry which has been created completely.
-All fields are correct, and
-the disk has been updated, but the on the disk is not valid.
-.It Em referenced
-A subdisk entry which has been referenced as part of a plex, but which is
-currently not known.
-.It Em initializing
-A subdisk entry which has been created completely and which is currently being
-initialized.
-.El
-.Pp
-The following states represent invalid data.
-.Bl -hang -width 14n
-.It Em obsolete
-A subdisk entry which has been created completely.
-All fields are correct, the
-config on disk has been updated, and the data was valid, but since then the
-drive has been taken down, and as a result updates have been missed.
-.It Em stale
-A subdisk entry which has been created completely.
-All fields are correct, the
-disk has been updated, and the data was valid, but since then the drive has been
-crashed and updates have been lost.
-.El
-.Pp
-The following states represent valid, inaccessible data.
-.Bl -hang -width 14n
-.It Em crashed
-A subdisk entry which has been created completely.
-All fields are correct, the
-disk has been updated, and the data was valid, but since then the drive has gone
-down.
-No attempt has been made to write to the subdisk since the crash, so the
-data is valid.
-.It Em down
-A subdisk entry which was up, which contained valid data, and which was taken
-down by the administrator.
-The data is valid.
-.It Em reviving
-The subdisk is currently in the process of being revived.
-We can write but not
-read.
-.El
-.Pp
-The following states represent accessible subdisks with valid data.
-.Bl -hang -width 14n
-.It Em reborn
-A subdisk entry which has been created completely.
-All fields are correct, the
-disk has been updated, and the data was valid, but since then the drive has gone
-down and up again.
-No updates were lost, but it is possible that the subdisk
-has been damaged.
-We will not read from this subdisk if we have a choice.
-If this
-is the only subdisk which covers this address space in the plex, we set its
-state to up under these circumstances, so this status implies that there is
-another subdisk to fulfill the request.
-.It Em up
-A subdisk entry which has been created completely.
-All fields are correct, the
-disk has been updated, and the data is valid.
-.El
-.Ss "Drive States"
-Drives can have the following states:
-.Bl -hang -width 14n
-.It Em referenced
-At least one subdisk refers to the drive, but it is not currently accessible to
-the system.
-No device name is known.
-.It Em down
-The drive is not accessible.
-.It Em up
-The drive is up and running.
-.El
-.Sh SEE ALSO
-.Xr loader.conf 5 ,
-.Xr disklabel 8 ,
-.Xr gvinum 8 ,
-.Xr loader 8 ,
-.Xr newfs 8
-.Sh HISTORY
-.Nm
-first appeared in
-.Fx 3.0 .
-The RAID-5 component of
-.Nm
-was developed by Cybernet Inc.\&
-.Pq Pa http://www.cybernet.com/ ,
-for its NetMAX product.
-.Sh AUTHORS
-.An Greg Lehey Aq grog@lemis.com .
-.Sh BUGS
-.Nm
-is a new product.
-Bugs can be expected.
-The configuration mechanism is not yet
-fully functional.
-If you have difficulties, please look at the section
-.Sx "DEBUGGING PROBLEMS WITH VINUM"
-before reporting problems.
-.Pp
-Kernels with the
-.Nm
-device appear to work, but are not supported.
-If you have trouble with
-this configuration, please first replace the kernel with a
-.No non- Ns Nm
-kernel and test with the KLD module.
-.Pp
-Detection of differences between the version of the kernel and the KLD is not
-yet implemented.
-.Pp
-The RAID-5 functionality is new in
-.Fx 3.3 .
-Some problems have been
-reported with
-.Nm
-in combination with soft updates, but these are not reproducible on all
-systems.
-If you are planning to use
-.Nm
-in a production environment, please test carefully.
-.Sh DEBUGGING PROBLEMS WITH VINUM
-Solving problems with
-.Nm
-can be a difficult affair.
-This section suggests some approaches.
-.Ss Configuration problems
-It is relatively easy (too easy) to run into problems with the
-.Nm
-configuration.
-If you do, the first thing you should do is stop configuration
-updates:
-.Pp
-.Dl "vinum setdaemon 4"
-.Pp
-This will stop updates and any further corruption of the on-disk configuration.
-.Pp
-Next, look at the on-disk configuration, using a Bourne-style shell:
-.Bd -literal
-rm -f log
-for i in /dev/da0s1h /dev/da1s1h /dev/da2s1h /dev/da3s1h; do
- (dd if=$i skip=8 count=6|tr -d '\e000-\e011\e200-\e377'; echo) >> log
-done
-.Ed
-.Pp
-The names of the devices are the names of all
-.Nm
-slices.
-The file
-.Pa log
-should then contain something like this:
-.Bd -literal
-.if t .ps -3
-.if t .vs -3
-IN VINOpanic.lemis.comdrive1}6E7~^K6T^Yfoovolume obj state up
-volume src state up
-volume raid state down
-volume r state down
-volume foo state up
-plex name obj.p0 state corrupt org concat vol obj
-plex name obj.p1 state corrupt org striped 128b vol obj
-plex name src.p0 state corrupt org striped 128b vol src
-plex name src.p1 state up org concat vol src
-plex name raid.p0 state faulty org disorg vol raid
-plex name r.p0 state faulty org disorg vol r
-plex name foo.p0 state up org concat vol foo
-plex name foo.p1 state faulty org concat vol foo
-sd name obj.p0.s0 drive drive2 plex obj.p0 state reborn len 409600b driveoffset 265b plexoffset 0b
-sd name obj.p0.s1 drive drive4 plex obj.p0 state up len 409600b driveoffset 265b plexoffset 409600b
-sd name obj.p1.s0 drive drive1 plex obj.p1 state up len 204800b driveoffset 265b plexoffset 0b
-sd name obj.p1.s1 drive drive2 plex obj.p1 state reborn len 204800b driveoffset 409865b plexoffset 128b
-sd name obj.p1.s2 drive drive3 plex obj.p1 state up len 204800b driveoffset 265b plexoffset 256b
-sd name obj.p1.s3 drive drive4 plex obj.p1 state up len 204800b driveoffset 409865b plexoffset 384b
-.if t .vs
-.if t .ps
-.Ed
-.Pp
-The first line contains the
-.Nm
-label and must start with the text
-.Dq Li "IN VINO" .
-It also contains the name of the system.
-The exact definition is contained in
-.Pa /usr/src/sys/dev/vinum/vinumvar.h .
-The saved configuration starts in the middle of the line with the text
-.Dq Li "volume obj state up"
-and starts in sector 9 of the disk.
-The rest of the output shows the remainder of the on-disk configuration.
-It
-may be necessary to increase the
-.Cm count
-argument of
-.Xr dd 1
-in order to see the complete configuration.
-.Pp
-The configuration on all disks should be the same.
-If this is not the case,
-please report the problem with the exact contents of the file
-.Pa log .
-There is probably little that can be done to recover the on-disk configuration,
-but if you keep a copy of the files used to create the objects, you should be
-able to re-create them.
-The
-.Ic create
-command does not change the subdisk data, so this will not cause data
-corruption.
-You may need to use the
-.Ic resetconfig
-command if you have this kind of trouble.
-.Ss Kernel Panics
-In order to analyse a panic which you suspect comes from
-.Nm
-you will need to build a debug kernel.
-See the online handbook at
-.Pa /usr/share/doc/en/books/developers-handbook/kerneldebug.html
-(if installed) or
-.Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-\%handbook/kerneldebug.html
-for more details of how to do this.
-.Pp
-Perform the following steps to analyse a
-.Nm
-problem:
-.Bl -enum
-.It
-Copy the following files to the directory in which you will be
-performing the analysis, typically
-.Pa /var/crash :
-.Pp
-.Bl -bullet -compact
-.It
-.Pa /usr/src/sys/modules/vinum/.gdbinit.crash ,
-.It
-.Pa /usr/src/sys/modules/vinum/.gdbinit.kernel ,
-.It
-.Pa /usr/src/sys/modules/vinum/.gdbinit.serial ,
-.It
-.Pa /usr/src/sys/modules/vinum/.gdbinit.vinum
-and
-.It
-.Pa /usr/src/sys/modules/vinum/.gdbinit.vinum.paths
-.El
-.It
-Make sure that you build the
-.Nm
-module with debugging information.
-The standard
-.Pa Makefile
-builds a module with debugging symbols by default.
-If the version of
-.Nm
-in
-.Pa /boot/kernel
-does not contain symbols, you will not get an error message, but the stack trace
-will not show the symbols.
-Check the module before starting
-.Xr gdb 1 :
-.Bd -literal
-$ file /boot/kernel/vinum.ko
-/boot/kernel/vinum.ko: ELF 32-bit LSB shared object, Intel 80386,
- version 1 (FreeBSD), not stripped
-.Ed
-.Pp
-If the output shows that
-.Pa /boot/kernel/vinum.ko
-is stripped, you will have to find a version which is not.
-Usually this will be
-either in
-.Pa /usr/obj/sys/modules/vinum/vinum.ko
-(if you have built
-.Nm
-with a
-.Dq Li "make world" )
-or
-.Pa /usr/src/sys/modules/vinum/vinum.ko
-(if you have built
-.Nm
-in this directory).
-Modify the file
-.Pa .gdbinit.vinum.paths
-accordingly.
-.It
-Either take a dump or use remote serial
-.Xr gdb 1
-to analyse the problem.
-To analyse a dump, say
-.Pa /var/crash/vmcore.5 ,
-link
-.Pa /var/crash/.gdbinit.crash
-to
-.Pa /var/crash/.gdbinit
-and enter:
-.Bd -literal -offset indent
-cd /var/crash
-gdb -k kernel.debug vmcore.5
-.Ed
-.Pp
-This example assumes that you have installed the correct debug kernel at
-.Pa /var/crash/kernel.debug .
-If not, substitute the correct name of the debug kernel.
-.Pp
-To perform remote serial debugging,
-link
-.Pa /var/crash/.gdbinit.serial
-to
-.Pa /var/crash/.gdbinit
-and enter
-.Bd -literal -offset indent
-cd /var/crash
-gdb -k kernel.debug
-.Ed
-.Pp
-In this case, the
-.Pa .gdbinit
-file performs the functions necessary to establish connection.
-The remote
-machine must already be in debug mode: enter the kernel debugger and select
-.Ic gdb
-(see
-.Xr ddb 4
-for more details).
-The serial
-.Pa .gdbinit
-file expects the serial connection to run at 38400 bits per second; if you run
-at a different speed, edit the file accordingly (look for the
-.Va remotebaud
-specification).
-.Pp
-The following example shows a remote debugging session using the
-.Ic debug
-command of
-.Xr gvinum 8 :
-.Bd -literal
-.if t .ps -3
-.if t .vs -3
-GDB 4.16 (i386-unknown-freebsd), Copyright 1996 Free Software Foundation, Inc.
-Debugger (msg=0xf1093174 "vinum debug") at ../../i386/i386/db_interface.c:318
-318 in_Debugger = 0;
-#1 0xf108d9bc in vinumioctl (dev=0x40001900, cmd=0xc008464b, data=0xf6dedee0 "",
- flag=0x3, p=0xf68b7940) at
- /usr/src/sys/modules/Vinum/../../dev/Vinum/vinumioctl.c:102
-102 Debugger ("vinum debug");
-(kgdb) bt
-#0 Debugger (msg=0xf0f661ac "vinum debug") at ../../i386/i386/db_interface.c:318
-#1 0xf0f60a7c in vinumioctl (dev=0x40001900, cmd=0xc008464b, data=0xf6923ed0 "",
- flag=0x3, p=0xf688e6c0) at
- /usr/src/sys/modules/vinum/../../dev/vinum/vinumioctl.c:109
-#2 0xf01833b7 in spec_ioctl (ap=0xf6923e0c) at ../../miscfs/specfs/spec_vnops.c:424
-#3 0xf0182cc9 in spec_vnoperate (ap=0xf6923e0c) at ../../miscfs/specfs/spec_vnops.c:129
-#4 0xf01eb3c1 in ufs_vnoperatespec (ap=0xf6923e0c) at ../../ufs/ufs/ufs_vnops.c:2312
-#5 0xf017dbb1 in vn_ioctl (fp=0xf1007ec0, com=0xc008464b, data=0xf6923ed0 "",
- p=0xf688e6c0) at vnode_if.h:395
-#6 0xf015dce0 in ioctl (p=0xf688e6c0, uap=0xf6923f84) at ../../kern/sys_generic.c:473
-#7 0xf0214c0b in syscall (frame={tf_es = 0x27, tf_ds = 0x27, tf_edi = 0xefbfcff8,
- tf_esi = 0x1, tf_ebp = 0xefbfcf90, tf_isp = 0xf6923fd4, tf_ebx = 0x2,
- tf_edx = 0x804b614, tf_ecx = 0x8085d10, tf_eax = 0x36, tf_trapno = 0x7,
- tf_err = 0x2, tf_eip = 0x8060a34, tf_cs = 0x1f, tf_eflags = 0x286,
- tf_esp = 0xefbfcf78, tf_ss = 0x27}) at ../../i386/i386/trap.c:1100
-#8 0xf020a1fc in Xint0x80_syscall ()
-#9 0x804832d in ?? ()
-#10 0x80482ad in ?? ()
-#11 0x80480e9 in ?? ()
-.if t .vs
-.if t .ps
-.Ed
-.Pp
-When entering from the debugger, it is important that the source of frame 1
-(listed by the
-.Pa .gdbinit
-file at the top of the example) contains the text
-.Dq Li "Debugger (\*[q]vinum debug\*[q]);" .
-.Pp
-This is an indication that the address specifications are correct.
-If you get
-some other output, your symbols and the kernel module are out of sync, and the
-trace will be meaningless.
-.El
-.Pp
-For an initial investigation, the most important information is the output of
-the
-.Ic bt
-(backtrace) command above.
-.Ss Reporting Problems with Vinum
-If you find any bugs in
-.Nm ,
-please report them to
-.An Greg Lehey Aq grog@lemis.com .
-Supply the following
-information:
-.Bl -bullet
-.It
-The output of the
-.Nm vinum Cm list
-command
-(see
-.Xr gvinum 8 ) .
-.It
-Any messages printed in
-.Pa /var/log/messages .
-All such messages will be identified by the text
-.Dq Li vinum
-at the beginning.
-.It
-If you have a panic, a stack trace as described above.
-.El
diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree
index 7d4df68..47a41bd 100644
--- a/share/misc/bsd-family-tree
+++ b/share/misc/bsd-family-tree
@@ -252,12 +252,14 @@ FreeBSD 5.2 | | | |
| | | | OpenBSD 5.0 |
*--FreeBSD | | | | |
| 9.0 | | | | DragonFly 3.0.1
- | v FreeBSD | | | |
- | 8.3 | | OpenBSD 5.1 |
- | Mac OS X | | |
- | 10.8 | | |
- | | NetBSD 6.0 | |
- | | | OpenBSD 5.2 DragonFly 3.2.1
+ | | FreeBSD | | | |
+ | | 8.3 | | OpenBSD 5.1 |
+ | | Mac OS X | | |
+ | | 10.8 | | |
+ | | | NetBSD 6.0 | |
+ | | | | OpenBSD 5.2 DragonFly 3.2.1
+ | FreeBSD | | | |
+ | 9.1 | | | |
| | | | |
FreeBSD 10 -current | NetBSD -current OpenBSD -current |
| | | | |
@@ -555,6 +557,7 @@ Mac OS X 10.8 2012-07-25 [APL]
NetBSD 6.0 2012-10-17 [NBD]
OpenBSD 5.2 2012-11-01 [OBD]
DragonFly 3.2.1 2012-11-02 [DFB]
+FreeBSD 9.1 2012-12-30 [FBD]
Bibliography
------------------------
diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot
index 0d755d0..1f95fc5 100644
--- a/share/misc/committers-ports.dot
+++ b/share/misc/committers-ports.dot
@@ -171,7 +171,7 @@ philip [label="Philip Paeps\nphilip@FreeBSD.org\n2005/10/19"]
rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/23"]
rakuco [label="Raphael Kubo da Costa\nrakuco@FreeBSD.org\n2011/08/22"]
rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"]
-rm [label="Ruslan Mahmatkhanov\nrm@FreeBSD.org\n2011/11/06"]
+rm [label="Ruslan Makhmatkhanov\nrm@FreeBSD.org\n2011/11/06"]
rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/07/21"]
romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"]
sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"]
diff --git a/share/misc/organization.dot b/share/misc/organization.dot
index 8561875..84b9014 100644
--- a/share/misc/organization.dot
+++ b/share/misc/organization.dot
@@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\npgj"]
doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"]
doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"]
portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"]
-portmgr [label="Port Management Team\nportmgr@FreeBSD.org\ntabthorpe, marcus, bapt, beat,\nerwin, linimon, pav,\nitetcu, miwi"]
+portmgr [label="Port Management Team\nportmgr@FreeBSD.org\ntabthorpe, marcus, bapt,\nerwin, bdrewery,\nitetcu, miwi"]
portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\ntabthorpe"]
re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"]
secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"]
@@ -43,13 +43,12 @@ srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"]
accounts [label="Accounts Team\naccounts@FreeBSD.org\nmarkm, simon, kensmith,\ndhw"]
backups [label="Backup Administrators\nbackups@FreeBSD.org\nsimon, kensmith,\ndhw"]
-bugmeister [label="Bugmeister Team\nbugmeister@FreeBSD.org\neadler, gavin, gonzo, linimon"]
+bugmeister [label="Bugmeister Team\nbugmeister@FreeBSD.org\neadler, gavin, gonzo"]
clusteradm [label="Cluster Administrators\nclusteradm@FreeBSD.org\nbrd, simon, ps,\nkensmith, peter"]
cvsupmaster [label="CVSup Mirror Site Coordinators\ncvsup-master@FreeBSD.org\nkuriyama, jdp,\nkensmith"]
dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\nbillf, dg, ps,\nkensmith, peter"]
mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nkuriyama, kensmith"]
ncvs [label="CVS src Repository Managers\nncvs@FreeBSD.org\njoe, kuriyama, markm,\nsimon, peter"]
-pcvs [label="CVS ports Repository Managers\npcvs@FreeBSD.org\nmarcus, joe, kuriyama,\nmarkm, simon"]
perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"]
postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\njmb, brd, sahil, dhw"]
refadm [label="Reference Systems Administrators\nrefadm@FreeBSD.org\njake, billf, markm, simon,\nobrien, ps, kensmith,\npeter, dhw"]
@@ -70,8 +69,6 @@ _admin -> backups
_admin -> bugmeister
_admin -> clusteradm
_admin -> ncvs
-_admin -> pcvs
-_admin -> dcvs
_admin -> cvsupmaster
_admin -> dnsadm
_admin -> mirroradmin
diff --git a/sys/Makefile b/sys/Makefile
index ca06522..46c95d4 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -10,7 +10,7 @@ SUBDIR= boot
# Directories to include in cscope name file and TAGS.
CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \
geom gnu isa kern libkern modules net net80211 netatalk \
- netgraph netinet netinet6 netipsec netipx netnatm netncp \
+ netgraph netinet netinet6 netipsec netipx netnatm \
netsmb nfs nfsclient nfsserver nlm ofed opencrypto \
pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR}
.if !defined(CSCOPE_ARCHDIR)
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 10481a7..55d2cff 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -131,6 +131,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_extern.h>
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
+#include <vm/vm_radix.h>
#include <vm/vm_reserv.h>
#include <vm/uma.h>
@@ -669,7 +670,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
*/
PMAP_LOCK_INIT(kernel_pmap);
kernel_pmap->pm_pml4 = (pdp_entry_t *)PHYS_TO_DMAP(KPML4phys);
- kernel_pmap->pm_root = NULL;
CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvchunk);
@@ -1498,7 +1498,8 @@ pmap_free_zero_pages(vm_page_t free)
while (free != NULL) {
m = free;
- free = m->right;
+ free = (void *)m->object;
+ m->object = NULL;
/* Preserve the page's PG_ZERO setting. */
vm_page_free_toq(m);
}
@@ -1517,7 +1518,7 @@ pmap_add_delayed_free_list(vm_page_t m, vm_page_t *free, boolean_t set_PG_ZERO)
m->flags |= PG_ZERO;
else
m->flags &= ~PG_ZERO;
- m->right = *free;
+ m->object = (void *)*free;
*free = m;
}
@@ -1527,31 +1528,12 @@ pmap_add_delayed_free_list(vm_page_t m, vm_page_t *free, boolean_t set_PG_ZERO)
* for mapping a distinct range of virtual addresses. The pmap's collection is
* ordered by this virtual address range.
*/
-static void
+static __inline void
pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte)
{
- vm_page_t root;
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- root = pmap->pm_root;
- if (root == NULL) {
- mpte->left = NULL;
- mpte->right = NULL;
- } else {
- root = vm_page_splay(mpte->pindex, root);
- if (mpte->pindex < root->pindex) {
- mpte->left = root->left;
- mpte->right = root;
- root->left = NULL;
- } else if (mpte->pindex == root->pindex)
- panic("pmap_insert_pt_page: pindex already inserted");
- else {
- mpte->right = root->right;
- mpte->left = root;
- root->right = NULL;
- }
- }
- pmap->pm_root = mpte;
+ vm_radix_insert(&pmap->pm_root, mpte);
}
/*
@@ -1559,19 +1541,12 @@ pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte)
* specified pmap's collection of idle page table pages. Returns NULL if there
* is no page table page corresponding to the specified virtual address.
*/
-static vm_page_t
+static __inline vm_page_t
pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va)
{
- vm_page_t mpte;
- vm_pindex_t pindex = pmap_pde_pindex(va);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- if ((mpte = pmap->pm_root) != NULL && mpte->pindex != pindex) {
- mpte = vm_page_splay(pindex, mpte);
- if ((pmap->pm_root = mpte)->pindex != pindex)
- mpte = NULL;
- }
- return (mpte);
+ return (vm_radix_lookup(&pmap->pm_root, pmap_pde_pindex(va)));
}
/*
@@ -1579,25 +1554,12 @@ pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va)
* of idle page table pages. The specified page table page must be a member of
* the pmap's collection.
*/
-static void
+static __inline void
pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte)
{
- vm_page_t root;
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- if (mpte != pmap->pm_root) {
- root = vm_page_splay(mpte->pindex, pmap->pm_root);
- KASSERT(mpte == root,
- ("pmap_remove_pt_page: mpte %p is missing from pmap %p",
- mpte, pmap));
- }
- if (mpte->left == NULL)
- root = mpte->right;
- else {
- root = vm_page_splay(mpte->pindex, mpte->left);
- root->right = mpte->right;
- }
- pmap->pm_root = root;
+ vm_radix_remove(&pmap->pm_root, mpte->pindex);
}
/*
@@ -1694,7 +1656,7 @@ pmap_pinit0(pmap_t pmap)
PMAP_LOCK_INIT(pmap);
pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys);
- pmap->pm_root = NULL;
+ pmap->pm_root.rt_root = 0;
CPU_ZERO(&pmap->pm_active);
PCPU_SET(curpmap, pmap);
TAILQ_INIT(&pmap->pm_pvchunk);
@@ -1735,7 +1697,7 @@ pmap_pinit(pmap_t pmap)
/* install self-referential address mapping entry(s) */
pmap->pm_pml4[PML4PML4I] = VM_PAGE_TO_PHYS(pml4pg) | PG_V | PG_RW | PG_A | PG_M;
- pmap->pm_root = NULL;
+ pmap->pm_root.rt_root = 0;
CPU_ZERO(&pmap->pm_active);
TAILQ_INIT(&pmap->pm_pvchunk);
bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
@@ -1977,7 +1939,7 @@ pmap_release(pmap_t pmap)
KASSERT(pmap->pm_stats.resident_count == 0,
("pmap_release: pmap resident count %ld != 0",
pmap->pm_stats.resident_count));
- KASSERT(pmap->pm_root == NULL,
+ KASSERT(vm_radix_is_empty(&pmap->pm_root),
("pmap_release: pmap has reserved page table page(s)"));
m = PHYS_TO_VM_PAGE(pmap->pm_pml4[PML4PML4I] & PG_FRAME);
@@ -2274,7 +2236,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp)
}
if (m_pc == NULL && free != NULL) {
m_pc = free;
- free = m_pc->right;
+ free = (void *)m_pc->object;
/* Recycle a freed page table page. */
m_pc->wire_count = 1;
atomic_add_int(&cnt.v_wire_count, 1);
@@ -4273,6 +4235,30 @@ pmap_copy_page(vm_page_t msrc, vm_page_t mdst)
pagecopy((void *)src, (void *)dst);
}
+void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+ void *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ while (xfersize > 0) {
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ a_cp = (char *)PHYS_TO_DMAP(ma[a_offset >> PAGE_SHIFT]->
+ phys_addr) + a_pg_offset;
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ b_cp = (char *)PHYS_TO_DMAP(mb[b_offset >> PAGE_SHIFT]->
+ phys_addr) + b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+}
+
/*
* Returns true if the pmap's pv is one of the first
* 16 pvs linked to from this page. This count may
diff --git a/sys/amd64/include/pmap.h b/sys/amd64/include/pmap.h
index 0fc8867..6d76ec3 100644
--- a/sys/amd64/include/pmap.h
+++ b/sys/amd64/include/pmap.h
@@ -150,6 +150,8 @@
#include <sys/_lock.h>
#include <sys/_mutex.h>
+#include <vm/_vm_radix.h>
+
typedef u_int64_t pd_entry_t;
typedef u_int64_t pt_entry_t;
typedef u_int64_t pdp_entry_t;
@@ -250,7 +252,7 @@ struct pmap {
cpuset_t pm_active; /* active on cpus */
/* spare u_int here due to padding */
struct pmap_statistics pm_stats; /* pmap statistics */
- vm_page_t pm_root; /* spare page table pages */
+ struct vm_radix pm_root; /* spare page table pages */
};
typedef struct pmap *pmap_t;
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 287ac8c..8db79ce 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -153,10 +153,7 @@ static int cap_unrestricted_guest;
static int cap_monitor_trap;
/* statistics */
-static VMM_STAT_DEFINE(VCPU_MIGRATIONS, "vcpu migration across host cpus");
-static VMM_STAT_DEFINE(VMEXIT_EXTINT, "vm exits due to external interrupt");
-static VMM_STAT_DEFINE(VMEXIT_HLT_IGNORED, "number of times hlt was ignored");
-static VMM_STAT_DEFINE(VMEXIT_HLT, "number of times hlt was intercepted");
+static VMM_STAT_INTEL(VMEXIT_HLT_IGNORED, "number of times hlt was ignored");
#ifdef KTR
static const char *
@@ -1216,6 +1213,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
qual = vmexit->u.vmx.exit_qualification;
vmexit->exitcode = VM_EXITCODE_BOGUS;
+ vmm_stat_incr(vmx->vm, vcpu, VMEXIT_COUNT, 1);
+
switch (vmexit->u.vmx.exit_reason) {
case EXIT_REASON_CR_ACCESS:
handled = vmx_emulate_cr_access(vmx, vcpu, qual);
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index 85d277e..1de4470 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -139,7 +139,7 @@ static MALLOC_DEFINE(M_VM, "vm", "vm");
CTASSERT(VMM_MSR_NUM <= 64); /* msr_mask can keep track of up to 64 msrs */
/* statistics */
-static VMM_STAT_DEFINE(VCPU_TOTAL_RUNTIME, "vcpu total runtime");
+static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcpu total runtime");
static void
vcpu_cleanup(struct vcpu *vcpu)
@@ -612,7 +612,7 @@ save_guest_fpustate(struct vcpu *vcpu)
fpu_start_emulating();
}
-static VMM_STAT_DEFINE(VCPU_IDLE_TICKS, "number of ticks vcpu was idle");
+static VMM_STAT(VCPU_IDLE_TICKS, "number of ticks vcpu was idle");
int
vm_run(struct vm *vm, struct vm_run *vmrun)
@@ -717,7 +717,7 @@ vm_inject_event(struct vm *vm, int vcpuid, int type,
return (VMINJECT(vm->cookie, vcpuid, type, vector, code, code_valid));
}
-static VMM_STAT_DEFINE(VCPU_NMI_COUNT, "number of NMIs delivered to vcpu");
+static VMM_STAT(VCPU_NMI_COUNT, "number of NMIs delivered to vcpu");
int
vm_inject_nmi(struct vm *vm, int vcpuid)
@@ -937,7 +937,7 @@ vm_set_x2apic_state(struct vm *vm, int vcpuid, enum x2apic_state state)
if (vcpuid < 0 || vcpuid >= VM_MAXCPU)
return (EINVAL);
- if (state < 0 || state >= X2APIC_STATE_LAST)
+ if (state >= X2APIC_STATE_LAST)
return (EINVAL);
vm->vcpu[vcpuid].x2apic_state = state;
diff --git a/sys/amd64/vmm/vmm_stat.c b/sys/amd64/vmm/vmm_stat.c
index ae60979..ae156ee 100644
--- a/sys/amd64/vmm/vmm_stat.c
+++ b/sys/amd64/vmm/vmm_stat.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/smp.h>
#include <machine/vmm.h>
+#include "vmm_util.h"
#include "vmm_stat.h"
static int vstnum;
@@ -52,6 +53,12 @@ vmm_stat_init(void *arg)
if (vst->desc == NULL)
return;
+ if (vst->scope == VMM_STAT_SCOPE_INTEL && !vmm_is_intel())
+ return;
+
+ if (vst->scope == VMM_STAT_SCOPE_AMD && !vmm_is_amd())
+ return;
+
if (vstnum >= MAX_VMM_STAT_TYPES) {
printf("Cannot accomodate vmm stat type \"%s\"!\n", vst->desc);
return;
@@ -102,3 +109,9 @@ vmm_stat_desc(int index)
else
return (NULL);
}
+
+/* global statistics */
+VMM_STAT(VCPU_MIGRATIONS, "vcpu migration across host cpus");
+VMM_STAT(VMEXIT_COUNT, "total number of vm exits");
+VMM_STAT(VMEXIT_EXTINT, "vm exits due to external interrupt");
+VMM_STAT(VMEXIT_HLT, "number of times hlt was intercepted");
diff --git a/sys/amd64/vmm/vmm_stat.h b/sys/amd64/vmm/vmm_stat.h
index 7c075a6..a1c0967 100644
--- a/sys/amd64/vmm/vmm_stat.h
+++ b/sys/amd64/vmm/vmm_stat.h
@@ -36,19 +36,36 @@ struct vm;
#define MAX_VMM_STAT_TYPES 64 /* arbitrary */
+enum vmm_stat_scope {
+ VMM_STAT_SCOPE_ANY,
+ VMM_STAT_SCOPE_INTEL, /* Intel VMX specific statistic */
+ VMM_STAT_SCOPE_AMD, /* AMD SVM specific statistic */
+};
+
struct vmm_stat_type {
- const char *desc; /* description of statistic */
int index; /* position in the stats buffer */
+ const char *desc; /* description of statistic */
+ enum vmm_stat_scope scope;
};
void vmm_stat_init(void *arg);
-#define VMM_STAT_DEFINE(type, desc) \
+#define VMM_STAT_DEFINE(type, desc, scope) \
struct vmm_stat_type type[1] = { \
- { desc, -1 } \
+ { -1, desc, scope } \
}; \
SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_init, type)
+#define VMM_STAT_DECLARE(type) \
+ extern struct vmm_stat_type type[1]
+
+#define VMM_STAT(type, desc) \
+ VMM_STAT_DEFINE(type, desc, VMM_STAT_SCOPE_ANY)
+#define VMM_STAT_INTEL(type, desc) \
+ VMM_STAT_DEFINE(type, desc, VMM_STAT_SCOPE_INTEL)
+#define VMM_STAT_AMD(type, desc) \
+ VMM_STAT_DEFINE(type, desc, VMM_STAT_SCOPE_AMD)
+
void *vmm_stat_alloc(void);
void vmm_stat_free(void *vp);
@@ -68,4 +85,8 @@ vmm_stat_incr(struct vm *vm, int vcpu, struct vmm_stat_type *vst, uint64_t x)
#endif
}
+VMM_STAT_DECLARE(VCPU_MIGRATIONS);
+VMM_STAT_DECLARE(VMEXIT_COUNT);
+VMM_STAT_DECLARE(VMEXIT_EXTINT);
+VMM_STAT_DECLARE(VMEXIT_HLT);
#endif
diff --git a/sys/arm/arm/bcopy_page.S b/sys/arm/arm/bcopy_page.S
index 27921d4..92e38cc 100644
--- a/sys/arm/arm/bcopy_page.S
+++ b/sys/arm/arm/bcopy_page.S
@@ -117,6 +117,7 @@ ENTRY(bcopy_page)
bne 1b
RESTORE_REGS /* ...and return. */
+END(bcopy_page)
/*
* bzero_page(dest)
@@ -178,6 +179,7 @@ ENTRY(bzero_page)
bne 1b
ldmfd sp!, {r4-r8, pc}
+END(bzero_page)
#else /* _ARM_ARCH_5E */
@@ -246,6 +248,7 @@ ENTRY(bcopy_page)
bgt 1b
ldmfd sp!, {r4, r5}
RET
+END(bcopy_page)
/*
* armv5e version of bzero_page
@@ -273,4 +276,5 @@ ENTRY(bzero_page)
subs r1, r1, #128
bne 1b
RET
+END(bzero_page)
#endif /* _ARM_ARCH_5E */
diff --git a/sys/arm/arm/bcopyinout.S b/sys/arm/arm/bcopyinout.S
index 992d0d7..68fdf20 100644
--- a/sys/arm/arm/bcopyinout.S
+++ b/sys/arm/arm/bcopyinout.S
@@ -312,6 +312,7 @@ ENTRY(copyin)
RESTORE_REGS
RET
+END(copyin)
/*
* r0 = kernel space address
@@ -538,6 +539,7 @@ ENTRY(copyout)
RESTORE_REGS
RET
+END(copyout)
#endif
/*
@@ -564,6 +566,7 @@ ENTRY(badaddr_read_1)
mov r0, #0 /* No fault */
1: str ip, [r2, #PCB_ONFAULT]
RET
+END(badaddr_read_1)
/*
* int badaddr_read_2(const uint16_t *src, uint16_t *dest)
@@ -589,6 +592,7 @@ ENTRY(badaddr_read_2)
mov r0, #0 /* No fault */
1: str ip, [r2, #PCB_ONFAULT]
RET
+END(badaddr_read_2)
/*
* int badaddr_read_4(const uint32_t *src, uint32_t *dest)
@@ -614,4 +618,5 @@ ENTRY(badaddr_read_4)
mov r0, #0 /* No fault */
1: str ip, [r2, #PCB_ONFAULT]
RET
+END(badaddr_read_4)
diff --git a/sys/arm/arm/bcopyinout_xscale.S b/sys/arm/arm/bcopyinout_xscale.S
index a2853cc..2cb98d9 100644
--- a/sys/arm/arm/bcopyinout_xscale.S
+++ b/sys/arm/arm/bcopyinout_xscale.S
@@ -492,7 +492,7 @@ ENTRY(copyin)
ldrbt ip, [r0]
strb ip, [r1]
RET
-
+END(copyin)
/*
* r0 = kernel space address
@@ -935,3 +935,5 @@ ENTRY(copyout)
ldrb ip, [r0]
strbt ip, [r1]
RET
+END(copyout)
+
diff --git a/sys/arm/arm/blockio.S b/sys/arm/arm/blockio.S
index 7e750b4..d121f2c 100644
--- a/sys/arm/arm/blockio.S
+++ b/sys/arm/arm/blockio.S
@@ -101,6 +101,7 @@ ENTRY(read_multi_1)
ldrgtb r3, [r0]
strgtb r3, [r1], #1
ldmdb fp, {fp, sp, pc}
+END(read_multi_1)
/*
* Write bytes to an I/O address from a block of memory
@@ -152,6 +153,7 @@ ENTRY(write_multi_1)
ldrgtb r3, [r1], #1
strgtb r3, [r0]
ldmdb fp, {fp, sp, pc}
+END(write_multi_1)
/*
* Reads short ints (16 bits) from an I/O address into a block of memory
@@ -199,7 +201,7 @@ ENTRY(insw)
bgt .Lfastinswloop
RET
-
+END(insw)
/*
* Writes short ints (16 bits) from a block of memory to an I/O address
@@ -260,6 +262,7 @@ ENTRY(outsw)
bgt .Lfastoutswloop
RET
+END(outsw)
/*
* reads short ints (16 bits) from an I/O address into a block of memory
@@ -318,7 +321,7 @@ ENTRY(insw16)
bgt .Linsw16loop
ldmfd sp!, {r4,r5,pc} /* Restore regs and go home */
-
+END(insw16)
/*
* Writes short ints (16 bits) from a block of memory to an I/O address
@@ -385,6 +388,7 @@ ENTRY(outsw16)
bgt .Loutsw16loop
ldmfd sp!, {r4,r5,pc} /* and go home */
+END(outsw16)
/*
* reads short ints (16 bits) from an I/O address into a block of memory
@@ -481,6 +485,7 @@ ENTRY(inswm8)
.Linswm8_l1:
ldmfd sp!, {r4-r9,pc} /* And go home */
+END(inswm8)
/*
* write short ints (16 bits) to an I/O address from a block of memory
@@ -585,3 +590,5 @@ ENTRY(outswm8)
.Loutswm8_l1:
ldmfd sp!, {r4-r8,pc} /* And go home */
+END(outswm8)
+
diff --git a/sys/arm/arm/bus_space_asm_generic.S b/sys/arm/arm/bus_space_asm_generic.S
index 2492474..4aa7197 100644
--- a/sys/arm/arm/bus_space_asm_generic.S
+++ b/sys/arm/arm/bus_space_asm_generic.S
@@ -50,14 +50,17 @@ __FBSDID("$FreeBSD$");
ENTRY(generic_bs_r_1)
ldrb r0, [r1, r2]
RET
+END(generic_bs_r_1)
ENTRY(generic_armv4_bs_r_2)
ldrh r0, [r1, r2]
RET
+END(generic_armv4_bs_r_2)
ENTRY(generic_bs_r_4)
ldr r0, [r1, r2]
RET
+END(generic_bs_r_4)
/*
* write single
@@ -66,14 +69,17 @@ ENTRY(generic_bs_r_4)
ENTRY(generic_bs_w_1)
strb r3, [r1, r2]
RET
+END(generic_bs_w_1)
ENTRY(generic_armv4_bs_w_2)
strh r3, [r1, r2]
RET
+END(generic_armv4_bs_w_2)
ENTRY(generic_bs_w_4)
str r3, [r1, r2]
RET
+END(generic_bs_w_4)
/*
* read multiple
@@ -92,6 +98,7 @@ ENTRY(generic_bs_rm_1)
bne 1b
RET
+END(generic_bs_rm_1)
ENTRY(generic_armv4_bs_rm_2)
add r0, r1, r2
@@ -106,6 +113,7 @@ ENTRY(generic_armv4_bs_rm_2)
bne 1b
RET
+END(generic_armv4_bs_rm_2)
ENTRY(generic_bs_rm_4)
add r0, r1, r2
@@ -120,6 +128,7 @@ ENTRY(generic_bs_rm_4)
bne 1b
RET
+END(generic_bs_rm_4)
/*
* write multiple
@@ -138,6 +147,7 @@ ENTRY(generic_bs_wm_1)
bne 1b
RET
+END(generic_bs_wm_1)
ENTRY(generic_armv4_bs_wm_2)
add r0, r1, r2
@@ -152,6 +162,7 @@ ENTRY(generic_armv4_bs_wm_2)
bne 1b
RET
+END(generic_armv4_bs_wm_2)
ENTRY(generic_bs_wm_4)
add r0, r1, r2
@@ -166,6 +177,7 @@ ENTRY(generic_bs_wm_4)
bne 1b
RET
+END(generic_bs_wm_4)
/*
* read region
@@ -184,6 +196,7 @@ ENTRY(generic_bs_rr_1)
bne 1b
RET
+END(generic_bs_rr_1)
ENTRY(generic_armv4_bs_rr_2)
add r0, r1, r2
@@ -198,6 +211,7 @@ ENTRY(generic_armv4_bs_rr_2)
bne 1b
RET
+END(generic_armv4_bs_rr_2)
ENTRY(generic_bs_rr_4)
add r0, r1, r2
@@ -212,6 +226,7 @@ ENTRY(generic_bs_rr_4)
bne 1b
RET
+END(generic_bs_rr_4)
/*
* write region.
@@ -230,6 +245,7 @@ ENTRY(generic_bs_wr_1)
bne 1b
RET
+END(generic_bs_wr_1)
ENTRY(generic_armv4_bs_wr_2)
add r0, r1, r2
@@ -244,6 +260,7 @@ ENTRY(generic_armv4_bs_wr_2)
bne 1b
RET
+END(generic_armv4_bs_wr_2)
ENTRY(generic_bs_wr_4)
add r0, r1, r2
@@ -258,6 +275,7 @@ ENTRY(generic_bs_wr_4)
bne 1b
RET
+END(generic_bs_wr_4)
/*
* set region
@@ -275,6 +293,7 @@ ENTRY(generic_bs_sr_1)
bne 1b
RET
+END(generic_bs_sr_1)
ENTRY(generic_armv4_bs_sr_2)
add r0, r1, r2
@@ -288,6 +307,7 @@ ENTRY(generic_armv4_bs_sr_2)
bne 1b
RET
+END(generic_armv4_bs_sr_2)
ENTRY(generic_bs_sr_4)
add r0, r1, r2
@@ -301,6 +321,7 @@ ENTRY(generic_bs_sr_4)
bne 1b
RET
+END(generic_bs_sr_4)
/*
* copy region
@@ -335,3 +356,5 @@ ENTRY(generic_armv4_bs_c_2)
bne 3b
RET
+END(generic_armv4_bs_c_2)
+
diff --git a/sys/arm/arm/copystr.S b/sys/arm/arm/copystr.S
index 9eb8682..83b7ec7 100644
--- a/sys/arm/arm/copystr.S
+++ b/sys/arm/arm/copystr.S
@@ -93,6 +93,7 @@ ENTRY(copystr)
ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */
RET
+END(copystr)
#define SAVE_REGS stmfd sp!, {r4-r6}
#define RESTORE_REGS ldmfd sp!, {r4-r6}
@@ -143,6 +144,7 @@ ENTRY(copyinstr)
RESTORE_REGS
RET
+END(copyinstr)
/*
* r0 - kernel space address
@@ -190,6 +192,7 @@ ENTRY(copyoutstr)
RESTORE_REGS
RET
+END(copyoutstr)
/* A fault occurred during the copy */
.Lcopystrfault:
diff --git a/sys/arm/arm/cpufunc_asm.S b/sys/arm/arm/cpufunc_asm.S
index 1709796..eeff722 100644
--- a/sys/arm/arm/cpufunc_asm.S
+++ b/sys/arm/arm/cpufunc_asm.S
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
ENTRY(cpufunc_nullop)
RET
+END(cpufunc_nullop)
/*
* Generic functions to read the internal coprocessor registers
@@ -64,27 +65,32 @@ ENTRY(cpufunc_nullop)
ENTRY(cpufunc_id)
mrc p15, 0, r0, c0, c0, 0
RET
+END(cpufunc_id)
ENTRY(cpufunc_cpuid)
mrc p15, 0, r0, c0, c0, 0
RET
+END(cpufunc_cpuid)
ENTRY(cpu_get_control)
mrc p15, 0, r0, c1, c0, 0
RET
+END(cpu_get_control)
ENTRY(cpu_read_cache_config)
mrc p15, 0, r0, c0, c0, 1
RET
+END(cpu_read_cache_config)
ENTRY(cpufunc_faultstatus)
mrc p15, 0, r0, c5, c0, 0
RET
+END(cpufunc_faultstatus)
ENTRY(cpufunc_faultaddress)
mrc p15, 0, r0, c6, c0, 0
RET
-
+END(cpufunc_faultaddress)
/*
* Generic functions to write the internal coprocessor registers
@@ -101,11 +107,13 @@ ENTRY(cpufunc_faultaddress)
ENTRY(cpufunc_control)
mcr p15, 0, r0, c1, c0, 0
RET
+END(cpufunc_control)
#endif
ENTRY(cpufunc_domains)
mcr p15, 0, r0, c3, c0, 0
RET
+END(cpufunc_domains)
/*
* Generic functions to read/modify/write the internal coprocessor registers
@@ -131,6 +139,8 @@ ENTRY(cpufunc_control)
.Lglou:
.asciz "plop %p\n"
.align 0
+END(cpufunc_control)
+
/*
* other potentially useful software functions are:
* clean D cache entry and flush I cache entry
@@ -157,6 +167,7 @@ ENTRY(get_pc_str_offset)
ldr r0, [sp]
sub r0, r0, r1
ldmdb fp, {fp, sp, pc}
+END(get_pc_str_offset)
/* Allocate and lock a cacheline for the specified address. */
@@ -180,3 +191,5 @@ ENTRY(arm_lock_cache_line)
mcr p15, 0, r1, c9, c2, 0 /* Disable data cache lock mode */
CPWAIT()
RET
+END(arm_lock_cache_line)
+
diff --git a/sys/arm/arm/cpufunc_asm_arm10.S b/sys/arm/arm/cpufunc_asm_arm10.S
index 2ef999c..654219b 100644
--- a/sys/arm/arm/cpufunc_asm_arm10.S
+++ b/sys/arm/arm/cpufunc_asm_arm10.S
@@ -50,6 +50,7 @@ ENTRY(arm10_setttb)
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
bx lr
+END(arm10_setttb)
/*
* TLB functions
@@ -58,11 +59,12 @@ ENTRY(arm10_tlb_flushID_SE)
mcr p15, 0, r0, c8, c6, 1 /* flush D tlb single entry */
mcr p15, 0, r0, c8, c5, 1 /* flush I tlb single entry */
bx lr
+END(arm10_tlb_flushID_SE)
ENTRY(arm10_tlb_flushI_SE)
mcr p15, 0, r0, c8, c5, 1 /* flush I tlb single entry */
bx lr
-
+END(arm10_tlb_flushI_SE)
/*
* Cache operations. For the entire cache we use the set/index
@@ -90,6 +92,7 @@ ENTRY_NP(arm10_icache_sync_range)
bhi .Larm10_sync_next
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
bx lr
+END(arm10_icache_sync_range)
ENTRY_NP(arm10_icache_sync_all)
.Larm10_icache_sync_all:
@@ -114,6 +117,7 @@ ENTRY_NP(arm10_icache_sync_all)
bhs .Lnext_set /* Next set */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
bx lr
+END(arm10_icache_sync_all)
.Larm10_line_size:
.word _C_LABEL(arm_pdcache_line_size)
@@ -134,6 +138,7 @@ ENTRY(arm10_dcache_wb_range)
bhi .Larm10_wb_next
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
bx lr
+END(arm10_dcache_wb_range)
ENTRY(arm10_dcache_wbinv_range)
ldr ip, .Larm10_line_size
@@ -151,6 +156,7 @@ ENTRY(arm10_dcache_wbinv_range)
bhi .Larm10_wbinv_next
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
bx lr
+END(arm10_dcache_wbinv_range)
/*
* Note, we must not invalidate everything. If the range is too big we
@@ -172,6 +178,7 @@ ENTRY(arm10_dcache_inv_range)
bhi .Larm10_inv_next
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
bx lr
+END(arm10_dcache_inv_range)
ENTRY(arm10_idcache_wbinv_range)
ldr ip, .Larm10_line_size
@@ -190,6 +197,7 @@ ENTRY(arm10_idcache_wbinv_range)
bhi .Larm10_id_wbinv_next
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
bx lr
+END(arm10_idcache_wbinv_range)
ENTRY_NP(arm10_idcache_wbinv_all)
.Larm10_idcache_wbinv_all:
@@ -215,6 +223,8 @@ ENTRY(arm10_dcache_wbinv_all)
bhs .Lnext_set_inv /* Next set */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
bx lr
+END(arm10_idcache_wbinv_all)
+END(arm10_dcache_wbinv_all)
.Larm10_cache_data:
.word _C_LABEL(arm10_dcache_sets_max)
@@ -242,6 +252,7 @@ ENTRY(arm10_context_switch)
nop
nop
bx lr
+END(arm10_context_switch)
.bss
diff --git a/sys/arm/arm/cpufunc_asm_arm11.S b/sys/arm/arm/cpufunc_asm_arm11.S
index b8d8f19..723afc6 100644
--- a/sys/arm/arm/cpufunc_asm_arm11.S
+++ b/sys/arm/arm/cpufunc_asm_arm11.S
@@ -55,6 +55,7 @@ ENTRY(arm11_setttb)
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
RET
+END(arm11_setttb)
/*
* TLB functions
@@ -64,12 +65,13 @@ ENTRY(arm11_tlb_flushID_SE)
mcr p15, 0, r0, c8, c5, 1 /* flush I tlb single entry */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
RET
+END(arm11_tlb_flushID_SE)
ENTRY(arm11_tlb_flushI_SE)
mcr p15, 0, r0, c8, c5, 1 /* flush I tlb single entry */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
RET
-
+END(arm11_tlb_flushI_SE)
/*
* Context switch.
@@ -94,6 +96,7 @@ ENTRY(arm11_context_switch)
nop
nop
RET
+END(arm11_context_switch)
/*
* TLB functions
@@ -102,21 +105,25 @@ ENTRY(arm11_tlb_flushID)
mcr p15, 0, r0, c8, c7, 0 /* flush I+D tlb */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(arm11_tlb_flushID)
ENTRY(arm11_tlb_flushI)
mcr p15, 0, r0, c8, c5, 0 /* flush I tlb */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(arm11_tlb_flushI)
ENTRY(arm11_tlb_flushD)
mcr p15, 0, r0, c8, c6, 0 /* flush D tlb */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(arm11_tlb_flushD)
ENTRY(arm11_tlb_flushD_SE)
mcr p15, 0, r0, c8, c6, 1 /* flush D tlb single entry */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(arm11_tlb_flushD_SE)
/*
* Other functions
@@ -124,8 +131,11 @@ ENTRY(arm11_tlb_flushD_SE)
ENTRY(arm11_drain_writebuf)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(arm11_drain_writebuf)
ENTRY_NP(arm11_sleep)
mov r0, #0
mcr p15, 0, r0, c7, c0, 4 /* wait for interrupt */
RET
+END(arm11_sleep)
+
diff --git a/sys/arm/arm/cpufunc_asm_arm11x6.S b/sys/arm/arm/cpufunc_asm_arm11x6.S
index e223208..6c7eb56 100644
--- a/sys/arm/arm/cpufunc_asm_arm11x6.S
+++ b/sys/arm/arm/cpufunc_asm_arm11x6.S
@@ -124,24 +124,29 @@ ENTRY(arm11x6_setttb)
mcr p15, 0, r1, c8, c7, 0 /* invalidate I+D TLBs */
mcr p15, 0, r1, c7, c10, 4 /* drain write buffer */
RET
+END(arm11x6_setttb)
ENTRY_NP(arm11x6_idcache_wbinv_all)
Flush_D_cache(r0)
Invalidate_I_cache(r0, r1)
RET
+END(arm11x6_idcache_wbinv_all)
ENTRY_NP(arm11x6_dcache_wbinv_all)
Flush_D_cache(r0)
RET
+END(arm11x6_dcache_wbinv_all)
ENTRY_NP(arm11x6_icache_sync_all)
Flush_D_cache(r0)
Invalidate_I_cache(r0, r1)
RET
+END(arm11x6_icache_sync_all)
ENTRY_NP(arm11x6_flush_prefetchbuf)
mcr p15, 0, r0, c7, c5, 4 /* Flush Prefetch Buffer */
RET
+END(arm11x6_flush_prefetchbuf)
ENTRY_NP(arm11x6_icache_sync_range)
add r1, r1, r0
@@ -168,6 +173,7 @@ ENTRY_NP(arm11x6_icache_sync_range)
mcrr p15, 0, r1, r0, c12 /* clean and invalidate D cache range */ /* XXXNH */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(arm11x6_icache_sync_range)
ENTRY_NP(arm11x6_idcache_wbinv_range)
add r1, r1, r0
@@ -194,6 +200,7 @@ ENTRY_NP(arm11x6_idcache_wbinv_range)
mcrr p15, 0, r1, r0, c14 /* clean and invalidate D cache range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(arm11x6_idcache_wbinv_range)
/*
* Preload the cache before issuing the WFI by conditionally disabling the
@@ -216,3 +223,5 @@ ENTRY_NP(arm11x6_sleep)
nop
bne 1b
RET
+END(arm11x6_sleep)
+
diff --git a/sys/arm/arm/cpufunc_asm_arm7tdmi.S b/sys/arm/arm/cpufunc_asm_arm7tdmi.S
index fed6f16..2ac2502 100644
--- a/sys/arm/arm/cpufunc_asm_arm7tdmi.S
+++ b/sys/arm/arm/cpufunc_asm_arm7tdmi.S
@@ -60,6 +60,7 @@ ENTRY(arm7tdmi_setttb)
bl _C_LABEL(arm7tdmi_cache_flushID)
mov pc, r2
+END(arm7tdmi_setttb)
/*
* TLB functions
@@ -68,10 +69,12 @@ ENTRY(arm7tdmi_tlb_flushID)
mov r0, #0
mcr p15, 0, r0, c8, c7, 0
RET
+END(arm7tdmi_tlb_flushID)
ENTRY(arm7tdmi_tlb_flushID_SE)
mcr p15, 0, r0, c8, c7, 1
RET
+END(arm7tdmi_tlb_flushID_SE)
/*
* Cache functions
@@ -86,6 +89,7 @@ ENTRY(arm7tdmi_cache_flushID)
mov r0, r0
RET
+END(arm7tdmi_cache_flushID)
/*
* Context switch.
@@ -98,3 +102,5 @@ ENTRY(arm7tdmi_cache_flushID)
*/
ENTRY(arm7tdmi_context_switch)
b _C_LABEL(arm7tdmi_setttb)
+END(arm7tdmi_context_switch)
+
diff --git a/sys/arm/arm/cpufunc_asm_arm8.S b/sys/arm/arm/cpufunc_asm_arm8.S
index 9f23548..2cb8b11 100644
--- a/sys/arm/arm/cpufunc_asm_arm8.S
+++ b/sys/arm/arm/cpufunc_asm_arm8.S
@@ -58,6 +58,7 @@ ENTRY(arm8_clock_config)
mcr p15, 0, r2, c15, c0, 0 /* Write clock register */
mov r0, r3 /* Return old value */
RET
+END(arm8_clock_config)
/*
* Functions to set the MMU Translation Table Base register
@@ -90,6 +91,7 @@ ENTRY(arm8_setttb)
msr cpsr_all, r3
RET
+END(arm8_setttb)
/*
* TLB functions
@@ -97,10 +99,12 @@ ENTRY(arm8_setttb)
ENTRY(arm8_tlb_flushID)
mcr p15, 0, r0, c8, c7, 0 /* flush I+D tlb */
RET
+END(arm8_tlb_flushID)
ENTRY(arm8_tlb_flushID_SE)
mcr p15, 0, r0, c8, c7, 1 /* flush I+D tlb single entry */
RET
+END(arm8_tlb_flushID_SE)
/*
* Cache functions
@@ -108,10 +112,12 @@ ENTRY(arm8_tlb_flushID_SE)
ENTRY(arm8_cache_flushID)
mcr p15, 0, r0, c7, c7, 0 /* flush I+D cache */
RET
+END(arm8_cache_flushID)
ENTRY(arm8_cache_flushID_E)
mcr p15, 0, r0, c7, c7, 1 /* flush I+D single entry */
RET
+END(arm8_cache_flushID_E)
ENTRY(arm8_cache_cleanID)
mov r0, #0x00000000
@@ -153,10 +159,12 @@ ENTRY(arm8_cache_cleanID)
bne 1b
RET
+END(arm8_cache_cleanID)
ENTRY(arm8_cache_cleanID_E)
mcr p15, 0, r0, c7, c11, 1 /* clean I+D single entry */
RET
+END(arm8_cache_cleanID_E)
ENTRY(arm8_cache_purgeID)
/*
@@ -232,6 +240,7 @@ ENTRY(arm8_cache_purgeID)
msr cpsr_all, r3
RET
+END(arm8_cache_purgeID)
ENTRY(arm8_cache_purgeID_E)
/*
@@ -253,6 +262,7 @@ ENTRY(arm8_cache_purgeID_E)
mcr p15, 0, r0, c7, c7, 1 /* flush I+D single entry */
msr cpsr_all, r3
RET
+END(arm8_cache_purgeID_E)
/*
* Context switch.
@@ -282,3 +292,5 @@ ENTRY(arm8_context_switch)
mov r0, r0
mov r0, r0
RET
+END(arm8_context_switch)
+
diff --git a/sys/arm/arm/cpufunc_asm_arm9.S b/sys/arm/arm/cpufunc_asm_arm9.S
index ae9fe00..dd29479 100644
--- a/sys/arm/arm/cpufunc_asm_arm9.S
+++ b/sys/arm/arm/cpufunc_asm_arm9.S
@@ -49,6 +49,7 @@ ENTRY(arm9_setttb)
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
mov pc, lr
+END(arm9_setttb)
/*
* TLB functions
@@ -57,6 +58,7 @@ ENTRY(arm9_tlb_flushID_SE)
mcr p15, 0, r0, c8, c6, 1 /* flush D tlb single entry */
mcr p15, 0, r0, c8, c5, 1 /* flush I tlb single entry */
mov pc, lr
+END(arm9_tlb_flushID_SE)
/*
* Cache operations. For the entire cache we use the set/index
@@ -83,6 +85,7 @@ ENTRY_NP(arm9_icache_sync_range)
subs r1, r1, ip
bhi .Larm9_sync_next
mov pc, lr
+END(arm9_icache_sync_range)
ENTRY_NP(arm9_icache_sync_all)
.Larm9_icache_sync_all:
@@ -106,6 +109,7 @@ ENTRY_NP(arm9_icache_sync_all)
subs s_max, s_max, s_inc
bhs .Lnext_set /* Next set */
mov pc, lr
+END(arm9_icache_sync_all)
.Larm9_line_size:
.word _C_LABEL(arm_pdcache_line_size)
@@ -125,6 +129,7 @@ ENTRY(arm9_dcache_wb_range)
subs r1, r1, ip
bhi .Larm9_wb_next
mov pc, lr
+END(arm9_dcache_wb_range)
ENTRY(arm9_dcache_wbinv_range)
ldr ip, .Larm9_line_size
@@ -141,6 +146,7 @@ ENTRY(arm9_dcache_wbinv_range)
subs r1, r1, ip
bhi .Larm9_wbinv_next
mov pc, lr
+END(arm9_dcache_wbinv_range)
/*
* Note, we must not invalidate everything. If the range is too big we
@@ -161,6 +167,7 @@ ENTRY(arm9_dcache_inv_range)
subs r1, r1, ip
bhi .Larm9_inv_next
mov pc, lr
+END(arm9_dcache_inv_range)
ENTRY(arm9_idcache_wbinv_range)
ldr ip, .Larm9_line_size
@@ -178,6 +185,7 @@ ENTRY(arm9_idcache_wbinv_range)
subs r1, r1, ip
bhi .Larm9_id_wbinv_next
mov pc, lr
+END(arm9_idcache_wbinv_range)
ENTRY_NP(arm9_idcache_wbinv_all)
.Larm9_idcache_wbinv_all:
@@ -202,6 +210,8 @@ ENTRY(arm9_dcache_wbinv_all)
subs s_max, s_max, s_inc
bhs .Lnext_set_inv /* Next set */
mov pc, lr
+END(arm9_idcache_wbinv_all)
+END(arm9_dcache_wbinv_all)
.Larm9_cache_data:
.word _C_LABEL(arm9_dcache_sets_max)
@@ -229,6 +239,7 @@ ENTRY(arm9_context_switch)
nop
nop
mov pc, lr
+END(arm9_context_switch)
.bss
diff --git a/sys/arm/arm/cpufunc_asm_armv4.S b/sys/arm/arm/cpufunc_asm_armv4.S
index 1b8797d..1123e4a 100644
--- a/sys/arm/arm/cpufunc_asm_armv4.S
+++ b/sys/arm/arm/cpufunc_asm_armv4.S
@@ -46,18 +46,22 @@ __FBSDID("$FreeBSD$");
ENTRY(armv4_tlb_flushID)
mcr p15, 0, r0, c8, c7, 0 /* flush I+D tlb */
RET
+END(armv4_tlb_flushID)
ENTRY(armv4_tlb_flushI)
mcr p15, 0, r0, c8, c5, 0 /* flush I tlb */
RET
+END(armv4_tlb_flushI)
ENTRY(armv4_tlb_flushD)
mcr p15, 0, r0, c8, c6, 0 /* flush D tlb */
RET
+END(armv4_tlb_flushD)
ENTRY(armv4_tlb_flushD_SE)
mcr p15, 0, r0, c8, c6, 1 /* flush D tlb single entry */
RET
+END(armv4_tlb_flushD_SE)
/*
* Other functions
@@ -65,3 +69,5 @@ ENTRY(armv4_tlb_flushD_SE)
ENTRY(armv4_drain_writebuf)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
RET
+END(armv4_drain_writebuf)
+
diff --git a/sys/arm/arm/cpufunc_asm_armv5.S b/sys/arm/arm/cpufunc_asm_armv5.S
index 2faa5f4..94e6b43 100644
--- a/sys/arm/arm/cpufunc_asm_armv5.S
+++ b/sys/arm/arm/cpufunc_asm_armv5.S
@@ -51,6 +51,7 @@ ENTRY(armv5_setttb)
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
RET
+END(armv5_setttb)
/*
* Cache operations. For the entire cache we use the set/index
@@ -79,6 +80,7 @@ ENTRY_NP(armv5_icache_sync_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_icache_sync_range)
ENTRY_NP(armv5_icache_sync_all)
.Larmv5_icache_sync_all:
@@ -105,6 +107,7 @@ ENTRY_NP(armv5_icache_sync_all)
bpl 1b /* Next set */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_icache_sync_all)
.Larmv5_line_size:
.word _C_LABEL(arm_pdcache_line_size)
@@ -126,6 +129,7 @@ ENTRY(armv5_dcache_wb_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_dcache_wb_range)
ENTRY(armv5_dcache_wbinv_range)
ldr ip, .Larmv5_line_size
@@ -144,6 +148,7 @@ ENTRY(armv5_dcache_wbinv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_dcache_wbinv_range)
/*
* Note, we must not invalidate everything. If the range is too big we
@@ -166,6 +171,7 @@ ENTRY(armv5_dcache_inv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_dcache_inv_range)
ENTRY(armv5_idcache_wbinv_range)
ldr ip, .Larmv5_line_size
@@ -185,6 +191,7 @@ ENTRY(armv5_idcache_wbinv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_idcache_wbinv_range)
ENTRY_NP(armv5_idcache_wbinv_all)
.Larmv5_idcache_wbinv_all:
@@ -212,6 +219,8 @@ ENTRY(armv5_dcache_wbinv_all)
bpl 1b /* Next set */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_idcache_wbinv_all)
+END(armv5_dcache_wbinv_all)
.Larmv5_cache_data:
.word _C_LABEL(armv5_dcache_sets_max)
diff --git a/sys/arm/arm/cpufunc_asm_armv5_ec.S b/sys/arm/arm/cpufunc_asm_armv5_ec.S
index 4012563..a86ac80 100644
--- a/sys/arm/arm/cpufunc_asm_armv5_ec.S
+++ b/sys/arm/arm/cpufunc_asm_armv5_ec.S
@@ -66,6 +66,7 @@ ENTRY(armv5_ec_setttb)
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
RET
+END(armv5_ec_setttb)
/*
* Cache operations. For the entire cache we use the enhanced cache
@@ -90,6 +91,7 @@ ENTRY_NP(armv5_ec_icache_sync_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_ec_icache_sync_range)
ENTRY_NP(armv5_ec_icache_sync_all)
.Larmv5_ec_icache_sync_all:
@@ -107,6 +109,7 @@ ENTRY_NP(armv5_ec_icache_sync_all)
bne 1b /* More to do? */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_ec_icache_sync_all)
.Larmv5_ec_line_size:
.word _C_LABEL(arm_pdcache_line_size)
@@ -128,6 +131,7 @@ ENTRY(armv5_ec_dcache_wb_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_ec_dcache_wb_range)
ENTRY(armv5_ec_dcache_wbinv_range)
ldr ip, .Larmv5_ec_line_size
@@ -146,6 +150,7 @@ ENTRY(armv5_ec_dcache_wbinv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_ec_dcache_wbinv_range)
/*
* Note, we must not invalidate everything. If the range is too big we
@@ -168,6 +173,7 @@ ENTRY(armv5_ec_dcache_inv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_ec_dcache_inv_range)
ENTRY(armv5_ec_idcache_wbinv_range)
ldr ip, .Larmv5_ec_line_size
@@ -187,6 +193,7 @@ ENTRY(armv5_ec_idcache_wbinv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_ec_idcache_wbinv_range)
ENTRY_NP(armv5_ec_idcache_wbinv_all)
.Larmv5_ec_idcache_wbinv_all:
@@ -197,6 +204,7 @@ ENTRY_NP(armv5_ec_idcache_wbinv_all)
*/
mcr p15, 0, r0, c7, c5, 0 /* Invalidate ICache */
/* Fall through to purge Dcache. */
+END(armv5_ec_idcache_wbinv_all)
ENTRY(armv5_ec_dcache_wbinv_all)
.Larmv5_ec_dcache_wbinv_all:
@@ -204,4 +212,5 @@ ENTRY(armv5_ec_dcache_wbinv_all)
bne 1b /* More to do? */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv5_ec_dcache_wbinv_all)
diff --git a/sys/arm/arm/cpufunc_asm_armv6.S b/sys/arm/arm/cpufunc_asm_armv6.S
index f735754..b8a2d9c 100644
--- a/sys/arm/arm/cpufunc_asm_armv6.S
+++ b/sys/arm/arm/cpufunc_asm_armv6.S
@@ -59,6 +59,7 @@ ENTRY(armv6_setttb)
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
RET
+END(armv6_setttb)
/*
* Cache operations.
@@ -72,6 +73,7 @@ ENTRY_NP(armv6_icache_sync_range)
mcrr p15, 0, r1, r0, c12 /* clean D cache range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_icache_sync_range)
/* LINTSTUB: void armv6_icache_sync_all(void); */
ENTRY_NP(armv6_icache_sync_all)
@@ -84,6 +86,7 @@ ENTRY_NP(armv6_icache_sync_all)
mcr p15, 0, r0, c7, c10, 0 /* Clean D cache */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_icache_sync_all)
/* LINTSTUB: void armv6_dcache_wb_range(vaddr_t, vsize_t); */
ENTRY(armv6_dcache_wb_range)
@@ -92,6 +95,7 @@ ENTRY(armv6_dcache_wb_range)
mcrr p15, 0, r1, r0, c12 /* clean D cache range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_dcache_wb_range)
/* LINTSTUB: void armv6_dcache_wbinv_range(vaddr_t, vsize_t); */
ENTRY(armv6_dcache_wbinv_range)
@@ -100,6 +104,7 @@ ENTRY(armv6_dcache_wbinv_range)
mcrr p15, 0, r1, r0, c14 /* clean and invaliate D cache range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_dcache_wbinv_range)
/*
* Note, we must not invalidate everything. If the range is too big we
@@ -113,6 +118,7 @@ ENTRY(armv6_dcache_inv_range)
mcrr p15, 0, r1, r0, c6 /* invaliate D cache range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_dcache_inv_range)
/* LINTSTUB: void armv6_idcache_wbinv_range(vaddr_t, vsize_t); */
ENTRY(armv6_idcache_wbinv_range)
@@ -122,6 +128,7 @@ ENTRY(armv6_idcache_wbinv_range)
mcrr p15, 0, r1, r0, c14 /* clean & invaliate D cache range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_idcache_wbinv_range)
/* LINTSTUB: void armv6_idcache_wbinv_all(void); */
ENTRY_NP(armv6_idcache_wbinv_all)
@@ -138,3 +145,6 @@ ENTRY(armv6_dcache_wbinv_all)
mcr p15, 0, r0, c7, c14, 0 /* clean & invalidate D cache */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_idcache_wbinv_all)
+END(armv6_dcache_wbinv_all)
+
diff --git a/sys/arm/arm/cpufunc_asm_armv7.S b/sys/arm/arm/cpufunc_asm_armv7.S
index 58f295c..2b4be85 100644
--- a/sys/arm/arm/cpufunc_asm_armv7.S
+++ b/sys/arm/arm/cpufunc_asm_armv7.S
@@ -78,6 +78,7 @@ ENTRY(armv7_setttb)
dsb
isb
RET
+END(armv7_setttb)
ENTRY(armv7_tlb_flushID)
dsb
@@ -91,6 +92,7 @@ ENTRY(armv7_tlb_flushID)
dsb
isb
mov pc, lr
+END(armv7_tlb_flushID)
ENTRY(armv7_tlb_flushID_SE)
ldr r1, .Lpage_mask
@@ -105,6 +107,7 @@ ENTRY(armv7_tlb_flushID_SE)
dsb
isb
mov pc, lr
+END(armv7_tlb_flushID_SE)
/* Based on algorithm from ARM Architecture Reference Manual */
ENTRY(armv7_dcache_wbinv_all)
@@ -157,6 +160,7 @@ Finished:
dsb
ldmia sp!, {r4, r5, r6, r7, r8, r9}
RET
+END(armv7_dcache_wbinv_all)
ENTRY(armv7_idcache_wbinv_all)
stmdb sp!, {lr}
@@ -170,6 +174,7 @@ ENTRY(armv7_idcache_wbinv_all)
isb
ldmia sp!, {lr}
RET
+END(armv7_idcache_wbinv_all)
/* XXX Temporary set it to 32 for MV cores, however this value should be
* get from Cache Type register
@@ -190,6 +195,7 @@ ENTRY(armv7_dcache_wb_range)
bhi .Larmv7_wb_next
dsb /* data synchronization barrier */
RET
+END(armv7_dcache_wb_range)
ENTRY(armv7_dcache_wbinv_range)
ldr ip, .Larmv7_line_size
@@ -204,6 +210,7 @@ ENTRY(armv7_dcache_wbinv_range)
bhi .Larmv7_wbinv_next
dsb /* data synchronization barrier */
RET
+END(armv7_dcache_wbinv_range)
/*
* Note, we must not invalidate everything. If the range is too big we
@@ -222,6 +229,7 @@ ENTRY(armv7_dcache_inv_range)
bhi .Larmv7_inv_next
dsb /* data synchronization barrier */
RET
+END(armv7_dcache_inv_range)
ENTRY(armv7_idcache_wbinv_range)
ldr ip, .Larmv7_line_size
@@ -238,6 +246,7 @@ ENTRY(armv7_idcache_wbinv_range)
isb /* instruction synchronization barrier */
dsb /* data synchronization barrier */
RET
+END(armv7_idcache_wbinv_range)
ENTRY_NP(armv7_icache_sync_range)
ldr ip, .Larmv7_line_size
@@ -250,11 +259,13 @@ ENTRY_NP(armv7_icache_sync_range)
isb /* instruction synchronization barrier */
dsb /* data synchronization barrier */
RET
+END(armv7_icache_sync_range)
ENTRY(armv7_cpu_sleep)
dsb /* data synchronization barrier */
wfi /* wait for interrupt */
RET
+END(armv7_cpu_sleep)
ENTRY(armv7_context_switch)
dsb
@@ -269,16 +280,19 @@ ENTRY(armv7_context_switch)
dsb
isb
RET
+END(armv7_context_switch)
ENTRY(armv7_drain_writebuf)
dsb
RET
+END(armv7_drain_writebuf)
ENTRY(armv7_sev)
dsb
sev
nop
RET
+END(armv7_sev)
ENTRY(armv7_auxctrl)
mrc p15, 0, r2, c1, c0, 1
@@ -289,3 +303,5 @@ ENTRY(armv7_auxctrl)
mcrne p15, 0, r3, c1, c0, 1
mov r0, r2
RET
+END(armv7_auxctrl)
+
diff --git a/sys/arm/arm/cpufunc_asm_fa526.S b/sys/arm/arm/cpufunc_asm_fa526.S
index d53d29a..55c2f37 100644
--- a/sys/arm/arm/cpufunc_asm_fa526.S
+++ b/sys/arm/arm/cpufunc_asm_fa526.S
@@ -54,6 +54,7 @@ ENTRY(fa526_setttb)
mov r0, r0
mov r0, r0
mov pc, lr
+END(fa526_setttb)
/*
* TLB functions
@@ -61,6 +62,7 @@ ENTRY(fa526_setttb)
ENTRY(fa526_tlb_flushID_SE)
mcr p15, 0, r0, c8, c7, 1 /* flush Utlb single entry */
mov pc, lr
+END(fa526_tlb_flushID_SE)
/*
* TLB functions
@@ -68,6 +70,7 @@ ENTRY(fa526_tlb_flushID_SE)
ENTRY(fa526_tlb_flushI_SE)
mcr p15, 0, r0, c8, c5, 1 /* flush Itlb single entry */
mov pc, lr
+END(fa526_tlb_flushI_SE)
ENTRY(fa526_cpu_sleep)
mov r0, #0
@@ -75,11 +78,13 @@ ENTRY(fa526_cpu_sleep)
nop*/
mcr p15, 0, r0, c7, c0, 4 /* Wait for interrupt*/
mov pc, lr
+END(fa526_cpu_sleep)
ENTRY(fa526_flush_prefetchbuf)
mov r0, #0
mcr p15, 0, r0, c7, c5, 4 /* Pre-fetch flush */
mov pc, lr
+END(fa526_flush_prefetchbuf)
/*
* Cache functions
@@ -90,17 +95,20 @@ ENTRY(fa526_idcache_wbinv_all)
mcr p15, 0, r0, c7, c5, 0 /* invalidate I$ */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(fa526_idcache_wbinv_all)
ENTRY(fa526_icache_sync_all)
mov r0, #0
mcr p15, 0, r0, c7, c5, 0 /* invalidate I$ */
mov pc, lr
+END(fa526_icache_sync_all)
ENTRY(fa526_dcache_wbinv_all)
mov r0, #0
mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate D$ */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(fa526_dcache_wbinv_all)
/*
* Soft functions
@@ -120,6 +128,7 @@ ENTRY(fa526_dcache_wbinv_range)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(fa526_dcache_wbinv_range)
ENTRY(fa526_dcache_wb_range)
cmp r1, #0x4000
@@ -140,6 +149,7 @@ ENTRY(fa526_dcache_wb_range)
3: mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(fa526_dcache_wb_range)
ENTRY(fa526_dcache_inv_range)
and r2, r0, #(CACHELINE_SIZE - 1)
@@ -152,6 +162,7 @@ ENTRY(fa526_dcache_inv_range)
bhi 1b
mov pc, lr
+END(fa526_dcache_inv_range)
ENTRY(fa526_idcache_wbinv_range)
cmp r1, #0x4000
@@ -169,6 +180,7 @@ ENTRY(fa526_idcache_wbinv_range)
2: mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(fa526_idcache_wbinv_range)
ENTRY(fa526_icache_sync_range)
cmp r1, #0x4000
@@ -186,11 +198,13 @@ ENTRY(fa526_icache_sync_range)
2: mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mov pc, lr
+END(fa526_icache_sync_range)
ENTRY(fa526_flush_brnchtgt_E)
mov r0, #0
mcr p15, 0, r0, c7, c5, 6 /* invalidate BTB cache */
mov pc, lr
+END(fa526_flush_brnchtgt_E)
ENTRY(fa526_context_switch)
/*
@@ -210,4 +224,5 @@ ENTRY(fa526_context_switch)
mov r0, r0
mov r0, r0
mov pc, lr
+END(fa526_context_switch)
diff --git a/sys/arm/arm/cpufunc_asm_ixp12x0.S b/sys/arm/arm/cpufunc_asm_ixp12x0.S
index efc5950..481cf0d 100644
--- a/sys/arm/arm/cpufunc_asm_ixp12x0.S
+++ b/sys/arm/arm/cpufunc_asm_ixp12x0.S
@@ -61,10 +61,12 @@ ENTRY(ixp12x0_context_switch)
mov r0, r0
mov r0, r0
RET
+END(ixp12x0_context_switch)
ENTRY(ixp12x0_drain_readbuf)
mcr p15, 0, r0, c9, c0, 0 /* drain read buffer */
RET
+END(ixp12x0_drain_readbuf)
/*
* Information for the IXP12X0 cache clean/purge functions:
diff --git a/sys/arm/arm/cpufunc_asm_pj4b.S b/sys/arm/arm/cpufunc_asm_pj4b.S
index f6890d9..2e325f3 100644
--- a/sys/arm/arm/cpufunc_asm_pj4b.S
+++ b/sys/arm/arm/cpufunc_asm_pj4b.S
@@ -46,6 +46,7 @@ ENTRY(pj4b_setttb)
mcr p15, 0, r0, c2, c0, 0 /* load new TTB */
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
RET
+END(pj4b_setttb)
ENTRY_NP(armv6_icache_sync_all)
/*
@@ -58,6 +59,7 @@ ENTRY_NP(armv6_icache_sync_all)
mcr p15, 0, r0, c7, c10, 0 /* Clean (don't invalidate) DCache */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_icache_sync_all)
ENTRY(pj4b_icache_sync_range)
sub r1, r1, #1
@@ -66,6 +68,7 @@ ENTRY(pj4b_icache_sync_range)
mcrr p15, 0, r1, r0, c12 /* clean DC range */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(pj4b_icache_sync_range)
ENTRY(pj4b_dcache_inv_range)
ldr ip, .Lpj4b_cache_line_size
@@ -84,6 +87,7 @@ ENTRY(pj4b_dcache_inv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(pj4b_dcache_inv_range)
ENTRY(armv6_idcache_wbinv_all)
mov r0, #0
@@ -91,12 +95,14 @@ ENTRY(armv6_idcache_wbinv_all)
mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate DCache */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_idcache_wbinv_all)
ENTRY(armv6_dcache_wbinv_all)
mov r0, #0
mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate DCache */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(armv6_dcache_wbinv_all)
ENTRY(pj4b_idcache_wbinv_range)
ldr ip, .Lpj4b_cache_line_size
@@ -121,6 +127,7 @@ ENTRY(pj4b_idcache_wbinv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(pj4b_idcache_wbinv_range)
ENTRY(pj4b_dcache_wbinv_range)
ldr ip, .Lpj4b_cache_line_size
@@ -144,6 +151,7 @@ ENTRY(pj4b_dcache_wbinv_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(pj4b_dcache_wbinv_range)
ENTRY(pj4b_dcache_wb_range)
ldr ip, .Lpj4b_cache_line_size
@@ -167,22 +175,27 @@ ENTRY(pj4b_dcache_wb_range)
bpl 1b
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(pj4b_dcache_wb_range)
ENTRY(pj4b_drain_readbuf)
mcr p15, 0, r0, c7, c5, 4 /* flush prefetch buffers */
RET
+END(pj4b_drain_readbuf)
ENTRY(pj4b_flush_brnchtgt_all)
mcr p15, 0, r0, c7, c5, 6 /* flush entrie branch target cache */
RET
+END(pj4b_flush_brnchtgt_all)
ENTRY(pj4b_flush_brnchtgt_va)
mcr p15, 0, r0, c7, c5, 7 /* flush branch target cache by VA */
RET
+END(pj4b_flush_brnchtgt_va)
ENTRY(get_core_id)
mrc p15, 0, r0, c0, c0, 5
RET
+END(get_core_id)
ENTRY(pj4b_config)
/* Set Auxiliary Debug Modes Control 2 register */
@@ -200,3 +213,5 @@ ENTRY(pj4b_config)
mcr p15, 0, r0, c1, c0, 1
#endif
RET
+END(pj4b_config)
+
diff --git a/sys/arm/arm/cpufunc_asm_sa1.S b/sys/arm/arm/cpufunc_asm_sa1.S
index 0bdd6e7..99cd4f1 100644
--- a/sys/arm/arm/cpufunc_asm_sa1.S
+++ b/sys/arm/arm/cpufunc_asm_sa1.S
@@ -85,6 +85,8 @@ ENTRY(sa1_setttb)
str r2, [r3]
#endif
RET
+END(getttb)
+END(sa1_setttb)
/*
* TLB functions
@@ -93,6 +95,7 @@ ENTRY(sa1_tlb_flushID_SE)
mcr p15, 0, r0, c8, c6, 1 /* flush D tlb single entry */
mcr p15, 0, r0, c8, c5, 0 /* flush I tlb */
RET
+END(sa1_tlb_flushID_SE)
/*
* Cache functions
@@ -100,22 +103,27 @@ ENTRY(sa1_tlb_flushID_SE)
ENTRY(sa1_cache_flushID)
mcr p15, 0, r0, c7, c7, 0 /* flush I+D cache */
RET
+END(sa1_cache_flushID)
ENTRY(sa1_cache_flushI)
mcr p15, 0, r0, c7, c5, 0 /* flush I cache */
RET
+END(sa1_cache_flushI)
ENTRY(sa1_cache_flushD)
mcr p15, 0, r0, c7, c6, 0 /* flush D cache */
RET
+END(sa1_cache_flushD)
ENTRY(sa1_cache_flushD_SE)
mcr p15, 0, r0, c7, c6, 1 /* flush D cache single entry */
RET
+END(sa1_cache_flushD_SE)
ENTRY(sa1_cache_cleanD_E)
mcr p15, 0, r0, c7, c10, 1 /* clean D cache entry */
RET
+END(sa1_cache_cleanD_E)
/*
* Information for the SA-1 cache clean/purge functions:
@@ -196,6 +204,11 @@ ENTRY(sa1_cache_cleanD)
SA1_CACHE_CLEAN_EPILOGUE
RET
+END(sa1_cache_syncI)
+END(sa1_cache_purgeID)
+END(sa1_cache_cleanID)
+END(sa1_cache_purgeD)
+END(sa1_cache_cleanD)
ENTRY(sa1_cache_purgeID_E)
mcr p15, 0, r0, c7, c10, 1 /* clean dcache entry */
@@ -203,12 +216,14 @@ ENTRY(sa1_cache_purgeID_E)
mcr p15, 0, r0, c7, c5, 0 /* flush I cache */
mcr p15, 0, r0, c7, c6, 1 /* flush D cache single entry */
RET
+END(sa1_cache_purgeID_E)
ENTRY(sa1_cache_purgeD_E)
mcr p15, 0, r0, c7, c10, 1 /* clean dcache entry */
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mcr p15, 0, r0, c7, c6, 1 /* flush D cache single entry */
RET
+END(sa1_cache_purgeD_E)
/*
* Soft functions
@@ -231,6 +246,8 @@ ENTRY(sa1_cache_cleanD_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
RET
+END(sa1_cache_cleanID_rng)
+END(sa1_cache_cleanD_rng)
ENTRY(sa1_cache_purgeID_rng)
cmp r1, #0x4000
@@ -249,6 +266,7 @@ ENTRY(sa1_cache_purgeID_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mcr p15, 0, r0, c7, c5, 0 /* flush I cache */
RET
+END(sa1_cache_purgeID_rng)
ENTRY(sa1_cache_purgeD_rng)
cmp r1, #0x4000
@@ -266,6 +284,7 @@ ENTRY(sa1_cache_purgeD_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
RET
+END(sa1_cache_purgeD_rng)
ENTRY(sa1_cache_syncI_rng)
cmp r1, #0x4000
@@ -284,6 +303,7 @@ ENTRY(sa1_cache_syncI_rng)
mcr p15, 0, r0, c7, c5, 0 /* flush I cache */
RET
+END(sa1_cache_syncI_rng)
/*
* Context switch.
@@ -313,4 +333,5 @@ ENTRY(sa110_context_switch)
mov r0, r0
mov r0, r0
RET
+END(sa110_context_switch)
#endif
diff --git a/sys/arm/arm/cpufunc_asm_sa11x0.S b/sys/arm/arm/cpufunc_asm_sa11x0.S
index ca167c8..17efc8f 100644
--- a/sys/arm/arm/cpufunc_asm_sa11x0.S
+++ b/sys/arm/arm/cpufunc_asm_sa11x0.S
@@ -95,7 +95,7 @@ ENTRY(sa11x0_cpu_sleep)
/* Restore interrupts (which will cause them to be serviced). */
msr cpsr_all, r3
RET
-
+END(sa11x0_cpu_sleep)
/*
* This function is the same as sa110_context_switch for now, the plan
@@ -119,7 +119,10 @@ ENTRY(sa11x0_context_switch)
mov r0, r0
mov r0, r0
RET
+END(sa11x0_context_switch)
ENTRY(sa11x0_drain_readbuf)
mcr p15, 0, r0, c9, c0, 0 /* drain read buffer */
RET
+END(sa11x0_drain_readbuf)
+
diff --git a/sys/arm/arm/cpufunc_asm_sheeva.S b/sys/arm/arm/cpufunc_asm_sheeva.S
index d185547..796f63e 100644
--- a/sys/arm/arm/cpufunc_asm_sheeva.S
+++ b/sys/arm/arm/cpufunc_asm_sheeva.S
@@ -62,6 +62,7 @@ ENTRY(sheeva_setttb)
mcr p15, 0, r0, c8, c7, 0 /* invalidate I+D TLBs */
RET
+END(sheeva_setttb)
ENTRY(sheeva_dcache_wbinv_range)
str lr, [sp, #-4]!
@@ -104,6 +105,7 @@ ENTRY(sheeva_dcache_wbinv_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
ldr lr, [sp], #4
RET
+END(sheeva_dcache_wbinv_range)
ENTRY(sheeva_idcache_wbinv_range)
str lr, [sp, #-4]!
@@ -155,6 +157,7 @@ ENTRY(sheeva_idcache_wbinv_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
ldr lr, [sp], #4
RET
+END(sheeva_idcache_wbinv_range)
ENTRY(sheeva_dcache_inv_range)
str lr, [sp, #-4]!
@@ -197,6 +200,7 @@ ENTRY(sheeva_dcache_inv_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
ldr lr, [sp], #4
RET
+END(sheeva_dcache_inv_range)
ENTRY(sheeva_dcache_wb_range)
str lr, [sp, #-4]!
@@ -239,6 +243,7 @@ ENTRY(sheeva_dcache_wb_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
ldr lr, [sp], #4
RET
+END(sheeva_dcache_wb_range)
ENTRY(sheeva_l2cache_wbinv_range)
str lr, [sp, #-4]!
@@ -283,6 +288,7 @@ ENTRY(sheeva_l2cache_wbinv_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
ldr lr, [sp], #4
RET
+END(sheeva_l2cache_wbinv_range)
ENTRY(sheeva_l2cache_inv_range)
str lr, [sp, #-4]!
@@ -325,6 +331,7 @@ ENTRY(sheeva_l2cache_inv_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
ldr lr, [sp], #4
RET
+END(sheeva_l2cache_inv_range)
ENTRY(sheeva_l2cache_wb_range)
str lr, [sp, #-4]!
@@ -367,6 +374,7 @@ ENTRY(sheeva_l2cache_wb_range)
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
ldr lr, [sp], #4
RET
+END(sheeva_l2cache_wb_range)
ENTRY(sheeva_l2cache_wbinv_all)
mov r0, #0
@@ -374,6 +382,7 @@ ENTRY(sheeva_l2cache_wbinv_all)
mcr p15, 1, r0, c15, c11, 0 /* Invalidate L2 */
mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */
RET
+END(sheeva_l2cache_wbinv_all)
/* This function modifies register value as follows:
*
@@ -392,10 +401,12 @@ ENTRY(sheeva_control_ext)
mcrne p15, 1, r2, c15, c1, 0 /* Write new control register */
mov r0, r3 /* Return old value */
RET
+END(sheeva_control_ext)
ENTRY(sheeva_cpu_sleep)
mov r0, #0
mcr p15, 0, r0, c7, c10, 4 /* Drain write buffer */
mcr p15, 0, r0, c7, c0, 4 /* Wait for interrupt */
mov pc, lr
+END(sheeva_cpu_sleep)
diff --git a/sys/arm/arm/cpufunc_asm_xscale.S b/sys/arm/arm/cpufunc_asm_xscale.S
index 3601b9a..56008dc 100644
--- a/sys/arm/arm/cpufunc_asm_xscale.S
+++ b/sys/arm/arm/cpufunc_asm_xscale.S
@@ -106,6 +106,7 @@ __FBSDID("$FreeBSD$");
ENTRY(xscale_cpwait)
CPWAIT_AND_RETURN(r0)
+END(xscale_cpwait)
/*
* We need a separate cpu_control() entry point, since we have to
@@ -123,6 +124,7 @@ ENTRY(xscale_control)
mov r0, r3 /* Return old value */
CPWAIT_AND_RETURN(r1)
+END(xscale_control)
/*
* Functions to set the MMU Translation Table Base register
@@ -167,6 +169,7 @@ ENTRY(xscale_setttb)
str r2, [r3]
#endif
RET
+END(xscale_setttb)
/*
* TLB functions
@@ -176,6 +179,7 @@ ENTRY(xscale_tlb_flushID_SE)
mcr p15, 0, r0, c8, c6, 1 /* flush D tlb single entry */
mcr p15, 0, r0, c8, c5, 1 /* flush I tlb single entry */
CPWAIT_AND_RETURN(r0)
+END(xscale_tlb_flushID_SE)
/*
* Cache functions
@@ -183,18 +187,22 @@ ENTRY(xscale_tlb_flushID_SE)
ENTRY(xscale_cache_flushID)
mcr p15, 0, r0, c7, c7, 0 /* flush I+D cache */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_flushID)
ENTRY(xscale_cache_flushI)
mcr p15, 0, r0, c7, c5, 0 /* flush I cache */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_flushI)
ENTRY(xscale_cache_flushD)
mcr p15, 0, r0, c7, c6, 0 /* flush D cache */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_flushD)
ENTRY(xscale_cache_flushI_SE)
mcr p15, 0, r0, c7, c5, 1 /* flush I cache single entry */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_flushI_SE)
ENTRY(xscale_cache_flushD_SE)
/*
@@ -205,10 +213,12 @@ ENTRY(xscale_cache_flushD_SE)
mcr p15, 0, r0, c7, c10, 1
mcr p15, 0, r0, c7, c6, 1 /* flush D cache single entry */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_flushD_SE)
ENTRY(xscale_cache_cleanD_E)
mcr p15, 0, r0, c7, c10, 1 /* clean D cache entry */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_cleanD_E)
/*
* Information for the XScale cache clean/purge functions:
@@ -316,6 +326,11 @@ ENTRY(xscale_cache_cleanD)
XSCALE_CACHE_CLEAN_EPILOGUE
RET
+END(xscale_cache_syncI)
+END(xscale_cache_purgeID)
+END(xscale_cache_cleanID)
+END(xscale_cache_purgeD)
+END(xscale_cache_cleanD)
/*
* Clean the mini-data cache.
@@ -335,6 +350,7 @@ ENTRY(xscale_cache_clean_minidata)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r1)
+END(xscale_cache_clean_minidata)
ENTRY(xscale_cache_purgeID_E)
mcr p15, 0, r0, c7, c10, 1 /* clean D cache entry */
@@ -343,6 +359,7 @@ ENTRY(xscale_cache_purgeID_E)
mcr p15, 0, r0, c7, c5, 1 /* flush I cache single entry */
mcr p15, 0, r0, c7, c6, 1 /* flush D cache single entry */
CPWAIT_AND_RETURN(r1)
+END(xscale_cache_purgeID_E)
ENTRY(xscale_cache_purgeD_E)
mcr p15, 0, r0, c7, c10, 1 /* clean D cache entry */
@@ -350,6 +367,7 @@ ENTRY(xscale_cache_purgeD_E)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
mcr p15, 0, r0, c7, c6, 1 /* flush D cache single entry */
CPWAIT_AND_RETURN(r1)
+END(xscale_cache_purgeD_E)
/*
* Soft functions
@@ -375,6 +393,8 @@ ENTRY(xscale_cache_cleanD_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_cleanID_rng)
+END(xscale_cache_cleanD_rng)
ENTRY(xscale_cache_purgeID_rng)
cmp r1, #0x4000
@@ -396,6 +416,7 @@ ENTRY(xscale_cache_purgeID_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_purgeID_rng)
ENTRY(xscale_cache_purgeD_rng)
cmp r1, #0x4000
@@ -416,6 +437,7 @@ ENTRY(xscale_cache_purgeD_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_purgeD_rng)
ENTRY(xscale_cache_syncI_rng)
cmp r1, #0x4000
@@ -436,6 +458,7 @@ ENTRY(xscale_cache_syncI_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_syncI_rng)
ENTRY(xscale_cache_flushD_rng)
and r2, r0, #0x1f
@@ -450,6 +473,7 @@ ENTRY(xscale_cache_flushD_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscale_cache_flushD_rng)
/*
* Context switch.
@@ -475,6 +499,7 @@ ENTRY(xscale_context_switch)
mcr p15, 0, r0, c8, c7, 0 /* flush the I+D tlb */
CPWAIT_AND_RETURN(r0)
+END(xscale_context_switch)
/*
* xscale_cpu_sleep
@@ -493,3 +518,5 @@ ENTRY(xscale_cpu_sleep)
1:
RET
+END(xscale_cpu_sleep)
+
diff --git a/sys/arm/arm/cpufunc_asm_xscale_c3.S b/sys/arm/arm/cpufunc_asm_xscale_c3.S
index 9a003d0..a0494d5 100644
--- a/sys/arm/arm/cpufunc_asm_xscale_c3.S
+++ b/sys/arm/arm/cpufunc_asm_xscale_c3.S
@@ -168,6 +168,11 @@ ENTRY(xscalec3_cache_cleanD)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
RET
+END(xscalec3_cache_syncI)
+END(xscalec3_cache_purgeID)
+END(xscalec3_cache_cleanID)
+END(xscalec3_cache_purgeD)
+END(xscalec3_cache_cleanD)
ENTRY(xscalec3_cache_purgeID_rng)
@@ -189,6 +194,7 @@ ENTRY(xscalec3_cache_purgeID_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscalec3_cache_purgeID_rng)
ENTRY(xscalec3_cache_syncI_rng)
cmp r1, #0x4000
@@ -209,6 +215,7 @@ ENTRY(xscalec3_cache_syncI_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscalec3_cache_syncI_rng)
ENTRY(xscalec3_cache_purgeD_rng)
@@ -228,6 +235,8 @@ ENTRY(xscalec3_cache_purgeD_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
+END(xscalec3_cache_purgeD_rng)
+
ENTRY(xscalec3_cache_cleanID_rng)
ENTRY(xscalec3_cache_cleanD_rng)
@@ -248,7 +257,8 @@ ENTRY(xscalec3_cache_cleanD_rng)
mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */
CPWAIT_AND_RETURN(r0)
-
+END(xscalec3_cache_cleanID_rng)
+END(xscalec3_cache_cleanD_rng)
ENTRY(xscalec3_l2cache_purge)
/* Clean-up the L2 cache */
@@ -271,6 +281,7 @@ ENTRY(xscalec3_l2cache_purge)
CPWAIT(r0)
mcr p15, 0, r0, c7, c10, 5 /* Data memory barrier */
RET
+END(xscalec3_l2cache_purge)
ENTRY(xscalec3_l2cache_clean_rng)
mcr p15, 0, r0, c7, c10, 5 /* Data memory barrier */
@@ -291,6 +302,7 @@ ENTRY(xscalec3_l2cache_clean_rng)
mcr p15, 0, r0, c7, c10, 5
CPWAIT_AND_RETURN(r0)
+END(xscalec3_l2cache_clean_rng)
ENTRY(xscalec3_l2cache_purge_rng)
@@ -310,6 +322,7 @@ ENTRY(xscalec3_l2cache_purge_rng)
mcr p15, 0, r0, c7, c10, 5
CPWAIT_AND_RETURN(r0)
+END(xscalec3_l2cache_purge_rng)
ENTRY(xscalec3_l2cache_flush_rng)
mcr p15, 0, r0, c7, c10, 5 /* Data memory barrier */
@@ -325,6 +338,8 @@ ENTRY(xscalec3_l2cache_flush_rng)
mcr p15, 0, r0, c7, c10, 4 @ data write barrier
mcr p15, 0, r0, c7, c10, 5
CPWAIT_AND_RETURN(r0)
+END(xscalec3_l2cache_flush_rng)
+
/*
* Functions to set the MMU Translation Table Base register
*
@@ -368,6 +383,7 @@ ENTRY(xscalec3_setttb)
str r2, [r3]
#endif
RET
+END(xscalec3_setttb)
/*
* Context switch.
@@ -395,3 +411,5 @@ ENTRY(xscalec3_context_switch)
mcr p15, 0, r0, c8, c7, 0 /* flush the I+D tlb */
CPWAIT_AND_RETURN(r0)
+END(xscalec3_context_switch)
+
diff --git a/sys/arm/arm/db_trace.c b/sys/arm/arm/db_trace.c
index 89ec507..90ac0b1 100644
--- a/sys/arm/arm/db_trace.c
+++ b/sys/arm/arm/db_trace.c
@@ -126,29 +126,6 @@ struct unwind_state {
uint16_t update_mask;
};
-/* We need to provide these but never use them */
-void __aeabi_unwind_cpp_pr0(void);
-void __aeabi_unwind_cpp_pr1(void);
-void __aeabi_unwind_cpp_pr2(void);
-
-void
-__aeabi_unwind_cpp_pr0(void)
-{
- panic("__aeabi_unwind_cpp_pr0");
-}
-
-void
-__aeabi_unwind_cpp_pr1(void)
-{
- panic("__aeabi_unwind_cpp_pr1");
-}
-
-void
-__aeabi_unwind_cpp_pr2(void)
-{
- panic("__aeabi_unwind_cpp_pr2");
-}
-
/* Expand a 31-bit signed value to a 32-bit signed value */
static __inline int32_t
db_expand_prel31(uint32_t prel31)
@@ -377,7 +354,7 @@ db_stack_trace_cmd(struct unwind_state *state)
index = db_find_index(state->start_pc);
if (index->insn == EXIDX_CANTUNWIND) {
- printf("Unable to unwind\n");
+ db_printf("Unable to unwind\n");
break;
} else if (index->insn & (1 << 31)) {
/* The data is within the instruction */
@@ -612,10 +589,13 @@ db_trace_self(void)
{
#ifdef __ARM_EABI__
struct unwind_state state;
- register uint32_t sp __asm__ ("sp");
+ uint32_t sp;
+
+ /* Read the stack pointer */
+ __asm __volatile("mov %0, sp" : "=&r" (sp));
state.registers[FP] = (uint32_t)__builtin_frame_address(0);
- state.registers[SP] = (uint32_t)sp;
+ state.registers[SP] = sp;
state.registers[LR] = (uint32_t)__builtin_return_address(0);
state.registers[PC] = (uint32_t)db_trace_self;
diff --git a/sys/arm/arm/disassem.c b/sys/arm/arm/disassem.c
index 259c3c4..55ef0b2 100644
--- a/sys/arm/arm/disassem.c
+++ b/sys/arm/arm/disassem.c
@@ -130,7 +130,7 @@ static const struct arm32_insn arm32_i[] = {
{ 0x0c500000, 0x04100000, "ldr", "daW" },
{ 0x0c500000, 0x04400000, "strb", "daW" },
{ 0x0c500000, 0x04500000, "ldrb", "daW" },
-#ifdef __FreeBSD_ARCH_armv6__
+#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6)
{ 0xffffffff, 0xf57ff01f, "clrex", "c" },
{ 0x0ff00ff0, 0x01800f90, "strex", "dmo" },
{ 0x0ff00fff, 0x01900f9f, "ldrex", "do" },
diff --git a/sys/arm/arm/elf_trampoline.c b/sys/arm/arm/elf_trampoline.c
index 31e8bc5..fe03adf 100644
--- a/sys/arm/arm/elf_trampoline.c
+++ b/sys/arm/arm/elf_trampoline.c
@@ -701,3 +701,18 @@ __start(void)
do_call(dst, kernel, dst + (unsigned int)(&func_end) -
(unsigned int)(&load_kernel) + 800, sp);
}
+
+#ifdef __ARM_EABI__
+/* We need to provide these functions but never call them */
+void __aeabi_unwind_cpp_pr0(void);
+void __aeabi_unwind_cpp_pr1(void);
+void __aeabi_unwind_cpp_pr2(void);
+
+__strong_reference(__aeabi_unwind_cpp_pr0, __aeabi_unwind_cpp_pr1);
+__strong_reference(__aeabi_unwind_cpp_pr0, __aeabi_unwind_cpp_pr2);
+void
+__aeabi_unwind_cpp_pr0(void)
+{
+}
+#endif
+
diff --git a/sys/arm/arm/exception.S b/sys/arm/arm/exception.S
index cd936bb..2ff0840 100644
--- a/sys/arm/arm/exception.S
+++ b/sys/arm/arm/exception.S
@@ -70,6 +70,7 @@ ASENTRY_NP(reset_entry)
Lreset_panicmsg:
.asciz "Reset vector called, LR = 0x%08x"
.balign 4
+END(reset_entry)
/*
* swi_entry
@@ -77,6 +78,8 @@ Lreset_panicmsg:
* Handler for the Software Interrupt exception.
*/
ASENTRY_NP(swi_entry)
+ STOP_UNWINDING /* Don't unwind past here */
+
PUSHFRAME
mov r0, sp /* Pass the frame to any function */
@@ -88,6 +91,7 @@ ASENTRY_NP(swi_entry)
DO_AST
PULLFRAME
movs pc, lr /* Exit */
+END(swi_entry)
/*
* prefetch_abort_entry:
@@ -124,6 +128,7 @@ abortprefetch:
abortprefetchmsg:
.asciz "abortprefetch"
.align 0
+END(prefetch_abort_entry)
/*
* data_abort_entry:
@@ -159,6 +164,7 @@ abortdata:
abortdatamsg:
.asciz "abortdata"
.align 0
+END(data_abort_entry)
/*
* address_exception_entry:
@@ -179,6 +185,7 @@ ASENTRY_NP(address_exception_entry)
Laddress_exception_msg:
.asciz "Address Exception CPSR=0x%08x SPSR=0x%08x LR=0x%08x\n"
.balign 4
+END(address_exception_entry)
/*
* General exception exit handler
@@ -220,6 +227,7 @@ ASENTRY_NP(undefined_entry)
Lundefined_handler_indirection:
.word Lundefined_handler_indirection_data
+END(undefined_entry)
/*
* assembly bounce code for calling the kernel
@@ -250,3 +258,4 @@ Lundefined_handler_indirection_data:
.global _C_LABEL(undefined_handler_address)
_C_LABEL(undefined_handler_address):
.word _C_LABEL(undefinedinstruction_bounce)
+END(undefinedinstruction_bounce)
diff --git a/sys/arm/arm/fiq_subr.S b/sys/arm/arm/fiq_subr.S
index 4cde665..7f510b2 100644
--- a/sys/arm/arm/fiq_subr.S
+++ b/sys/arm/arm/fiq_subr.S
@@ -74,6 +74,7 @@ ENTRY(fiq_getregs)
BACK_TO_SVC_MODE
RET
+END(fiq_getregs)
/*
* fiq_setregs:
@@ -88,6 +89,7 @@ ENTRY(fiq_setregs)
BACK_TO_SVC_MODE
RET
+END(fiq_setregs)
/*
* fiq_nullhandler:
diff --git a/sys/arm/arm/fusu.S b/sys/arm/arm/fusu.S
index edf1a63..443ca21 100644
--- a/sys/arm/arm/fusu.S
+++ b/sys/arm/arm/fusu.S
@@ -76,6 +76,8 @@ ENTRY(casuword)
mov r1, #0x00000000
str r1, [r3, #PCB_ONFAULT]
RET
+END(casuword32)
+END(casuword)
/*
* Handle faults from casuword. Clean up and return -1.
@@ -87,6 +89,7 @@ ENTRY(casuword)
mvn r0, #0x00000000
ldmfd sp!, {r4, r5}
RET
+
/*
* fuword(caddr_t uaddr);
* Fetch an int from the user's address space.
@@ -111,6 +114,8 @@ ENTRY(fuword)
str r1, [r2, #PCB_ONFAULT]
mov r0, r3
RET
+END(fuword32)
+END(fuword)
/*
* fusword(caddr_t uaddr);
@@ -139,6 +144,7 @@ ENTRY(fusword)
mov r1, #0x00000000
str r1, [r2, #PCB_ONFAULT]
RET
+END(fusword)
/*
* fuswintr(caddr_t uaddr);
@@ -175,6 +181,7 @@ ENTRY(fuswintr)
mov r1, #0x00000000
str r1, [r2, #PCB_ONFAULT]
RET
+END(fuswintr)
Lblock_userspace_access:
.word _C_LABEL(block_userspace_access)
@@ -209,6 +216,7 @@ ENTRY(fubyte)
str r1, [r2, #PCB_ONFAULT]
mov r0, r3
RET
+END(fubyte)
/*
* Handle faults from [fs]u*(). Clean up and return -1.
@@ -272,6 +280,8 @@ ENTRY(suword)
mov r0, #0x00000000
str r0, [r2, #PCB_ONFAULT]
RET
+END(suword32)
+END(suword)
/*
* suswintr(caddr_t uaddr, short x);
@@ -309,6 +319,7 @@ ENTRY(suswintr)
mov r0, #0x00000000
str r0, [r2, #PCB_ONFAULT]
RET
+END(suswintr)
/*
* susword(caddr_t uaddr, short x);
@@ -339,6 +350,7 @@ ENTRY(susword)
mov r0, #0x00000000
str r0, [r2, #PCB_ONFAULT]
RET
+END(susword)
/*
* subyte(caddr_t uaddr, char x);
@@ -362,3 +374,5 @@ ENTRY(subyte)
mov r0, #0x00000000
str r0, [r2, #PCB_ONFAULT]
RET
+END(subyte)
+
diff --git a/sys/arm/arm/in_cksum_arm.S b/sys/arm/arm/in_cksum_arm.S
index 3646c64..6305caf 100644
--- a/sys/arm/arm/in_cksum_arm.S
+++ b/sys/arm/arm/in_cksum_arm.S
@@ -90,13 +90,15 @@ ENTRY(in_cksum)
and r0, r0, r1
eor r0, r0, r1
ldmfd sp!, {r4-r11,pc}
-
+END(in_cksum)
ENTRY(do_cksum)
stmfd sp!, {r4-r7, lr}
bl L_cksumdata
mov r0, r2
ldmfd sp!, {r4-r7, pc}
+END(do_cksum)
+
/*
* The main in*_cksum() workhorse...
*
@@ -337,3 +339,5 @@ ASENTRY_NP(L_cksumdata)
adds r2, r2, r3
adc r2, r2, #0x00
RET
+END(L_cksumdata)
+
diff --git a/sys/arm/arm/irq_dispatch.S b/sys/arm/arm/irq_dispatch.S
index 6e510dd..823091d 100644
--- a/sys/arm/arm/irq_dispatch.S
+++ b/sys/arm/arm/irq_dispatch.S
@@ -97,6 +97,7 @@ ASENTRY_NP(irq_entry)
DO_AST
PULLFRAMEFROMSVCANDEXIT
movs pc, lr /* Exit */
+END(irq_entry)
.data
.align 0
diff --git a/sys/arm/arm/locore.S b/sys/arm/arm/locore.S
index 37e88fe..51fd5c1 100644
--- a/sys/arm/arm/locore.S
+++ b/sys/arm/arm/locore.S
@@ -242,6 +242,9 @@ Lstartup_pagetable:
Lstartup_pagetable_secondary:
.word temp_pagetable
#endif
+END(btext)
+END(_start)
+
mmu_init_table:
/* fill all table VA==PA */
/* map SDRAM VA==PA, WT cacheable */
@@ -324,6 +327,7 @@ ASENTRY_NP(mptramp)
Lpmureg:
.word 0xd0022124
+END(mptramp)
ASENTRY_NP(mpentry)
@@ -408,6 +412,7 @@ mpvirt_done:
.Lmpreturned:
.asciz "main() returned"
.align 0
+END(mpentry)
#endif
ENTRY_NP(cpu_halt)
@@ -461,6 +466,7 @@ ENTRY_NP(cpu_halt)
*/
.Lcpu_reset_needs_v4_MMU_disable:
.word _C_LABEL(cpu_reset_needs_v4_MMU_disable)
+END(cpu_halt)
/*
@@ -470,11 +476,13 @@ ENTRY(setjmp)
stmia r0, {r4-r14}
mov r0, #0x00000000
RET
+END(setjmp)
ENTRY(longjmp)
ldmia r0, {r4-r14}
mov r0, #0x00000001
RET
+END(longjmp)
.data
.global _C_LABEL(esym)
@@ -482,6 +490,7 @@ _C_LABEL(esym): .word _C_LABEL(end)
ENTRY_NP(abort)
b _C_LABEL(abort)
+END(abort)
ENTRY_NP(sigcode)
mov r0, sp
@@ -517,4 +526,5 @@ ENTRY_NP(sigcode)
.global szsigcode
szsigcode:
.long esigcode-sigcode
+END(sigcode)
/* End of locore.S */
diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c
index 2affa3e..0083f29 100644
--- a/sys/arm/arm/pmap-v6.c
+++ b/sys/arm/arm/pmap-v6.c
@@ -3313,6 +3313,45 @@ pmap_copy_page_generic(vm_paddr_t src, vm_paddr_t dst)
}
void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+ vm_page_t a_pg, b_pg;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ mtx_lock(&cmtx);
+ while (xfersize > 0) {
+ a_pg = ma[a_offset >> PAGE_SHIFT];
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ b_pg = mb[b_offset >> PAGE_SHIFT];
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ *csrc_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(a_pg) |
+ pte_l2_s_cache_mode;
+ pmap_set_prot(csrc_pte, VM_PROT_READ, 0);
+ PTE_SYNC(csrc_pte);
+ *cdst_pte = L2_S_PROTO | VM_PAGE_TO_PHYS(b_pg) |
+ pte_l2_s_cache_mode;
+ pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0);
+ PTE_SYNC(cdst_pte);
+ cpu_tlb_flushD_SE(csrcp);
+ cpu_tlb_flushD_SE(cdstp);
+ cpu_cpwait();
+ bcopy((char *)csrcp + a_pg_offset, (char *)cdstp + b_pg_offset,
+ cnt);
+ cpu_idcache_wbinv_range(cdstp + b_pg_offset, cnt);
+ pmap_l2cache_wbinv_range(cdstp + b_pg_offset,
+ VM_PAGE_TO_PHYS(b_pg) + b_pg_offset, cnt);
+ xfersize -= cnt;
+ a_offset += cnt;
+ b_offset += cnt;
+ }
+ mtx_unlock(&cmtx);
+}
+
+void
pmap_copy_page(vm_page_t src, vm_page_t dst)
{
diff --git a/sys/arm/arm/pmap.c b/sys/arm/arm/pmap.c
index 7070cb2..c18783b 100644
--- a/sys/arm/arm/pmap.c
+++ b/sys/arm/arm/pmap.c
@@ -258,6 +258,9 @@ pt_entry_t pte_l1_c_proto;
pt_entry_t pte_l2_s_proto;
void (*pmap_copy_page_func)(vm_paddr_t, vm_paddr_t);
+void (*pmap_copy_page_offs_func)(vm_paddr_t a_phys,
+ vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs,
+ int cnt);
void (*pmap_zero_page_func)(vm_paddr_t, int, int);
struct msgbuf *msgbufp = 0;
@@ -400,6 +403,13 @@ static vm_paddr_t pmap_kernel_l2ptp_phys;
static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0;
static struct rwlock pvh_global_lock;
+void pmap_copy_page_offs_generic(vm_paddr_t a_phys, vm_offset_t a_offs,
+ vm_paddr_t b_phys, vm_offset_t b_offs, int cnt);
+#if ARM_MMU_XSCALE == 1
+void pmap_copy_page_offs_xscale(vm_paddr_t a_phys, vm_offset_t a_offs,
+ vm_paddr_t b_phys, vm_offset_t b_offs, int cnt);
+#endif
+
/*
* This list exists for the benefit of pmap_map_chunk(). It keeps track
* of the kernel L2 tables during bootstrap, so that pmap_map_chunk() can
@@ -484,6 +494,7 @@ pmap_pte_init_generic(void)
pte_l2_s_proto = L2_S_PROTO_generic;
pmap_copy_page_func = pmap_copy_page_generic;
+ pmap_copy_page_offs_func = pmap_copy_page_offs_generic;
pmap_zero_page_func = pmap_zero_page_generic;
}
@@ -660,6 +671,7 @@ pmap_pte_init_xscale(void)
#ifdef CPU_XSCALE_CORE3
pmap_copy_page_func = pmap_copy_page_generic;
+ pmap_copy_page_offs_func = pmap_copy_page_offs_generic;
pmap_zero_page_func = pmap_zero_page_generic;
xscale_use_minidata = 0;
/* Make sure it is L2-cachable */
@@ -672,6 +684,7 @@ pmap_pte_init_xscale(void)
#else
pmap_copy_page_func = pmap_copy_page_xscale;
+ pmap_copy_page_offs_func = pmap_copy_page_offs_xscale;
pmap_zero_page_func = pmap_zero_page_xscale;
#endif
@@ -4300,6 +4313,29 @@ pmap_copy_page_generic(vm_paddr_t src, vm_paddr_t dst)
cpu_l2cache_inv_range(csrcp, PAGE_SIZE);
cpu_l2cache_wbinv_range(cdstp, PAGE_SIZE);
}
+
+void
+pmap_copy_page_offs_generic(vm_paddr_t a_phys, vm_offset_t a_offs,
+ vm_paddr_t b_phys, vm_offset_t b_offs, int cnt)
+{
+
+ mtx_lock(&cmtx);
+ *csrc_pte = L2_S_PROTO | a_phys |
+ L2_S_PROT(PTE_KERNEL, VM_PROT_READ) | pte_l2_s_cache_mode;
+ PTE_SYNC(csrc_pte);
+ *cdst_pte = L2_S_PROTO | b_phys |
+ L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE) | pte_l2_s_cache_mode;
+ PTE_SYNC(cdst_pte);
+ cpu_tlb_flushD_SE(csrcp);
+ cpu_tlb_flushD_SE(cdstp);
+ cpu_cpwait();
+ bcopy((char *)csrcp + a_offs, (char *)cdstp + b_offs, cnt);
+ mtx_unlock(&cmtx);
+ cpu_dcache_inv_range(csrcp + a_offs, cnt);
+ cpu_dcache_wbinv_range(cdstp + b_offs, cnt);
+ cpu_l2cache_inv_range(csrcp + a_offs, cnt);
+ cpu_l2cache_wbinv_range(cdstp + b_offs, cnt);
+}
#endif /* (ARM_MMU_GENERIC + ARM_MMU_SA1) != 0 */
#if ARM_MMU_XSCALE == 1
@@ -4344,6 +4380,28 @@ pmap_copy_page_xscale(vm_paddr_t src, vm_paddr_t dst)
mtx_unlock(&cmtx);
xscale_cache_clean_minidata();
}
+
+void
+pmap_copy_page_offs_xscale(vm_paddr_t a_phys, vm_offset_t a_offs,
+ vm_paddr_t b_phys, vm_offset_t b_offs, int cnt)
+{
+
+ mtx_lock(&cmtx);
+ *csrc_pte = L2_S_PROTO | a_phys |
+ L2_S_PROT(PTE_KERNEL, VM_PROT_READ) |
+ L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X);
+ PTE_SYNC(csrc_pte);
+ *cdst_pte = L2_S_PROTO | b_phys |
+ L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE) |
+ L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X);
+ PTE_SYNC(cdst_pte);
+ cpu_tlb_flushD_SE(csrcp);
+ cpu_tlb_flushD_SE(cdstp);
+ cpu_cpwait();
+ bcopy((char *)csrcp + a_offs, (char *)cdstp + b_offs, cnt);
+ mtx_unlock(&cmtx);
+ xscale_cache_clean_minidata();
+}
#endif /* ARM_MMU_XSCALE == 1 */
void
@@ -4370,8 +4428,41 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
#endif
}
+void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+ vm_page_t a_pg, b_pg;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+#ifdef ARM_USE_SMALL_ALLOC
+ vm_offset_t a_va, b_va;
+#endif
-
+ cpu_dcache_wbinv_all();
+ cpu_l2cache_wbinv_all();
+ while (xfersize > 0) {
+ a_pg = ma[a_offset >> PAGE_SHIFT];
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ b_pg = mb[b_offset >> PAGE_SHIFT];
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+#ifdef ARM_USE_SMALL_ALLOC
+ a_va = arm_ptovirt(VM_PAGE_TO_PHYS(a_pg)) + a_pg_offset;
+ b_va = arm_ptovirt(VM_PAGE_TO_PHYS(b_pg)) + b_pg_offset;
+ bcopy((char *)a_va, (char *)b_va, cnt);
+ cpu_dcache_wbinv_range(b_va, cnt);
+ cpu_l2cache_wbinv_range(b_va, cnt);
+#else
+ pmap_copy_page_offs_func(VM_PAGE_TO_PHYS(a_pg), a_pg_offset,
+ VM_PAGE_TO_PHYS(b_pg), b_pg_offset, cnt);
+#endif
+ xfersize -= cnt;
+ a_offset += cnt;
+ b_offset += cnt;
+ }
+}
/*
* this routine returns true if a physical page resides
diff --git a/sys/arm/arm/setcpsr.S b/sys/arm/arm/setcpsr.S
index 4597d53..ac86ba3 100644
--- a/sys/arm/arm/setcpsr.S
+++ b/sys/arm/arm/setcpsr.S
@@ -66,6 +66,7 @@ ENTRY_NP(SetCPSR)
mov r0, r3 /* Return the old CPSR */
RET
+END(SetCPSR)
/* Gets the CPSR register
@@ -77,4 +78,5 @@ ENTRY_NP(GetCPSR)
mrs r0, cpsr /* Get the CPSR */
RET
+END(GetCPSR)
diff --git a/sys/arm/arm/support.S b/sys/arm/arm/support.S
index d4c6fb4..0c117a9 100644
--- a/sys/arm/arm/support.S
+++ b/sys/arm/arm/support.S
@@ -277,6 +277,8 @@ do_memset:
strgeb r3, [ip], #0x01 /* Set another byte */
strgtb r3, [ip] /* and a third */
RET /* Exit */
+END(bzero)
+END(memset)
ENTRY(bcmp)
mov ip, r0
@@ -386,6 +388,7 @@ ENTRY(bcmp)
RETne /* Return if mismatch on #4 */
sub r0, r3, r2 /* r0 = b1#5 - b2#5 */
RET
+END(bcmp)
ENTRY(bcopy)
/* switch the source and destination registers */
@@ -929,6 +932,8 @@ ENTRY(memmove)
.Lmemmove_bsrcul1l4:
add r1, r1, #1
b .Lmemmove_bl4
+END(bcopy)
+END(memmove)
#if !defined(_ARM_ARCH_5E)
ENTRY(memcpy)
@@ -1164,6 +1169,8 @@ ENTRY(memcpy)
.Lmemcpy_srcul3l4:
sub r1, r1, #1
b .Lmemcpy_l4
+END(memcpy)
+
#else
/* LINTSTUB: Func: void *memcpy(void *dst, const void *src, size_t len) */
ENTRY(memcpy)
@@ -2932,6 +2939,7 @@ ENTRY(memcpy)
strh r2, [r0, #0x09]
strb r1, [r0, #0x0b]
RET
+END(memcpy)
#endif /* _ARM_ARCH_5E */
#ifdef GPROF
diff --git a/sys/arm/arm/swtch.S b/sys/arm/arm/swtch.S
index 4257557..f10b8f9 100644
--- a/sys/arm/arm/swtch.S
+++ b/sys/arm/arm/swtch.S
@@ -213,6 +213,7 @@ ENTRY(cpu_throw)
add sp, sp, #4;
ldmfd sp!, {r4-r7, pc}
+END(cpu_throw)
ENTRY(cpu_switch)
stmfd sp!, {r4-r7, lr}
@@ -502,6 +503,8 @@ ENTRY(cpu_switch)
.Lswitch_panic_str:
.asciz "cpu_switch: sched_qs empty with non-zero sched_whichqs!\n"
#endif
+END(cpu_switch)
+
ENTRY(savectx)
stmfd sp!, {r4-r7, lr}
sub sp, sp, #4
@@ -534,6 +537,7 @@ ENTRY(savectx)
#endif /* ARM_VFP_SUPPORT */
add sp, sp, #4;
ldmfd sp!, {r4-r7, pc}
+END(savectx)
ENTRY(fork_trampoline)
mov r1, r5
@@ -551,3 +555,5 @@ ENTRY(fork_trampoline)
movs pc, lr /* Exit */
AST_LOCALS
+END(fork_trampoline)
+
diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c
index 9da2aba..d7c1019 100644
--- a/sys/arm/at91/if_ate.c
+++ b/sys/arm/at91/if_ate.c
@@ -899,12 +899,9 @@ ate_intr(void *xsc)
/* FCS is not coppied into mbuf. */
remain = (sc->rx_descs[idx].status & ETH_LEN_MASK) - 4;
- /* Get an appropriately sized mbuf */
- if (remain + ETHER_ALIGN >= MINCLSIZE)
- mb = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
- else
- MGETHDR(mb, M_NOWAIT, MT_DATA);
-
+ /* Get an appropriately sized mbuf. */
+ mb = m_get2(remain + ETHER_ALIGN, M_NOWAIT, MT_DATA,
+ M_PKTHDR);
if (mb == NULL) {
sc->ifp->if_iqdrops++;
rxdhead->status = 0;
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
index 3512954..f4a2de6 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
@@ -122,9 +122,7 @@ struct bcm_sdhci_softc {
int sc_dma_ch;
bus_dma_tag_t sc_dma_tag;
bus_dmamap_t sc_dma_map;
- void *sc_dma_buffer;
- vm_paddr_t sc_dma_buffer_phys;
- vm_paddr_t sc_sdhci_buffer_phys;;
+ vm_paddr_t sc_sdhci_buffer_phys;
};
static int bcm_sdhci_probe(device_t);
@@ -171,9 +169,6 @@ bcm_sdhci_attach(device_t dev)
phandle_t node;
pcell_t cell;
int default_freq;
- void *buffer;
- vm_paddr_t buffer_phys;
- void *va;
sc->sc_dev = dev;
sc->sc_req = NULL;
@@ -210,7 +205,7 @@ bcm_sdhci_attach(device_t dev)
goto fail;
}
- if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
+ if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
NULL, bcm_sdhci_intr, sc, &sc->sc_intrhand))
{
bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res);
@@ -243,7 +238,7 @@ bcm_sdhci_attach(device_t dev)
bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc);
- /* Allocate DMA buffers */
+ /* Allocate bus_dma resources. */
err = bus_dma_tag_create(bus_get_dma_tag(dev),
1, 0, BUS_SPACE_MAXADDR_32BIT,
BUS_SPACE_MAXADDR, NULL, NULL,
@@ -256,37 +251,14 @@ bcm_sdhci_attach(device_t dev)
goto fail;
}
- err = bus_dmamem_alloc(sc->sc_dma_tag, &buffer,
- BUS_DMA_WAITOK | BUS_DMA_COHERENT| BUS_DMA_ZERO,
- &sc->sc_dma_map);
-
- if (err) {
- device_printf(dev, "cannot allocate DMA memory\n");
- goto fail;
- }
-
- err = bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map, buffer,
- BCM_SDHCI_BUFFER_SIZE, bcm_dmamap_cb, &buffer_phys,
- BUS_DMA_WAITOK);
+ err = bus_dmamap_create(sc->sc_dma_tag, 0, &sc->sc_dma_map);
if (err) {
- device_printf(dev, "cannot load DMA memory\n");
- goto fail;
- }
-
- /*
- * Sanity check: two least bits of address should be zero
- */
- if ((uintptr_t)buffer & 3) {
- device_printf(dev,
- "DMA address is not word-aligned\n");
+ device_printf(dev, "bus_dmamap_create failed\n");
goto fail;
}
- sc->sc_dma_buffer = buffer;
- sc->sc_dma_buffer_phys = buffer_phys;
- va = (void*)rman_get_start(sc->sc_mem_res);
- sc->sc_sdhci_buffer_phys =
- pmap_kextract((vm_offset_t)va) + SDHCI_BUFFER;
+ sc->sc_sdhci_buffer_phys = BUS_SPACE_PHYSADDR(sc->sc_mem_res,
+ SDHCI_BUFFER);
bus_generic_probe(dev);
bus_generic_attach(dev);
@@ -447,27 +419,23 @@ bcm_sdhci_dma_intr(int ch, void *arg)
struct bcm_sdhci_softc *sc = (struct bcm_sdhci_softc *)arg;
struct sdhci_slot *slot = &sc->sc_slot;
uint32_t reg, mask;
- void *buffer;
+ bus_addr_t pmem;
+ vm_paddr_t pdst, psrc;
size_t len;
- int left;
+ int left, sync_op;
mtx_lock(&slot->mtx);
- /* copy DMA buffer to VA if READ */
len = bcm_dma_length(sc->sc_dma_ch);
if (slot->curcmd->data->flags & MMC_DATA_READ) {
- bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
- BUS_DMASYNC_POSTREAD);
-
+ sync_op = BUS_DMASYNC_POSTREAD;
mask = SDHCI_INT_DATA_AVAIL;
- /* all dma data in single or contiguous page */
- buffer = (uint8_t*)(slot->curcmd->data->data) + slot->offset;
- memcpy(buffer, sc->sc_dma_buffer, len);
} else {
- bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
- BUS_DMASYNC_POSTWRITE);
+ sync_op = BUS_DMASYNC_POSTWRITE;
mask = SDHCI_INT_SPACE_AVAIL;
}
+ bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op);
+ bus_dmamap_unload(sc->sc_dma_tag, sc->sc_dma_map);
slot->offset += len;
sc->sc_dma_inuse = 0;
@@ -501,27 +469,22 @@ bcm_sdhci_dma_intr(int ch, void *arg)
SDHCI_INT_STATUS, mask);
/* continue next DMA transfer */
+ bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map,
+ (uint8_t *)slot->curcmd->data->data +
+ slot->offset, left, bcm_dmamap_cb, &pmem, 0);
if (slot->curcmd->data->flags & MMC_DATA_READ) {
- bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
- BUS_DMASYNC_PREREAD);
-
- /* DMA start */
- if (bcm_dma_start(sc->sc_dma_ch,
- sc->sc_sdhci_buffer_phys,
- sc->sc_dma_buffer_phys, left) != 0)
- device_printf(sc->sc_dev, "failed DMA start\n");
+ psrc = sc->sc_sdhci_buffer_phys;
+ pdst = pmem;
+ sync_op = BUS_DMASYNC_PREREAD;
} else {
- buffer = (char*)slot->curcmd->data->data + slot->offset;
- memcpy(sc->sc_dma_buffer, buffer, left);
-
- bus_dmamap_sync(sc->sc_dma_tag,
- sc->sc_dma_map, BUS_DMASYNC_PREWRITE);
-
- /* DMA start */
- if (bcm_dma_start(sc->sc_dma_ch,
- sc->sc_dma_buffer_phys,
- sc->sc_sdhci_buffer_phys, left) != 0)
- device_printf(sc->sc_dev, "failed DMA start\n");
+ psrc = pmem;
+ pdst = sc->sc_sdhci_buffer_phys;
+ sync_op = BUS_DMASYNC_PREWRITE;
+ }
+ bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map, sync_op);
+ if (bcm_dma_start(sc->sc_dma_ch, psrc, pdst, left)) {
+ /* XXX stop xfer, other error recovery? */
+ device_printf(sc->sc_dev, "failed DMA start\n");
}
} else {
/* wait for next data by INT */
@@ -542,6 +505,7 @@ bcm_sdhci_read_dma(struct sdhci_slot *slot)
{
struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
size_t left;
+ bus_addr_t paddr;
if (sc->sc_dma_inuse) {
device_printf(sc->sc_dev, "DMA in use\n");
@@ -562,12 +526,16 @@ bcm_sdhci_read_dma(struct sdhci_slot *slot)
BCM_DMA_INC_ADDR,
(left & 0xf) ? BCM_DMA_32BIT : BCM_DMA_128BIT);
+ bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map,
+ (uint8_t *)slot->curcmd->data->data + slot->offset, left,
+ bcm_dmamap_cb, &paddr, 0);
+
bus_dmamap_sync(sc->sc_dma_tag, sc->sc_dma_map,
BUS_DMASYNC_PREREAD);
/* DMA start */
if (bcm_dma_start(sc->sc_dma_ch, sc->sc_sdhci_buffer_phys,
- sc->sc_dma_buffer_phys, left) != 0)
+ paddr, left) != 0)
device_printf(sc->sc_dev, "failed DMA start\n");
}
@@ -575,8 +543,8 @@ static void
bcm_sdhci_write_dma(struct sdhci_slot *slot)
{
struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
- char *buffer;
size_t left;
+ bus_addr_t paddr;
if (sc->sc_dma_inuse) {
device_printf(sc->sc_dev, "DMA in use\n");
@@ -591,8 +559,9 @@ bcm_sdhci_write_dma(struct sdhci_slot *slot)
KASSERT((left & 3) == 0,
("%s: len = %d, not word-aligned", __func__, left));
- buffer = (char*)slot->curcmd->data->data + slot->offset;
- memcpy(sc->sc_dma_buffer, buffer, left);
+ bus_dmamap_load(sc->sc_dma_tag, sc->sc_dma_map,
+ (uint8_t *)slot->curcmd->data->data + slot->offset, left,
+ bcm_dmamap_cb, &paddr, 0);
bcm_dma_setup_src(sc->sc_dma_ch, BCM_DMA_DREQ_NONE,
BCM_DMA_INC_ADDR,
@@ -604,7 +573,7 @@ bcm_sdhci_write_dma(struct sdhci_slot *slot)
BUS_DMASYNC_PREWRITE);
/* DMA start */
- if (bcm_dma_start(sc->sc_dma_ch, sc->sc_dma_buffer_phys,
+ if (bcm_dma_start(sc->sc_dma_ch, paddr,
sc->sc_sdhci_buffer_phys, left) != 0)
device_printf(sc->sc_dev, "failed DMA start\n");
}
@@ -614,11 +583,16 @@ bcm_sdhci_will_handle_transfer(device_t dev, struct sdhci_slot *slot)
{
size_t left;
- /* Do not use DMA for transfers less then block size */
+ /*
+ * Do not use DMA for transfers less than block size or with a length
+ * that is not a multiple of four.
+ */
left = min(BCM_DMA_BLOCK_SIZE,
slot->curcmd->data->len - slot->offset);
if (left < BCM_DMA_BLOCK_SIZE)
return (0);
+ if (left & 0x03)
+ return (0);
return (1);
}
diff --git a/sys/arm/include/asm.h b/sys/arm/include/asm.h
index 3ae25b8..81f67a3 100644
--- a/sys/arm/include/asm.h
+++ b/sys/arm/include/asm.h
@@ -66,6 +66,16 @@
# define _ALIGN_TEXT .align 0
#endif
+#ifdef __ARM_EABI__
+#define STOP_UNWINDING .cantunwind
+#define _FNSTART .fnstart
+#define _FNEND .fnend
+#else
+#define STOP_UNWINDING
+#define _FNSTART
+#define _FNEND
+#endif
+
/*
* gas/arm uses @ as a single comment character and thus cannot be used here
* Instead it recognised the # instead of an @ symbols in .type directives
@@ -76,7 +86,9 @@
#define _ASM_TYPE_OBJECT #object
#define GLOBAL(X) .globl x
#define _ENTRY(x) \
- .text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x:
+ .text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x: _FNSTART
+
+#define END(x) .size x, . - x; _FNEND
#ifdef GPROF
# define _PROF_PROLOGUE \
diff --git a/sys/arm/include/bus.h b/sys/arm/include/bus.h
index cabf1f7..ce8f5ad 100644
--- a/sys/arm/include/bus.h
+++ b/sys/arm/include/bus.h
@@ -725,4 +725,12 @@ bs_c_8_proto(f);
#include <machine/bus_dma.h>
+/*
+ * Get the physical address of a bus space memory-mapped resource.
+ * Doing this as a macro is a temporary solution until a more robust fix is
+ * designed. It also serves to mark the locations needing that fix.
+ */
+#define BUS_SPACE_PHYSADDR(res, offs) \
+ (vtophys(rman_get_start(res)+(offs)))
+
#endif /* _MACHINE_BUS_H_ */
diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h
index 4a7ebbd..8c535e8 100644
--- a/sys/arm/include/param.h
+++ b/sys/arm/include/param.h
@@ -56,7 +56,7 @@
#define MACHINE "arm"
#endif
#ifndef MACHINE_ARCH
-#ifdef __FreeBSD_ARCH_armv6__
+#if defined(__FreeBSD_ARCH_armv6__) || (defined(__ARM_ARCH) && __ARM_ARCH >= 6)
#ifdef __ARMEB__
#define MACHINE_ARCH "armv6eb"
#else
diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h
index 523499f..7c8d073 100644
--- a/sys/arm/include/pmap.h
+++ b/sys/arm/include/pmap.h
@@ -533,6 +533,8 @@ extern pt_entry_t pte_l1_c_proto;
extern pt_entry_t pte_l2_s_proto;
extern void (*pmap_copy_page_func)(vm_paddr_t, vm_paddr_t);
+extern void (*pmap_copy_page_offs_func)(vm_paddr_t a_phys,
+ vm_offset_t a_offs, vm_paddr_t b_phys, vm_offset_t b_offs, int cnt);
extern void (*pmap_zero_page_func)(vm_paddr_t, int, int);
#if (ARM_MMU_GENERIC + ARM_MMU_V6 + ARM_MMU_V7 + ARM_MMU_SA1) != 0 || defined(CPU_XSCALE_81342)
diff --git a/sys/arm/include/signal.h b/sys/arm/include/signal.h
index 2170082..4b6fa37 100644
--- a/sys/arm/include/signal.h
+++ b/sys/arm/include/signal.h
@@ -42,6 +42,7 @@ typedef long sig_atomic_t;
#if __BSD_VISIBLE
struct sigcontext {
+ int _dummy;
};
#endif
diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c
index 93702df..4b01a74 100644
--- a/sys/arm/ti/cpsw/if_cpsw.c
+++ b/sys/arm/ti/cpsw/if_cpsw.c
@@ -327,7 +327,7 @@ cpsw_debugf(const char *fmt, ...)
#define cpsw_cpdma_bd_offset(i) (CPSW_CPPI_RAM_OFFSET + ((i)*16))
#define cpsw_cpdma_bd_paddr(sc, slot) \
- (slot->bd_offset + vtophys(rman_get_start(sc->res[0])))
+ BUS_SPACE_PHYSADDR(sc->res[0], slot->bd_offset)
#define cpsw_cpdma_read_bd(sc, slot, val) \
bus_read_region_4(sc->res[0], slot->bd_offset, (uint32_t *) val, 4)
#define cpsw_cpdma_write_bd(sc, slot, val) \
diff --git a/sys/arm/ti/ti_mmchs.c b/sys/arm/ti/ti_mmchs.c
index cf9dc21..76ecc58 100644
--- a/sys/arm/ti/ti_mmchs.c
+++ b/sys/arm/ti/ti_mmchs.c
@@ -1584,7 +1584,6 @@ static int
ti_mmchs_activate(device_t dev)
{
struct ti_mmchs_softc *sc = device_get_softc(dev);
- unsigned long addr;
int rid;
int err;
@@ -1630,8 +1629,8 @@ ti_mmchs_activate(device_t dev)
panic("Unknown OMAP device\n");
/* Get the physical address of the MMC data register, needed for DMA */
- addr = vtophys(rman_get_start(sc->sc_mem_res));
- sc->sc_data_reg_paddr = addr + sc->sc_reg_off + MMCHS_DATA;
+ sc->sc_data_reg_paddr = BUS_SPACE_PHYSADDR(sc->sc_mem_res,
+ sc->sc_reg_off + MMCHS_DATA);
/* Set the initial power state to off */
sc->sc_cur_power_mode = power_off;
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index 3a4152e..8990d90 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -297,15 +297,16 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
* the MI code below uses the p_vaddr fields with an offset added for
* loading (doing so is arguably wrong). To make loading work, we need
* an offset that represents the difference between physical and virtual
- * addressing. ARM kernels are always linked at 0xC0000000. Depending
+ * addressing. ARM kernels are always linked at 0xCnnnnnnn. Depending
* on the headers, the offset value passed in may be physical or virtual
* (because it typically comes from e_entry), but we always replace
* whatever is passed in with the va<->pa offset. On the other hand, we
- * only adjust the entry point if it's a virtual address to begin with.
+ * always remove the high-order part of the entry address whether it's
+ * physical or virtual, because it will be adjusted later for the actual
+ * physical entry point based on where the image gets loaded.
*/
- off = -0xc0000000u;
- if ((ehdr->e_entry & 0xc0000000u) == 0xc0000000u)
- ehdr->e_entry += off;
+ off = -0xc0000000;
+ ehdr->e_entry &= ~0xf0000000;
#ifdef ELF_VERBOSE
printf("ehdr->e_entry 0x%08x, va<->pa off %llx\n", ehdr->e_entry, off);
#endif
@@ -396,6 +397,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
"_loadimage: failed to read section headers");
goto nosyms;
}
+ file_addmetadata(fp, MODINFOMD_SHDR, chunk, shdr);
+
symtabindex = -1;
symstrindex = -1;
for (i = 0; i < ehdr->e_shnum; i++) {
diff --git a/sys/boot/fdt/fdt_loader_cmd.c b/sys/boot/fdt/fdt_loader_cmd.c
index 1d65fe7..b32fddf 100644
--- a/sys/boot/fdt/fdt_loader_cmd.c
+++ b/sys/boot/fdt/fdt_loader_cmd.c
@@ -118,16 +118,17 @@ static char cwd[FDT_CWD_LEN] = "/";
static vm_offset_t
fdt_find_static_dtb()
{
- Elf_Dyn dyn;
+ Elf_Ehdr *ehdr;
+ Elf_Shdr *shdr;
Elf_Sym sym;
- vm_offset_t dyntab, esym, strtab, symtab, fdt_start;
+ vm_offset_t strtab, symtab, fdt_start;
uint64_t offs;
struct preloaded_file *kfp;
struct file_metadata *md;
char *strp;
- int sym_count;
+ int i, sym_count;
- symtab = strtab = dyntab = esym = 0;
+ symtab = strtab = 0;
strp = NULL;
offs = __elfN(relocation_offset);
@@ -136,42 +137,26 @@ fdt_find_static_dtb()
if (kfp == NULL)
return (0);
- md = file_findmetadata(kfp, MODINFOMD_ESYM);
+ /* Locate the dynamic symbols and strtab. */
+ md = file_findmetadata(kfp, MODINFOMD_ELFHDR);
if (md == NULL)
return (0);
- bcopy(md->md_data, &esym, sizeof(esym));
- /* esym is already offset */
+ ehdr = (Elf_Ehdr *)md->md_data;
- md = file_findmetadata(kfp, MODINFOMD_DYNAMIC);
+ md = file_findmetadata(kfp, MODINFOMD_SHDR);
if (md == NULL)
return (0);
- bcopy(md->md_data, &dyntab, sizeof(dyntab));
- dyntab += offs;
-
- /* Locate STRTAB and DYNTAB */
- for (;;) {
- COPYOUT(dyntab, &dyn, sizeof(dyn));
- if (dyn.d_tag == DT_STRTAB) {
- strtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs;
- } else if (dyn.d_tag == DT_SYMTAB) {
- symtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs;
- } else if (dyn.d_tag == DT_NULL) {
- break;
+ shdr = (Elf_Shdr *)md->md_data;
+
+ for (i = 0; i < ehdr->e_shnum; ++i) {
+ if (shdr[i].sh_type == SHT_DYNSYM && symtab == 0) {
+ symtab = shdr[i].sh_addr + offs;
+ sym_count = shdr[i].sh_size / sizeof(Elf_Sym);
+ } else if (shdr[i].sh_type == SHT_STRTAB && strtab == 0) {
+ strtab = shdr[i].sh_addr + offs;
}
- dyntab += sizeof(dyn);
}
- if (symtab == 0 || strtab == 0) {
- /*
- * No symtab? No strtab? That should not happen here,
- * and should have been verified during __elfN(loadimage).
- * This must be some kind of a bug.
- */
- return (0);
- }
-
- sym_count = (int)(esym - symtab) / sizeof(Elf_Sym);
-
/*
* The most efficent way to find a symbol would be to calculate a
* hash, find proper bucket and chain, and thus find a symbol.
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
index dc64682..a8916d2 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
@@ -271,7 +271,7 @@ uint64_t zfs_deadman_synctime = 1000ULL;
TUNABLE_QUAD("vfs.zfs.deadman_synctime", &zfs_deadman_synctime);
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, deadman_synctime, CTLFLAG_RDTUN,
&zfs_deadman_synctime, 0,
- "Stalled ZFS I/O expiration time in units of vfs.zfs.txg_synctime_ms");
+ "Stalled ZFS I/O expiration time in units of vfs.zfs.txg.synctime_ms");
/*
* Default value of -1 for zfs_deadman_enabled is resolved in
diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
index cad30d3..8546e2c 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
@@ -2313,10 +2313,10 @@ extern int dtrace_mach_aframes(void);
#if defined(__i386) || defined(__amd64)
extern int dtrace_instr_size(uchar_t *instr);
extern int dtrace_instr_size_isa(uchar_t *, model_t, int *);
-extern void dtrace_invop_add(int (*)(uintptr_t, uintptr_t *, uintptr_t));
-extern void dtrace_invop_remove(int (*)(uintptr_t, uintptr_t *, uintptr_t));
extern void dtrace_invop_callsite(void);
#endif
+extern void dtrace_invop_add(int (*)(uintptr_t, uintptr_t *, uintptr_t));
+extern void dtrace_invop_remove(int (*)(uintptr_t, uintptr_t *, uintptr_t));
#ifdef __sparc
extern int dtrace_blksuword32(uintptr_t, uint32_t *, int);
@@ -2349,6 +2349,15 @@ extern void dtrace_helpers_destroy(proc_t *);
#define DTRACE_INVOP_NOP 4
#define DTRACE_INVOP_RET 5
+#elif defined(__powerpc__)
+
+#define DTRACE_INVOP_RET 1
+#define DTRACE_INVOP_BCTR 2
+#define DTRACE_INVOP_BLR 3
+#define DTRACE_INVOP_JUMP 4
+#define DTRACE_INVOP_MFLR_R0 5
+#define DTRACE_INVOP_NOP 6
+
#endif
#ifdef __cplusplus
diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S b/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
index 8537e3c..810517f 100644
--- a/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
+++ b/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S
@@ -85,10 +85,10 @@ ASENTRY_NOPROF(dtrace_cas32)
1:
lwarx %r0,0,%r3
cmpw %r4,%r0
- bne 2f
+ bne 2f
stwcx. %r5,0,%r3
- bne 1b
-2: mr %r3,%r0
+ bne 1b
+2: mr %r3,%r0
blr
END(dtrace_cas32)
@@ -100,22 +100,15 @@ ASENTRY_NOPROF(dtrace_casptr)
1:
lwarx %r0,0,%r3
cmpw %r4,%r0
- bne 2f
+ bne 2f
stwcx. %r5,0,%r3
- bne 1b
-2: mr %r3,%r0
+ bne 1b
+2: mr %r3,%r0
blr
END(dtrace_casptr)
/*
-uintptr_t
-dtrace_fulword(void *addr)
-*/
-ASENTRY_NOPROF(dtrace_fulword)
-END(dtrace_fulword)
-
-/*
XXX: unoptimized
void
dtrace_copy(uintptr_t src, uintptr_t dest, size_t size)
@@ -127,7 +120,7 @@ ASENTRY_NOPROF(dtrace_copy)
lbzu %r3,1(%r7)
stbu %r3,1(%r8)
addme %r5,%r5
- beq 2f
+ beq 2f
2:
blr
END(dtrace_copy)
@@ -144,42 +137,19 @@ ASENTRY_NOPROF(dtrace_copystr)
lbzu %r3,1(%r7)
stbu %r3,1(%r8)
addme %r5,%r5
- beq 2f
- or %r3,%r3,%r3
- beq 2f
+ beq 2f
+ or %r3,%r3,%r3
+ beq 2f
andi. %r0,%r5,0x0fff
- beq 2f
- lwz %r0,0(%r6)
+ beq 2f
+ lwz %r0,0(%r6)
andi. %r0,%r0,CPU_DTRACE_BADADDR
- beq 1b
+ beq 1b
2:
blr
END(dtrace_copystr)
/*
-void dtrace_invop_init(void)
-*/
-ASENTRY_NOPROF(dtrace_invop_init)
- /* XXX: impement it properly -- implement dtrace_invop_start */
- li %r0,0
- li %r3,dtrace_invop_jump_addr@l
- addis %r3,%r3,dtrace_invop_jump_addr@ha
- stw %r0,0(%r3)
- blr
-END(dtrace_invop_init)
-
-/*
-void dtrace_invop_uninit(void)
-*/
-ASENTRY_NOPROF(dtrace_invop_uninit)
- li %r0,0
- li %r3,dtrace_invop_jump_addr@l
- addis %r3,%r3,dtrace_invop_jump_addr@ha
- stw %r0,0(%r3)
- blr
-END(dtrace_invop_uninit)
-
-/*
* The panic() and cmn_err() functions invoke vpanic() as a common entry point
* into the panic code implemented in panicsys(). vpanic() is responsible
* for passing through the format string and arguments, and constructing a
diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
index efbca6f..a68ee65 100644
--- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
+++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c
@@ -567,3 +567,17 @@ dtrace_fuword64(void *uaddr)
}
return ret;
}
+
+uintptr_t
+dtrace_fulword(void *uaddr)
+{
+ uintptr_t ret = 0;
+
+ if (dtrace_copycheck((uintptr_t)uaddr, (uintptr_t)&ret, sizeof(ret))) {
+ if (copyin((const void *)uaddr, (void *)&ret, sizeof(ret))) {
+ DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR);
+ cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr;
+ }
+ }
+ return ret;
+}
diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
index 22fb442..e6f1ec0 100644
--- a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
@@ -49,8 +49,11 @@ __FBSDID("$FreeBSD$");
extern uintptr_t dtrace_in_probe_addr;
extern int dtrace_in_probe;
extern dtrace_id_t dtrace_probeid_error;
+extern int (*dtrace_invop_jump_addr)(struct trapframe *);
int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t);
+void dtrace_invop_init(void);
+void dtrace_invop_uninit(void);
typedef struct dtrace_invop_hdlr {
int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t);
@@ -72,6 +75,44 @@ dtrace_invop(uintptr_t addr, uintptr_t *stack, uintptr_t eax)
return (0);
}
+void
+dtrace_invop_add(int (*func)(uintptr_t, uintptr_t *, uintptr_t))
+{
+ dtrace_invop_hdlr_t *hdlr;
+
+ hdlr = kmem_alloc(sizeof (dtrace_invop_hdlr_t), KM_SLEEP);
+ hdlr->dtih_func = func;
+ hdlr->dtih_next = dtrace_invop_hdlr;
+ dtrace_invop_hdlr = hdlr;
+}
+
+void
+dtrace_invop_remove(int (*func)(uintptr_t, uintptr_t *, uintptr_t))
+{
+ dtrace_invop_hdlr_t *hdlr = dtrace_invop_hdlr, *prev = NULL;
+
+ for (;;) {
+ if (hdlr == NULL)
+ panic("attempt to remove non-existent invop handler");
+
+ if (hdlr->dtih_func == func)
+ break;
+
+ prev = hdlr;
+ hdlr = hdlr->dtih_next;
+ }
+
+ if (prev == NULL) {
+ ASSERT(dtrace_invop_hdlr == hdlr);
+ dtrace_invop_hdlr = hdlr->dtih_next;
+ } else {
+ ASSERT(dtrace_invop_hdlr != hdlr);
+ prev->dtih_next = hdlr->dtih_next;
+ }
+
+ kmem_free(hdlr, 0);
+}
+
/*ARGSUSED*/
void
@@ -199,3 +240,36 @@ dtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which,
(uintptr_t)epid,
(uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs);
}
+
+static int
+dtrace_invop_start(struct trapframe *frame)
+{
+ switch (dtrace_invop(frame->srr0, (uintptr_t *)frame, frame->fixreg[3])) {
+ case DTRACE_INVOP_JUMP:
+ break;
+ case DTRACE_INVOP_BCTR:
+ frame->srr0 = frame->ctr;
+ break;
+ case DTRACE_INVOP_BLR:
+ frame->srr0 = frame->lr;
+ break;
+ case DTRACE_INVOP_MFLR_R0:
+ frame->fixreg[0] = frame->lr ;
+ break;
+ default:
+ return (-1);
+ break;
+ }
+
+ return (0);
+}
+
+void dtrace_invop_init(void)
+{
+ dtrace_invop_jump_addr = dtrace_invop_start;
+}
+
+void dtrace_invop_uninit(void)
+{
+ dtrace_invop_jump_addr = 0;
+}
diff --git a/sys/cddl/dev/fbt/fbt_powerpc.c b/sys/cddl/dev/fbt/fbt_powerpc.c
new file mode 100644
index 0000000..bee3dc7
--- /dev/null
+++ b/sys/cddl/dev/fbt/fbt_powerpc.c
@@ -0,0 +1,1321 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ * Portions Copyright 2006-2008 John Birrell jb@freebsd.org
+ * Portions Copyright 2013 Justin Hibbits jhibbits@freebsd.org
+ *
+ * $FreeBSD$
+ *
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/cdefs.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/cpuvar.h>
+#include <sys/fcntl.h>
+#include <sys/filio.h>
+#include <sys/kdb.h>
+#include <sys/kernel.h>
+#include <sys/kmem.h>
+#include <sys/kthread.h>
+#include <sys/limits.h>
+#include <sys/linker.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/pcpu.h>
+#include <sys/poll.h>
+#include <sys/proc.h>
+#include <sys/selinfo.h>
+#include <sys/smp.h>
+#include <sys/syscall.h>
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <sys/uio.h>
+#include <sys/unistd.h>
+#include <machine/stdarg.h>
+
+#include <sys/dtrace.h>
+#include <sys/dtrace_bsd.h>
+
+static MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing");
+
+#define FBT_PATCHVAL 0x7c810808
+#define FBT_MFLR_R0 0x7c0802a6
+#define FBT_MTLR_R0 0x7c0803a6
+#define FBT_BLR 0x4e800020
+#define FBT_BCTR 0x4e800030
+#define FBT_BRANCH 0x48000000
+#define FBT_BR_MASK 0x03fffffc
+#define FBT_IS_JUMP(instr) ((instr & ~FBT_BR_MASK) == FBT_BRANCH)
+
+static d_open_t fbt_open;
+static int fbt_unload(void);
+static void fbt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *);
+static void fbt_provide_module(void *, modctl_t *);
+static void fbt_destroy(void *, dtrace_id_t, void *);
+static void fbt_enable(void *, dtrace_id_t, void *);
+static void fbt_disable(void *, dtrace_id_t, void *);
+static void fbt_load(void *);
+static void fbt_suspend(void *, dtrace_id_t, void *);
+static void fbt_resume(void *, dtrace_id_t, void *);
+
+#define FBT_ENTRY "entry"
+#define FBT_RETURN "return"
+#define FBT_ADDR2NDX(addr) ((((uintptr_t)(addr)) >> 4) & fbt_probetab_mask)
+#define FBT_PROBETAB_SIZE 0x8000 /* 32k entries -- 128K total */
+
+static struct cdevsw fbt_cdevsw = {
+ .d_version = D_VERSION,
+ .d_open = fbt_open,
+ .d_name = "fbt",
+};
+
+static dtrace_pattr_t fbt_attr = {
+{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON },
+{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN },
+{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA },
+{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON },
+{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA },
+};
+
+static dtrace_pops_t fbt_pops = {
+ NULL,
+ fbt_provide_module,
+ fbt_enable,
+ fbt_disable,
+ fbt_suspend,
+ fbt_resume,
+ fbt_getargdesc,
+ NULL,
+ NULL,
+ fbt_destroy
+};
+
+typedef struct fbt_probe {
+ struct fbt_probe *fbtp_hashnext;
+ uint32_t *fbtp_patchpoint;
+ int8_t fbtp_rval;
+ uint32_t fbtp_patchval;
+ uint32_t fbtp_savedval;
+ uintptr_t fbtp_roffset;
+ dtrace_id_t fbtp_id;
+ const char *fbtp_name;
+ modctl_t *fbtp_ctl;
+ int fbtp_loadcnt;
+ int fbtp_primary;
+ int fbtp_invop_cnt;
+ int fbtp_symindx;
+ struct fbt_probe *fbtp_next;
+} fbt_probe_t;
+
+static struct cdev *fbt_cdev;
+static dtrace_provider_id_t fbt_id;
+static fbt_probe_t **fbt_probetab;
+static int fbt_probetab_size;
+static int fbt_probetab_mask;
+static int fbt_verbose = 0;
+
+static int
+fbt_invop(uintptr_t addr, uintptr_t *stack, uintptr_t rval)
+{
+ struct trapframe *frame = (struct trapframe *)stack;
+ solaris_cpu_t *cpu = &solaris_cpu[curcpu];
+ fbt_probe_t *fbt = fbt_probetab[FBT_ADDR2NDX(addr)];
+ uintptr_t tmp;
+
+ for (; fbt != NULL; fbt = fbt->fbtp_hashnext) {
+ if ((uintptr_t)fbt->fbtp_patchpoint == addr) {
+ fbt->fbtp_invop_cnt++;
+ if (fbt->fbtp_roffset == 0) {
+ cpu->cpu_dtrace_caller = addr;
+
+ dtrace_probe(fbt->fbtp_id, frame->fixreg[3],
+ frame->fixreg[4], frame->fixreg[5],
+ frame->fixreg[6], frame->fixreg[7]);
+
+ cpu->cpu_dtrace_caller = 0;
+ } else {
+
+ dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset,
+ rval, 0, 0, 0);
+ /*
+ * The caller doesn't have the fbt item, so
+ * fixup tail calls here.
+ */
+ if (fbt->fbtp_rval == DTRACE_INVOP_JUMP) {
+ frame->srr0 = (uintptr_t)fbt->fbtp_patchpoint;
+ tmp = fbt->fbtp_savedval & FBT_BR_MASK;
+ /* Sign extend. */
+ if (tmp & 0x02000000)
+ tmp |= 0xFC000000;
+ frame->srr0 += tmp;
+ }
+ cpu->cpu_dtrace_caller = 0;
+ }
+
+ return (fbt->fbtp_rval);
+ }
+ }
+
+ return (0);
+}
+
+static int
+fbt_provide_module_function(linker_file_t lf, int symindx,
+ linker_symval_t *symval, void *opaque)
+{
+ char *modname = opaque;
+ const char *name = symval->name;
+ fbt_probe_t *fbt, *retfbt;
+ int j;
+ int size;
+ u_int32_t *instr, *limit;
+
+ if (strncmp(name, "dtrace_", 7) == 0 &&
+ strncmp(name, "dtrace_safe_", 12) != 0) {
+ /*
+ * Anything beginning with "dtrace_" may be called
+ * from probe context unless it explicitly indicates
+ * that it won't be called from probe context by
+ * using the prefix "dtrace_safe_".
+ */
+ return (0);
+ }
+
+ if (name[0] == '_' && name[1] == '_')
+ return (0);
+
+ size = symval->size;
+
+ instr = (u_int32_t *) symval->value;
+ limit = (u_int32_t *) symval->value + symval->size;
+
+ for (; instr < limit; instr++)
+ if (*instr == FBT_MFLR_R0)
+ break;
+
+ if (*instr != FBT_MFLR_R0);
+ return (0);
+
+ fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO);
+ fbt->fbtp_name = name;
+ fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
+ name, FBT_ENTRY, 3, fbt);
+ fbt->fbtp_patchpoint = instr;
+ fbt->fbtp_ctl = lf;
+ fbt->fbtp_loadcnt = lf->loadcnt;
+ fbt->fbtp_savedval = *instr;
+ fbt->fbtp_patchval = FBT_PATCHVAL;
+ fbt->fbtp_rval = DTRACE_INVOP_MFLR_R0;
+ fbt->fbtp_symindx = symindx;
+
+ fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)];
+ fbt_probetab[FBT_ADDR2NDX(instr)] = fbt;
+
+ lf->fbt_nentries++;
+
+ retfbt = NULL;
+again:
+ if (instr >= limit)
+ return (0);
+
+ /*
+ * We (desperately) want to avoid erroneously instrumenting a
+ * jump table To determine if we're looking at a true instruction
+ * sequence or an inline jump table that happens to contain the same
+ * byte sequences, we resort to some heuristic sleeze: we treat this
+ * instruction as being contained within a pointer, and see if that
+ * pointer points to within the body of the function. If it does, we
+ * refuse to instrument it.
+ */
+ {
+ uint32_t *ptr;
+
+ ptr = *(uint32_t **)instr;
+
+ if (ptr >= (uint32_t *) symval->value && ptr < limit) {
+ instr++;
+ goto again;
+ }
+ }
+
+ if (*instr == FBT_MFLR_R0)
+ return (0);
+
+ if (*instr != FBT_MTLR_R0) {
+ instr++;
+ goto again;
+ }
+
+ instr++;
+
+ for (j = 0; j < 12 && instr < limit; j++, instr++) {
+ if ((*instr == FBT_BCTR) || (*instr == FBT_BLR) |
+ FBT_IS_JUMP(*instr))
+ break;
+ }
+
+ if (!(*instr == FBT_BCTR || *instr == FBT_BLR || FBT_IS_JUMP(*instr)))
+ goto again;
+
+ /*
+ * We have a winner!
+ */
+ fbt = malloc(sizeof (fbt_probe_t), M_FBT, M_WAITOK | M_ZERO);
+ fbt->fbtp_name = name;
+
+ if (retfbt == NULL) {
+ fbt->fbtp_id = dtrace_probe_create(fbt_id, modname,
+ name, FBT_RETURN, 3, fbt);
+ } else {
+ retfbt->fbtp_next = fbt;
+ fbt->fbtp_id = retfbt->fbtp_id;
+ }
+
+ retfbt = fbt;
+ fbt->fbtp_patchpoint = instr;
+ fbt->fbtp_ctl = lf;
+ fbt->fbtp_loadcnt = lf->loadcnt;
+ fbt->fbtp_symindx = symindx;
+
+ if (*instr == FBT_BCTR)
+ fbt->fbtp_rval = DTRACE_INVOP_BCTR;
+ else if (*instr == FBT_BLR)
+ fbt->fbtp_rval = DTRACE_INVOP_RET;
+ else
+ fbt->fbtp_rval = DTRACE_INVOP_JUMP;
+
+ fbt->fbtp_savedval = *instr;
+ fbt->fbtp_patchval = FBT_PATCHVAL;
+ fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)];
+ fbt_probetab[FBT_ADDR2NDX(instr)] = fbt;
+
+ lf->fbt_nentries++;
+
+ instr += size;
+ goto again;
+}
+
+static void
+fbt_provide_module(void *arg, modctl_t *lf)
+{
+ char modname[MAXPATHLEN];
+ int i;
+ size_t len;
+
+ strlcpy(modname, lf->filename, sizeof(modname));
+ len = strlen(modname);
+ if (len > 3 && strcmp(modname + len - 3, ".ko") == 0)
+ modname[len - 3] = '\0';
+
+ /*
+ * Employees of dtrace and their families are ineligible. Void
+ * where prohibited.
+ */
+ if (strcmp(modname, "dtrace") == 0)
+ return;
+
+ /*
+ * The cyclic timer subsystem can be built as a module and DTrace
+ * depends on that, so it is ineligible too.
+ */
+ if (strcmp(modname, "cyclic") == 0)
+ return;
+
+ /*
+ * To register with DTrace, a module must list 'dtrace' as a
+ * dependency in order for the kernel linker to resolve
+ * symbols like dtrace_register(). All modules with such a
+ * dependency are ineligible for FBT tracing.
+ */
+ for (i = 0; i < lf->ndeps; i++)
+ if (strncmp(lf->deps[i]->filename, "dtrace", 6) == 0)
+ return;
+
+ if (lf->fbt_nentries) {
+ /*
+ * This module has some FBT entries allocated; we're afraid
+ * to screw with it.
+ */
+ return;
+ }
+
+ /*
+ * List the functions in the module and the symbol values.
+ */
+ (void) linker_file_function_listall(lf, fbt_provide_module_function, modname);
+}
+
+static void
+fbt_destroy(void *arg, dtrace_id_t id, void *parg)
+{
+ fbt_probe_t *fbt = parg, *next, *hash, *last;
+ modctl_t *ctl;
+ int ndx;
+
+ do {
+ ctl = fbt->fbtp_ctl;
+
+ ctl->fbt_nentries--;
+
+ /*
+ * Now we need to remove this probe from the fbt_probetab.
+ */
+ ndx = FBT_ADDR2NDX(fbt->fbtp_patchpoint);
+ last = NULL;
+ hash = fbt_probetab[ndx];
+
+ while (hash != fbt) {
+ ASSERT(hash != NULL);
+ last = hash;
+ hash = hash->fbtp_hashnext;
+ }
+
+ if (last != NULL) {
+ last->fbtp_hashnext = fbt->fbtp_hashnext;
+ } else {
+ fbt_probetab[ndx] = fbt->fbtp_hashnext;
+ }
+
+ next = fbt->fbtp_next;
+ free(fbt, M_FBT);
+
+ fbt = next;
+ } while (fbt != NULL);
+}
+
+static void
+fbt_enable(void *arg, dtrace_id_t id, void *parg)
+{
+ fbt_probe_t *fbt = parg;
+ modctl_t *ctl = fbt->fbtp_ctl;
+
+ ctl->nenabled++;
+
+ /*
+ * Now check that our modctl has the expected load count. If it
+ * doesn't, this module must have been unloaded and reloaded -- and
+ * we're not going to touch it.
+ */
+ if (ctl->loadcnt != fbt->fbtp_loadcnt) {
+ if (fbt_verbose) {
+ printf("fbt is failing for probe %s "
+ "(module %s reloaded)",
+ fbt->fbtp_name, ctl->filename);
+ }
+
+ return;
+ }
+
+ for (; fbt != NULL; fbt = fbt->fbtp_next) {
+ *fbt->fbtp_patchpoint = fbt->fbtp_patchval;
+ }
+}
+
+static void
+fbt_disable(void *arg, dtrace_id_t id, void *parg)
+{
+ fbt_probe_t *fbt = parg;
+ modctl_t *ctl = fbt->fbtp_ctl;
+
+ ASSERT(ctl->nenabled > 0);
+ ctl->nenabled--;
+
+ if ((ctl->loadcnt != fbt->fbtp_loadcnt))
+ return;
+
+ for (; fbt != NULL; fbt = fbt->fbtp_next)
+ *fbt->fbtp_patchpoint = fbt->fbtp_savedval;
+}
+
+static void
+fbt_suspend(void *arg, dtrace_id_t id, void *parg)
+{
+ fbt_probe_t *fbt = parg;
+ modctl_t *ctl = fbt->fbtp_ctl;
+
+ ASSERT(ctl->nenabled > 0);
+
+ if ((ctl->loadcnt != fbt->fbtp_loadcnt))
+ return;
+
+ for (; fbt != NULL; fbt = fbt->fbtp_next)
+ *fbt->fbtp_patchpoint = fbt->fbtp_savedval;
+}
+
+static void
+fbt_resume(void *arg, dtrace_id_t id, void *parg)
+{
+ fbt_probe_t *fbt = parg;
+ modctl_t *ctl = fbt->fbtp_ctl;
+
+ ASSERT(ctl->nenabled > 0);
+
+ if ((ctl->loadcnt != fbt->fbtp_loadcnt))
+ return;
+
+ for (; fbt != NULL; fbt = fbt->fbtp_next)
+ *fbt->fbtp_patchpoint = fbt->fbtp_patchval;
+}
+
+static int
+fbt_ctfoff_init(modctl_t *lf, linker_ctf_t *lc)
+{
+ const Elf_Sym *symp = lc->symtab;;
+ const char *name;
+ const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;
+ const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t);
+ int i;
+ uint32_t *ctfoff;
+ uint32_t objtoff = hp->cth_objtoff;
+ uint32_t funcoff = hp->cth_funcoff;
+ ushort_t info;
+ ushort_t vlen;
+
+ /* Sanity check. */
+ if (hp->cth_magic != CTF_MAGIC) {
+ printf("Bad magic value in CTF data of '%s'\n",lf->pathname);
+ return (EINVAL);
+ }
+
+ if (lc->symtab == NULL) {
+ printf("No symbol table in '%s'\n",lf->pathname);
+ return (EINVAL);
+ }
+
+ if ((ctfoff = malloc(sizeof(uint32_t) * lc->nsym, M_LINKER, M_WAITOK)) == NULL)
+ return (ENOMEM);
+
+ *lc->ctfoffp = ctfoff;
+
+ for (i = 0; i < lc->nsym; i++, ctfoff++, symp++) {
+ if (symp->st_name == 0 || symp->st_shndx == SHN_UNDEF) {
+ *ctfoff = 0xffffffff;
+ continue;
+ }
+
+ if (symp->st_name < lc->strcnt)
+ name = lc->strtab + symp->st_name;
+ else
+ name = "(?)";
+
+ switch (ELF_ST_TYPE(symp->st_info)) {
+ case STT_OBJECT:
+ if (objtoff >= hp->cth_funcoff ||
+ (symp->st_shndx == SHN_ABS && symp->st_value == 0)) {
+ *ctfoff = 0xffffffff;
+ break;
+ }
+
+ *ctfoff = objtoff;
+ objtoff += sizeof (ushort_t);
+ break;
+
+ case STT_FUNC:
+ if (funcoff >= hp->cth_typeoff) {
+ *ctfoff = 0xffffffff;
+ break;
+ }
+
+ *ctfoff = funcoff;
+
+ info = *((const ushort_t *)(ctfdata + funcoff));
+ vlen = CTF_INFO_VLEN(info);
+
+ /*
+ * If we encounter a zero pad at the end, just skip it.
+ * Otherwise skip over the function and its return type
+ * (+2) and the argument list (vlen).
+ */
+ if (CTF_INFO_KIND(info) == CTF_K_UNKNOWN && vlen == 0)
+ funcoff += sizeof (ushort_t); /* skip pad */
+ else
+ funcoff += sizeof (ushort_t) * (vlen + 2);
+ break;
+
+ default:
+ *ctfoff = 0xffffffff;
+ break;
+ }
+ }
+
+ return (0);
+}
+
+static ssize_t
+fbt_get_ctt_size(uint8_t version, const ctf_type_t *tp, ssize_t *sizep,
+ ssize_t *incrementp)
+{
+ ssize_t size, increment;
+
+ if (version > CTF_VERSION_1 &&
+ tp->ctt_size == CTF_LSIZE_SENT) {
+ size = CTF_TYPE_LSIZE(tp);
+ increment = sizeof (ctf_type_t);
+ } else {
+ size = tp->ctt_size;
+ increment = sizeof (ctf_stype_t);
+ }
+
+ if (sizep)
+ *sizep = size;
+ if (incrementp)
+ *incrementp = increment;
+
+ return (size);
+}
+
+static int
+fbt_typoff_init(linker_ctf_t *lc)
+{
+ const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;
+ const ctf_type_t *tbuf;
+ const ctf_type_t *tend;
+ const ctf_type_t *tp;
+ const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t);
+ int ctf_typemax = 0;
+ uint32_t *xp;
+ ulong_t pop[CTF_K_MAX + 1] = { 0 };
+
+
+ /* Sanity check. */
+ if (hp->cth_magic != CTF_MAGIC)
+ return (EINVAL);
+
+ tbuf = (const ctf_type_t *) (ctfdata + hp->cth_typeoff);
+ tend = (const ctf_type_t *) (ctfdata + hp->cth_stroff);
+
+ int child = hp->cth_parname != 0;
+
+ /*
+ * We make two passes through the entire type section. In this first
+ * pass, we count the number of each type and the total number of types.
+ */
+ for (tp = tbuf; tp < tend; ctf_typemax++) {
+ ushort_t kind = CTF_INFO_KIND(tp->ctt_info);
+ ulong_t vlen = CTF_INFO_VLEN(tp->ctt_info);
+ ssize_t size, increment;
+
+ size_t vbytes;
+ uint_t n;
+
+ (void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment);
+
+ switch (kind) {
+ case CTF_K_INTEGER:
+ case CTF_K_FLOAT:
+ vbytes = sizeof (uint_t);
+ break;
+ case CTF_K_ARRAY:
+ vbytes = sizeof (ctf_array_t);
+ break;
+ case CTF_K_FUNCTION:
+ vbytes = sizeof (ushort_t) * (vlen + (vlen & 1));
+ break;
+ case CTF_K_STRUCT:
+ case CTF_K_UNION:
+ if (size < CTF_LSTRUCT_THRESH) {
+ ctf_member_t *mp = (ctf_member_t *)
+ ((uintptr_t)tp + increment);
+
+ vbytes = sizeof (ctf_member_t) * vlen;
+ for (n = vlen; n != 0; n--, mp++)
+ child |= CTF_TYPE_ISCHILD(mp->ctm_type);
+ } else {
+ ctf_lmember_t *lmp = (ctf_lmember_t *)
+ ((uintptr_t)tp + increment);
+
+ vbytes = sizeof (ctf_lmember_t) * vlen;
+ for (n = vlen; n != 0; n--, lmp++)
+ child |=
+ CTF_TYPE_ISCHILD(lmp->ctlm_type);
+ }
+ break;
+ case CTF_K_ENUM:
+ vbytes = sizeof (ctf_enum_t) * vlen;
+ break;
+ case CTF_K_FORWARD:
+ /*
+ * For forward declarations, ctt_type is the CTF_K_*
+ * kind for the tag, so bump that population count too.
+ * If ctt_type is unknown, treat the tag as a struct.
+ */
+ if (tp->ctt_type == CTF_K_UNKNOWN ||
+ tp->ctt_type >= CTF_K_MAX)
+ pop[CTF_K_STRUCT]++;
+ else
+ pop[tp->ctt_type]++;
+ /*FALLTHRU*/
+ case CTF_K_UNKNOWN:
+ vbytes = 0;
+ break;
+ case CTF_K_POINTER:
+ case CTF_K_TYPEDEF:
+ case CTF_K_VOLATILE:
+ case CTF_K_CONST:
+ case CTF_K_RESTRICT:
+ child |= CTF_TYPE_ISCHILD(tp->ctt_type);
+ vbytes = 0;
+ break;
+ default:
+ printf("%s(%d): detected invalid CTF kind -- %u\n", __func__, __LINE__, kind);
+ return (EIO);
+ }
+ tp = (ctf_type_t *)((uintptr_t)tp + increment + vbytes);
+ pop[kind]++;
+ }
+
+ *lc->typlenp = ctf_typemax;
+
+ if ((xp = malloc(sizeof(uint32_t) * ctf_typemax, M_LINKER, M_ZERO | M_WAITOK)) == NULL)
+ return (ENOMEM);
+
+ *lc->typoffp = xp;
+
+ /* type id 0 is used as a sentinel value */
+ *xp++ = 0;
+
+ /*
+ * In the second pass, fill in the type offset.
+ */
+ for (tp = tbuf; tp < tend; xp++) {
+ ushort_t kind = CTF_INFO_KIND(tp->ctt_info);
+ ulong_t vlen = CTF_INFO_VLEN(tp->ctt_info);
+ ssize_t size, increment;
+
+ size_t vbytes;
+ uint_t n;
+
+ (void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment);
+
+ switch (kind) {
+ case CTF_K_INTEGER:
+ case CTF_K_FLOAT:
+ vbytes = sizeof (uint_t);
+ break;
+ case CTF_K_ARRAY:
+ vbytes = sizeof (ctf_array_t);
+ break;
+ case CTF_K_FUNCTION:
+ vbytes = sizeof (ushort_t) * (vlen + (vlen & 1));
+ break;
+ case CTF_K_STRUCT:
+ case CTF_K_UNION:
+ if (size < CTF_LSTRUCT_THRESH) {
+ ctf_member_t *mp = (ctf_member_t *)
+ ((uintptr_t)tp + increment);
+
+ vbytes = sizeof (ctf_member_t) * vlen;
+ for (n = vlen; n != 0; n--, mp++)
+ child |= CTF_TYPE_ISCHILD(mp->ctm_type);
+ } else {
+ ctf_lmember_t *lmp = (ctf_lmember_t *)
+ ((uintptr_t)tp + increment);
+
+ vbytes = sizeof (ctf_lmember_t) * vlen;
+ for (n = vlen; n != 0; n--, lmp++)
+ child |=
+ CTF_TYPE_ISCHILD(lmp->ctlm_type);
+ }
+ break;
+ case CTF_K_ENUM:
+ vbytes = sizeof (ctf_enum_t) * vlen;
+ break;
+ case CTF_K_FORWARD:
+ case CTF_K_UNKNOWN:
+ vbytes = 0;
+ break;
+ case CTF_K_POINTER:
+ case CTF_K_TYPEDEF:
+ case CTF_K_VOLATILE:
+ case CTF_K_CONST:
+ case CTF_K_RESTRICT:
+ vbytes = 0;
+ break;
+ default:
+ printf("%s(%d): detected invalid CTF kind -- %u\n", __func__, __LINE__, kind);
+ return (EIO);
+ }
+ *xp = (uint32_t)((uintptr_t) tp - (uintptr_t) ctfdata);
+ tp = (ctf_type_t *)((uintptr_t)tp + increment + vbytes);
+ }
+
+ return (0);
+}
+
+/*
+ * CTF Declaration Stack
+ *
+ * In order to implement ctf_type_name(), we must convert a type graph back
+ * into a C type declaration. Unfortunately, a type graph represents a storage
+ * class ordering of the type whereas a type declaration must obey the C rules
+ * for operator precedence, and the two orderings are frequently in conflict.
+ * For example, consider these CTF type graphs and their C declarations:
+ *
+ * CTF_K_POINTER -> CTF_K_FUNCTION -> CTF_K_INTEGER : int (*)()
+ * CTF_K_POINTER -> CTF_K_ARRAY -> CTF_K_INTEGER : int (*)[]
+ *
+ * In each case, parentheses are used to raise operator * to higher lexical
+ * precedence, so the string form of the C declaration cannot be constructed by
+ * walking the type graph links and forming the string from left to right.
+ *
+ * The functions in this file build a set of stacks from the type graph nodes
+ * corresponding to the C operator precedence levels in the appropriate order.
+ * The code in ctf_type_name() can then iterate over the levels and nodes in
+ * lexical precedence order and construct the final C declaration string.
+ */
+typedef struct ctf_list {
+ struct ctf_list *l_prev; /* previous pointer or tail pointer */
+ struct ctf_list *l_next; /* next pointer or head pointer */
+} ctf_list_t;
+
+#define ctf_list_prev(elem) ((void *)(((ctf_list_t *)(elem))->l_prev))
+#define ctf_list_next(elem) ((void *)(((ctf_list_t *)(elem))->l_next))
+
+typedef enum {
+ CTF_PREC_BASE,
+ CTF_PREC_POINTER,
+ CTF_PREC_ARRAY,
+ CTF_PREC_FUNCTION,
+ CTF_PREC_MAX
+} ctf_decl_prec_t;
+
+typedef struct ctf_decl_node {
+ ctf_list_t cd_list; /* linked list pointers */
+ ctf_id_t cd_type; /* type identifier */
+ uint_t cd_kind; /* type kind */
+ uint_t cd_n; /* type dimension if array */
+} ctf_decl_node_t;
+
+typedef struct ctf_decl {
+ ctf_list_t cd_nodes[CTF_PREC_MAX]; /* declaration node stacks */
+ int cd_order[CTF_PREC_MAX]; /* storage order of decls */
+ ctf_decl_prec_t cd_qualp; /* qualifier precision */
+ ctf_decl_prec_t cd_ordp; /* ordered precision */
+ char *cd_buf; /* buffer for output */
+ char *cd_ptr; /* buffer location */
+ char *cd_end; /* buffer limit */
+ size_t cd_len; /* buffer space required */
+ int cd_err; /* saved error value */
+} ctf_decl_t;
+
+/*
+ * Simple doubly-linked list append routine. This implementation assumes that
+ * each list element contains an embedded ctf_list_t as the first member.
+ * An additional ctf_list_t is used to store the head (l_next) and tail
+ * (l_prev) pointers. The current head and tail list elements have their
+ * previous and next pointers set to NULL, respectively.
+ */
+static void
+ctf_list_append(ctf_list_t *lp, void *new)
+{
+ ctf_list_t *p = lp->l_prev; /* p = tail list element */
+ ctf_list_t *q = new; /* q = new list element */
+
+ lp->l_prev = q;
+ q->l_prev = p;
+ q->l_next = NULL;
+
+ if (p != NULL)
+ p->l_next = q;
+ else
+ lp->l_next = q;
+}
+
+/*
+ * Prepend the specified existing element to the given ctf_list_t. The
+ * existing pointer should be pointing at a struct with embedded ctf_list_t.
+ */
+static void
+ctf_list_prepend(ctf_list_t *lp, void *new)
+{
+ ctf_list_t *p = new; /* p = new list element */
+ ctf_list_t *q = lp->l_next; /* q = head list element */
+
+ lp->l_next = p;
+ p->l_prev = NULL;
+ p->l_next = q;
+
+ if (q != NULL)
+ q->l_prev = p;
+ else
+ lp->l_prev = p;
+}
+
+static void
+ctf_decl_init(ctf_decl_t *cd, char *buf, size_t len)
+{
+ int i;
+
+ bzero(cd, sizeof (ctf_decl_t));
+
+ for (i = CTF_PREC_BASE; i < CTF_PREC_MAX; i++)
+ cd->cd_order[i] = CTF_PREC_BASE - 1;
+
+ cd->cd_qualp = CTF_PREC_BASE;
+ cd->cd_ordp = CTF_PREC_BASE;
+
+ cd->cd_buf = buf;
+ cd->cd_ptr = buf;
+ cd->cd_end = buf + len;
+}
+
+static void
+ctf_decl_fini(ctf_decl_t *cd)
+{
+ ctf_decl_node_t *cdp, *ndp;
+ int i;
+
+ for (i = CTF_PREC_BASE; i < CTF_PREC_MAX; i++) {
+ for (cdp = ctf_list_next(&cd->cd_nodes[i]);
+ cdp != NULL; cdp = ndp) {
+ ndp = ctf_list_next(cdp);
+ free(cdp, M_FBT);
+ }
+ }
+}
+
+static const ctf_type_t *
+ctf_lookup_by_id(linker_ctf_t *lc, ctf_id_t type)
+{
+ const ctf_type_t *tp;
+ uint32_t offset;
+ uint32_t *typoff = *lc->typoffp;
+
+ if (type >= *lc->typlenp) {
+ printf("%s(%d): type %d exceeds max %ld\n",__func__,__LINE__,(int) type,*lc->typlenp);
+ return(NULL);
+ }
+
+ /* Check if the type isn't cross-referenced. */
+ if ((offset = typoff[type]) == 0) {
+ printf("%s(%d): type %d isn't cross referenced\n",__func__,__LINE__, (int) type);
+ return(NULL);
+ }
+
+ tp = (const ctf_type_t *)(lc->ctftab + offset + sizeof(ctf_header_t));
+
+ return (tp);
+}
+
+static void
+fbt_array_info(linker_ctf_t *lc, ctf_id_t type, ctf_arinfo_t *arp)
+{
+ const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;
+ const ctf_type_t *tp;
+ const ctf_array_t *ap;
+ ssize_t increment;
+
+ bzero(arp, sizeof(*arp));
+
+ if ((tp = ctf_lookup_by_id(lc, type)) == NULL)
+ return;
+
+ if (CTF_INFO_KIND(tp->ctt_info) != CTF_K_ARRAY)
+ return;
+
+ (void) fbt_get_ctt_size(hp->cth_version, tp, NULL, &increment);
+
+ ap = (const ctf_array_t *)((uintptr_t)tp + increment);
+ arp->ctr_contents = ap->cta_contents;
+ arp->ctr_index = ap->cta_index;
+ arp->ctr_nelems = ap->cta_nelems;
+}
+
+static const char *
+ctf_strptr(linker_ctf_t *lc, int name)
+{
+ const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;;
+ const char *strp = "";
+
+ if (name < 0 || name >= hp->cth_strlen)
+ return(strp);
+
+ strp = (const char *)(lc->ctftab + hp->cth_stroff + name + sizeof(ctf_header_t));
+
+ return (strp);
+}
+
+static void
+ctf_decl_push(ctf_decl_t *cd, linker_ctf_t *lc, ctf_id_t type)
+{
+ ctf_decl_node_t *cdp;
+ ctf_decl_prec_t prec;
+ uint_t kind, n = 1;
+ int is_qual = 0;
+
+ const ctf_type_t *tp;
+ ctf_arinfo_t ar;
+
+ if ((tp = ctf_lookup_by_id(lc, type)) == NULL) {
+ cd->cd_err = ENOENT;
+ return;
+ }
+
+ switch (kind = CTF_INFO_KIND(tp->ctt_info)) {
+ case CTF_K_ARRAY:
+ fbt_array_info(lc, type, &ar);
+ ctf_decl_push(cd, lc, ar.ctr_contents);
+ n = ar.ctr_nelems;
+ prec = CTF_PREC_ARRAY;
+ break;
+
+ case CTF_K_TYPEDEF:
+ if (ctf_strptr(lc, tp->ctt_name)[0] == '\0') {
+ ctf_decl_push(cd, lc, tp->ctt_type);
+ return;
+ }
+ prec = CTF_PREC_BASE;
+ break;
+
+ case CTF_K_FUNCTION:
+ ctf_decl_push(cd, lc, tp->ctt_type);
+ prec = CTF_PREC_FUNCTION;
+ break;
+
+ case CTF_K_POINTER:
+ ctf_decl_push(cd, lc, tp->ctt_type);
+ prec = CTF_PREC_POINTER;
+ break;
+
+ case CTF_K_VOLATILE:
+ case CTF_K_CONST:
+ case CTF_K_RESTRICT:
+ ctf_decl_push(cd, lc, tp->ctt_type);
+ prec = cd->cd_qualp;
+ is_qual++;
+ break;
+
+ default:
+ prec = CTF_PREC_BASE;
+ }
+
+ if ((cdp = malloc(sizeof (ctf_decl_node_t), M_FBT, M_WAITOK)) == NULL) {
+ cd->cd_err = EAGAIN;
+ return;
+ }
+
+ cdp->cd_type = type;
+ cdp->cd_kind = kind;
+ cdp->cd_n = n;
+
+ if (ctf_list_next(&cd->cd_nodes[prec]) == NULL)
+ cd->cd_order[prec] = cd->cd_ordp++;
+
+ /*
+ * Reset cd_qualp to the highest precedence level that we've seen so
+ * far that can be qualified (CTF_PREC_BASE or CTF_PREC_POINTER).
+ */
+ if (prec > cd->cd_qualp && prec < CTF_PREC_ARRAY)
+ cd->cd_qualp = prec;
+
+ /*
+ * C array declarators are ordered inside out so prepend them. Also by
+ * convention qualifiers of base types precede the type specifier (e.g.
+ * const int vs. int const) even though the two forms are equivalent.
+ */
+ if (kind == CTF_K_ARRAY || (is_qual && prec == CTF_PREC_BASE))
+ ctf_list_prepend(&cd->cd_nodes[prec], cdp);
+ else
+ ctf_list_append(&cd->cd_nodes[prec], cdp);
+}
+
+static void
+ctf_decl_sprintf(ctf_decl_t *cd, const char *format, ...)
+{
+ size_t len = (size_t)(cd->cd_end - cd->cd_ptr);
+ va_list ap;
+ size_t n;
+
+ va_start(ap, format);
+ n = vsnprintf(cd->cd_ptr, len, format, ap);
+ va_end(ap);
+
+ cd->cd_ptr += MIN(n, len);
+ cd->cd_len += n;
+}
+
+static ssize_t
+fbt_type_name(linker_ctf_t *lc, ctf_id_t type, char *buf, size_t len)
+{
+ ctf_decl_t cd;
+ ctf_decl_node_t *cdp;
+ ctf_decl_prec_t prec, lp, rp;
+ int ptr, arr;
+ uint_t k;
+
+ if (lc == NULL && type == CTF_ERR)
+ return (-1); /* simplify caller code by permitting CTF_ERR */
+
+ ctf_decl_init(&cd, buf, len);
+ ctf_decl_push(&cd, lc, type);
+
+ if (cd.cd_err != 0) {
+ ctf_decl_fini(&cd);
+ return (-1);
+ }
+
+ /*
+ * If the type graph's order conflicts with lexical precedence order
+ * for pointers or arrays, then we need to surround the declarations at
+ * the corresponding lexical precedence with parentheses. This can
+ * result in either a parenthesized pointer (*) as in int (*)() or
+ * int (*)[], or in a parenthesized pointer and array as in int (*[])().
+ */
+ ptr = cd.cd_order[CTF_PREC_POINTER] > CTF_PREC_POINTER;
+ arr = cd.cd_order[CTF_PREC_ARRAY] > CTF_PREC_ARRAY;
+
+ rp = arr ? CTF_PREC_ARRAY : ptr ? CTF_PREC_POINTER : -1;
+ lp = ptr ? CTF_PREC_POINTER : arr ? CTF_PREC_ARRAY : -1;
+
+ k = CTF_K_POINTER; /* avoid leading whitespace (see below) */
+
+ for (prec = CTF_PREC_BASE; prec < CTF_PREC_MAX; prec++) {
+ for (cdp = ctf_list_next(&cd.cd_nodes[prec]);
+ cdp != NULL; cdp = ctf_list_next(cdp)) {
+
+ const ctf_type_t *tp =
+ ctf_lookup_by_id(lc, cdp->cd_type);
+ const char *name = ctf_strptr(lc, tp->ctt_name);
+
+ if (k != CTF_K_POINTER && k != CTF_K_ARRAY)
+ ctf_decl_sprintf(&cd, " ");
+
+ if (lp == prec) {
+ ctf_decl_sprintf(&cd, "(");
+ lp = -1;
+ }
+
+ switch (cdp->cd_kind) {
+ case CTF_K_INTEGER:
+ case CTF_K_FLOAT:
+ case CTF_K_TYPEDEF:
+ ctf_decl_sprintf(&cd, "%s", name);
+ break;
+ case CTF_K_POINTER:
+ ctf_decl_sprintf(&cd, "*");
+ break;
+ case CTF_K_ARRAY:
+ ctf_decl_sprintf(&cd, "[%u]", cdp->cd_n);
+ break;
+ case CTF_K_FUNCTION:
+ ctf_decl_sprintf(&cd, "()");
+ break;
+ case CTF_K_STRUCT:
+ case CTF_K_FORWARD:
+ ctf_decl_sprintf(&cd, "struct %s", name);
+ break;
+ case CTF_K_UNION:
+ ctf_decl_sprintf(&cd, "union %s", name);
+ break;
+ case CTF_K_ENUM:
+ ctf_decl_sprintf(&cd, "enum %s", name);
+ break;
+ case CTF_K_VOLATILE:
+ ctf_decl_sprintf(&cd, "volatile");
+ break;
+ case CTF_K_CONST:
+ ctf_decl_sprintf(&cd, "const");
+ break;
+ case CTF_K_RESTRICT:
+ ctf_decl_sprintf(&cd, "restrict");
+ break;
+ }
+
+ k = cdp->cd_kind;
+ }
+
+ if (rp == prec)
+ ctf_decl_sprintf(&cd, ")");
+ }
+
+ ctf_decl_fini(&cd);
+ return (cd.cd_len);
+}
+
+static void
+fbt_getargdesc(void *arg __unused, dtrace_id_t id __unused, void *parg, dtrace_argdesc_t *desc)
+{
+ const ushort_t *dp;
+ fbt_probe_t *fbt = parg;
+ linker_ctf_t lc;
+ modctl_t *ctl = fbt->fbtp_ctl;
+ int ndx = desc->dtargd_ndx;
+ int symindx = fbt->fbtp_symindx;
+ uint32_t *ctfoff;
+ uint32_t offset;
+ ushort_t info, kind, n;
+
+ desc->dtargd_ndx = DTRACE_ARGNONE;
+
+ /* Get a pointer to the CTF data and it's length. */
+ if (linker_ctf_get(ctl, &lc) != 0)
+ /* No CTF data? Something wrong? *shrug* */
+ return;
+
+ /* Check if this module hasn't been initialised yet. */
+ if (*lc.ctfoffp == NULL) {
+ /*
+ * Initialise the CTF object and function symindx to
+ * byte offset array.
+ */
+ if (fbt_ctfoff_init(ctl, &lc) != 0)
+ return;
+
+ /* Initialise the CTF type to byte offset array. */
+ if (fbt_typoff_init(&lc) != 0)
+ return;
+ }
+
+ ctfoff = *lc.ctfoffp;
+
+ if (ctfoff == NULL || *lc.typoffp == NULL)
+ return;
+
+ /* Check if the symbol index is out of range. */
+ if (symindx >= lc.nsym)
+ return;
+
+ /* Check if the symbol isn't cross-referenced. */
+ if ((offset = ctfoff[symindx]) == 0xffffffff)
+ return;
+
+ dp = (const ushort_t *)(lc.ctftab + offset + sizeof(ctf_header_t));
+
+ info = *dp++;
+ kind = CTF_INFO_KIND(info);
+ n = CTF_INFO_VLEN(info);
+
+ if (kind == CTF_K_UNKNOWN && n == 0) {
+ printf("%s(%d): Unknown function!\n",__func__,__LINE__);
+ return;
+ }
+
+ if (kind != CTF_K_FUNCTION) {
+ printf("%s(%d): Expected a function!\n",__func__,__LINE__);
+ return;
+ }
+
+ /* Check if the requested argument doesn't exist. */
+ if (ndx >= n)
+ return;
+
+ /* Skip the return type and arguments up to the one requested. */
+ dp += ndx + 1;
+
+ if (fbt_type_name(&lc, *dp, desc->dtargd_native, sizeof(desc->dtargd_native)) > 0)
+ desc->dtargd_ndx = ndx;
+
+ return;
+}
+
+static void
+fbt_load(void *dummy)
+{
+ /* Create the /dev/dtrace/fbt entry. */
+ fbt_cdev = make_dev(&fbt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
+ "dtrace/fbt");
+
+ /* Default the probe table size if not specified. */
+ if (fbt_probetab_size == 0)
+ fbt_probetab_size = FBT_PROBETAB_SIZE;
+
+ /* Choose the hash mask for the probe table. */
+ fbt_probetab_mask = fbt_probetab_size - 1;
+
+ /* Allocate memory for the probe table. */
+ fbt_probetab =
+ malloc(fbt_probetab_size * sizeof (fbt_probe_t *), M_FBT, M_WAITOK | M_ZERO);
+
+ dtrace_invop_add(fbt_invop);
+
+ if (dtrace_register("fbt", &fbt_attr, DTRACE_PRIV_USER,
+ NULL, &fbt_pops, NULL, &fbt_id) != 0)
+ return;
+}
+
+
+static int
+fbt_unload()
+{
+ int error = 0;
+
+ /* De-register the invalid opcode handler. */
+ dtrace_invop_remove(fbt_invop);
+
+ /* De-register this DTrace provider. */
+ if ((error = dtrace_unregister(fbt_id)) != 0)
+ return (error);
+
+ /* Free the probe table. */
+ free(fbt_probetab, M_FBT);
+ fbt_probetab = NULL;
+ fbt_probetab_mask = 0;
+
+ destroy_dev(fbt_cdev);
+
+ return (error);
+}
+
+static int
+fbt_modevent(module_t mod __unused, int type, void *data __unused)
+{
+ int error = 0;
+
+ switch (type) {
+ case MOD_LOAD:
+ break;
+
+ case MOD_UNLOAD:
+ break;
+
+ case MOD_SHUTDOWN:
+ break;
+
+ default:
+ error = EOPNOTSUPP;
+ break;
+
+ }
+
+ return (error);
+}
+
+static int
+fbt_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, struct thread *td __unused)
+{
+ return (0);
+}
+
+SYSINIT(fbt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, fbt_load, NULL);
+SYSUNINIT(fbt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, fbt_unload, NULL);
+
+DEV_MODULE(fbt, fbt_modevent, NULL);
+MODULE_VERSION(fbt, 1);
+MODULE_DEPEND(fbt, dtrace, 1, 1, 1);
+MODULE_DEPEND(fbt, opensolaris, 1, 1, 1);
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c
index e094997..71b4b80 100644
--- a/sys/compat/ndis/kern_ndis.c
+++ b/sys/compat/ndis/kern_ndis.c
@@ -656,13 +656,9 @@ ndis_ptom(m0, p)
for (buf = priv->npp_head; buf != NULL; buf = buf->mdl_next) {
if (buf == priv->npp_head)
-#ifdef MT_HEADER
- MGETHDR(m, M_NOWAIT, MT_HEADER);
-#else
- MGETHDR(m, M_NOWAIT, MT_DATA);
-#endif
+ m = m_gethdr(M_NOWAIT, MT_DATA);
else
- MGET(m, M_NOWAIT, MT_DATA);
+ m = m_get(M_NOWAIT, MT_DATA);
if (m == NULL) {
m_freem(*m0);
*m0 = NULL;
diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm
index 63b451d..8348e2a 100644
--- a/sys/conf/Makefile.arm
+++ b/sys/conf/Makefile.arm
@@ -39,12 +39,20 @@ SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M}
STRIP_FLAGS = -S
.endif
+.if ${COMPILER_TYPE} != "clang"
CFLAGS += -mno-thumb-interwork
+.endif
.if empty(DDB_ENABLED)
+.if !defined(WITH_ARM_EABI) && ${COMPILER_TYPE} != "clang"
CFLAGS += -mno-apcs-frame
+.endif
.elif defined(WITH_ARM_EABI)
CFLAGS += -funwind-tables
+.if ${COMPILER_TYPE} == "clang"
+# clang requires us to tell it to emit assembly with unwind information
+CFLAGS += -mllvm -arm-enable-ehabi
+.endif
.endif
SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \
@@ -76,44 +84,43 @@ ${KERNEL_KO}.tramp: ${KERNEL_KO} $S/$M/$M/inckern.S $S/$M/$M/elf_trampoline.c
echo "#define KERNNAME \"${KERNEL_KO}.tmp\"" >opt_kernname.h
sed s/${KERNVIRTADDR}/${KERNPHYSADDR}/ ldscript.$M > ldscript.$M.tramp
sed s/" + SIZEOF_HEADERS"// ldscript.$M.tramp > \
- ldscript.$M.tramp.noheader
+ ldscript.$M.tramp.noheader
echo "#include <machine/asm.h>" >tmphack.S
echo "ENTRY(_start)" >>tmphack.S
echo "bl _startC" >>tmphack.S
${OBJCOPY} --strip-symbol '$$d' --strip-symbol '$$a' \
- -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp
+ -g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp
eval $$(stat -s ${KERNEL_KO}.tmp) && \
- echo "#define KERNSIZE $$st_size" >>opt_kernname.h
+ echo "#define KERNSIZE $$st_size" >>opt_kernname.h
${CC} -O -nostdlib -I. -I$S -Xlinker -T -Xlinker ldscript.$M.tramp \
- tmphack.S $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \
- ${FILES_CPU_FUNC} -o ${KERNEL_KO}.tramp
+ tmphack.S $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \
+ ${FILES_CPU_FUNC} -o ${KERNEL_KO}.tramp
${CC} -O -nostdlib -I. -I$S -Xlinker -T -Xlinker \
- ldscript.$M.tramp.noheader \
- tmphack.S $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \
- ${FILES_CPU_FUNC} -o ${KERNEL_KO}.tramp.noheader
+ ldscript.$M.tramp.noheader \
+ tmphack.S $S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S \
+ ${FILES_CPU_FUNC} -o ${KERNEL_KO}.tramp.noheader
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
- ${KERNEL_KO}.tramp.bin
+ ${KERNEL_KO}.tramp.bin
${OBJCOPY} ${STRIP_FLAGS} ${KERNEL_KO}.tmp
- echo "#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" \
- >opt_kernname.h
+ echo "#define KERNNAME \"${KERNEL_KO}.tmp.gz\"" >opt_kernname.h
eval $$(stat -s ${KERNEL_KO}.tmp) && \
- echo "#define KERNSIZE $$st_size" >>opt_kernname.h
+ echo "#define KERNSIZE $$st_size" >>opt_kernname.h
gzip -f9 ${KERNEL_KO}.tmp
eval $$(stat -s ${KERNEL_KO}.tmp.gz) && \
- echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h
+ echo "#define KERNCOMPSIZE $$st_size" >>opt_kernname.h
${CC} -O2 -ffreestanding -DKZIP -I. -I$S -c $S/kern/inflate.c -o \
inflate-tramp.o
${CC} -O -nostdlib -I. -I$S -Xlinker -T -Xlinker ldscript.$M.tramp \
- -DKZIP tmphack.S $S/$M/$M/elf_trampoline.c inflate-tramp.o \
- $S/$M/$M/inckern.S ${FILES_CPU_FUNC} -o ${KERNEL_KO}.gz.tramp
+ -DKZIP tmphack.S $S/$M/$M/elf_trampoline.c inflate-tramp.o \
+ $S/$M/$M/inckern.S ${FILES_CPU_FUNC} -o ${KERNEL_KO}.gz.tramp
${CC} -O -nostdlib -I. -I$S -Xlinker -T -Xlinker \
- ldscript.$M.tramp.noheader \
- -DKZIP tmphack.S $S/$M/$M/elf_trampoline.c inflate-tramp.o \
- $S/$M/$M/inckern.S ${FILES_CPU_FUNC} -o ${KERNEL_KO}.tramp.noheader
+ ldscript.$M.tramp.noheader \
+ -DKZIP tmphack.S $S/$M/$M/elf_trampoline.c inflate-tramp.o \
+ $S/$M/$M/inckern.S ${FILES_CPU_FUNC} -o ${KERNEL_KO}.tramp.noheader
${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
- ${KERNEL_KO}.gz.tramp.bin
+ ${KERNEL_KO}.gz.tramp.bin
rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \
- inflate-tramp.o tmphack.S
+ inflate-tramp.o tmphack.S
MKMODULESENV+= MACHINE=${MACHINE}
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 27c3380..5a5000c 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -986,7 +986,7 @@ options DUMMYNET
# See zero_copy(9) for more details.
# XXX: The COW based send mechanism is not safe and may result in
# kernel crashes.
-# XXX: None of the current NIC drivers support disposeable pages.
+# XXX: None of the current NIC drivers support disposable pages.
options SOCKET_SEND_COW
options SOCKET_RECV_PFLIP
diff --git a/sys/conf/files b/sys/conf/files
index 627e7d6..04e66a1 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -55,9 +55,9 @@ aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \
# from the specified source (DTS) file: <platform>.dts -> <platform>.dtb
#
fdt_dtb_file optional fdt \
- compile-with "if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o `echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi" \
+ compile-with "if [ -f $S/boot/fdt/dts/${FDT_DTS_FILE} ]; then dtc -O dtb -o ${FDT_DTS_FILE:R}.dtb -b 0 -p 1024 $S/boot/fdt/dts/${FDT_DTS_FILE}; fi" \
no-obj no-implicit-rule before-depend \
- clean "`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb"
+ clean "${FDT_DTS_FILE:R}.dtb"
fdt_static_dtb.h optional fdt fdt_dtb_static \
compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \
no-obj no-implicit-rule before-depend \
@@ -3630,6 +3630,7 @@ vm/vm_page.c standard
vm/vm_pageout.c standard
vm/vm_pager.c standard
vm/vm_phys.c standard
+vm/vm_radix.c standard
vm/vm_reserv.c standard
vm/vm_unix.c standard
vm/vm_zeroidle.c standard
diff --git a/sys/conf/files.arm b/sys/conf/files.arm
index 14d6c4b..f9e0be8 100644
--- a/sys/conf/files.arm
+++ b/sys/conf/files.arm
@@ -72,10 +72,13 @@ font.h optional sc \
clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8"
kern/subr_busdma_bufalloc.c standard
kern/subr_dummy_vdso_tc.c standard
+libkern/arm/aeabi_unwind.c standard
libkern/arm/divsi3.S standard
libkern/arm/ffs.S standard
libkern/arm/ldivmod.S standard
libkern/arm/ldivmod_helper.c standard
+libkern/arm/memcpy.S standard
+libkern/arm/memset.S standard
libkern/arm/muldi3.c standard
libkern/ashldi3.c standard
libkern/ashrdi3.c standard
diff --git a/sys/conf/ldscript.arm b/sys/conf/ldscript.arm
index d681c87..0d1c7ee 100644
--- a/sys/conf/ldscript.arm
+++ b/sys/conf/ldscript.arm
@@ -56,6 +56,7 @@ SECTIONS
.init : { *(.init) } =0x9090
.plt : { *(.plt) }
+ . = ALIGN(4);
_extab_start = .;
PROVIDE(extab_start = .);
.ARM.extab : { *(.ARM.extab) }
diff --git a/sys/dev/acpica/acpi_hpet.c b/sys/dev/acpica/acpi_hpet.c
index 9b9c966..be869ed 100644
--- a/sys/dev/acpica/acpi_hpet.c
+++ b/sys/dev/acpica/acpi_hpet.c
@@ -675,7 +675,8 @@ hpet_attach(device_t dev)
if (t->pcpu_master >= 0) {
t->et.et_flags |= ET_FLAGS_PERCPU;
t->et.et_quality += 100;
- }
+ } else if (mp_ncpus >= 8)
+ t->et.et_quality -= 100;
if ((t->caps & HPET_TCAP_PER_INT) == 0)
t->et.et_quality -= 10;
t->et.et_frequency = sc->freq;
diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c
index ba08286..aa343a6 100644
--- a/sys/dev/acpica/acpi_powerres.c
+++ b/sys/dev/acpica/acpi_powerres.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
* resource, and only deactivate it when there are no powered devices.
*
* Note that this only manages resources for known devices. There is an
- * ugly case where we may turn of power to a device which is in use because
+ * ugly case where we may turn off power to a device which is in use because
* we don't know that it depends on a given resource. We should perhaps
* try to be smarter about this, but a more complete solution would involve
* scanning all of the ACPI namespace to find devices we're not currently
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
index 13b7da6..d020206 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
@@ -521,6 +521,7 @@
#define AR_PCU_TBTT_PROTECT 0x00200000 /* no xmit upto tbtt+20 uS */
#define AR_PCU_CLEAR_VMF 0x01000000 /* clear vmf mode (fast cc)*/
#define AR_PCU_CLEAR_BA_VALID 0x04000000 /* clear ba state */
+#define AR_PCU_SEL_EVM 0x08000000 /* select EVM data or PLCP header */
#define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002
#define AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT 0x00000004
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c b/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c
index 093b2b4..9ad7620 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c
@@ -50,7 +50,7 @@ ar9285BTCoexAntennaDiversity(struct ath_hal *ah)
if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW) ||
(AH5212(ah)->ah_diversity != HAL_ANT_VARIABLE)) {
if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ENABLE) &&
- (AH5212(ah)->ah_diversity == HAL_ANT_VARIABLE)) {
+ (AH5212(ah)->ah_antControl == HAL_ANT_VARIABLE)) {
/* Enable antenna diversity */
ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_ENABLE;
ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_ENABLE;
@@ -63,7 +63,7 @@ ar9285BTCoexAntennaDiversity(struct ath_hal *ah)
OS_REG_WRITE(ah, AR_PHY_SWITCH_COM,
HAL_BT_COEX_ANT_DIV_SWITCH_COM);
OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0, 0xf0000000);
- } else if (AH5212(ah)->ah_diversity == HAL_ANT_FIXED_B) {
+ } else if (AH5212(ah)->ah_antControl == HAL_ANT_FIXED_B) {
/* Disable antenna diversity. Use antenna B(LNA2) only. */
ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_B;
ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_B;
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 11ecd1a..7601f2f 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -3750,39 +3750,6 @@ ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni,
}
/*
- * Update the busy status of the last frame on the free list.
- * When doing TDMA, the busy flag tracks whether the hardware
- * currently points to this buffer or not, and thus gated DMA
- * may restart by re-reading the last descriptor in this
- * buffer.
- *
- * This should be called in the completion function once one
- * of the buffers has been used.
- */
-static void
-ath_tx_update_busy(struct ath_softc *sc)
-{
- struct ath_buf *last;
-
- /*
- * Since the last frame may still be marked
- * as ATH_BUF_BUSY, unmark it here before
- * finishing the frame processing.
- * Since we've completed a frame (aggregate
- * or otherwise), the hardware has moved on
- * and is no longer referencing the previous
- * descriptor.
- */
- ATH_TXBUF_LOCK_ASSERT(sc);
- last = TAILQ_LAST(&sc->sc_txbuf_mgmt, ath_bufhead_s);
- if (last != NULL)
- last->bf_flags &= ~ATH_BUF_BUSY;
- last = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s);
- if (last != NULL)
- last->bf_flags &= ~ATH_BUF_BUSY;
-}
-
-/*
* Process the completion of the given buffer.
*
* This calls the rate control update and then the buffer completion.
@@ -3901,7 +3868,6 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched)
break;
}
ATH_TXQ_REMOVE(txq, bf, bf_list);
-#ifdef IEEE80211_SUPPORT_TDMA
if (txq->axq_depth > 0) {
/*
* More frames follow. Mark the buffer busy
@@ -3914,9 +3880,6 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq, int dosched)
*/
bf->bf_last->bf_flags |= ATH_BUF_BUSY;
} else
-#else
- if (txq->axq_depth == 0)
-#endif
txq->axq_link = NULL;
if (bf->bf_state.bfs_aggr)
txq->axq_aggr_depth--;
@@ -4188,6 +4151,50 @@ ath_returnbuf_head(struct ath_softc *sc, struct ath_buf *bf)
}
/*
+ * Free the holding buffer if it exists
+ */
+static void
+ath_txq_freeholdingbuf(struct ath_softc *sc, struct ath_txq *txq)
+{
+ ATH_TXBUF_LOCK_ASSERT(sc);
+
+ if (txq->axq_holdingbf == NULL)
+ return;
+
+ txq->axq_holdingbf->bf_flags &= ~ATH_BUF_BUSY;
+ ath_returnbuf_tail(sc, txq->axq_holdingbf);
+ txq->axq_holdingbf = NULL;
+}
+
+/*
+ * Add this buffer to the holding queue, freeing the previous
+ * one if it exists.
+ */
+static void
+ath_txq_addholdingbuf(struct ath_softc *sc, struct ath_buf *bf)
+{
+ struct ath_txq *txq;
+
+ ATH_TXBUF_LOCK_ASSERT(sc);
+
+ /* XXX assert ATH_BUF_BUSY is set */
+
+ /* XXX assert the tx queue is under the max number */
+ if (bf->bf_state.bfs_tx_queue > HAL_NUM_TX_QUEUES) {
+ device_printf(sc->sc_dev, "%s: bf=%p: invalid tx queue (%d)\n",
+ __func__,
+ bf,
+ bf->bf_state.bfs_tx_queue);
+ bf->bf_flags &= ~ATH_BUF_BUSY;
+ ath_returnbuf_tail(sc, bf);
+ return;
+ }
+ txq = &sc->sc_txq[bf->bf_state.bfs_tx_queue];
+ ath_txq_freeholdingbuf(sc, txq);
+ txq->axq_holdingbf = bf;
+}
+
+/*
* Return a buffer to the pool and update the 'busy' flag on the
* previous 'tail' entry.
*
@@ -4207,8 +4214,20 @@ ath_freebuf(struct ath_softc *sc, struct ath_buf *bf)
KASSERT((bf->bf_node == NULL), ("%s: bf->bf_node != NULL\n", __func__));
KASSERT((bf->bf_m == NULL), ("%s: bf->bf_m != NULL\n", __func__));
+ /*
+ * If this buffer is busy, push it onto the holding queue
+ */
+ if (bf->bf_flags & ATH_BUF_BUSY) {
+ ATH_TXBUF_LOCK(sc);
+ ath_txq_addholdingbuf(sc, bf);
+ ATH_TXBUF_UNLOCK(sc);
+ return;
+ }
+
+ /*
+ * Not a busy buffer, so free normally
+ */
ATH_TXBUF_LOCK(sc);
- ath_tx_update_busy(sc);
ath_returnbuf_tail(sc, bf);
ATH_TXBUF_UNLOCK(sc);
}
@@ -4261,15 +4280,6 @@ ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
* NB: this assumes output has been stopped and
* we do not need to block ath_tx_proc
*/
- ATH_TXBUF_LOCK(sc);
- bf = TAILQ_LAST(&sc->sc_txbuf, ath_bufhead_s);
- if (bf != NULL)
- bf->bf_flags &= ~ATH_BUF_BUSY;
- bf = TAILQ_LAST(&sc->sc_txbuf_mgmt, ath_bufhead_s);
- if (bf != NULL)
- bf->bf_flags &= ~ATH_BUF_BUSY;
- ATH_TXBUF_UNLOCK(sc);
-
for (ix = 0;; ix++) {
ATH_TX_LOCK(sc);
bf = TAILQ_FIRST(&txq->axq_q);
@@ -4331,6 +4341,13 @@ ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
}
/*
+ * Free the holding buffer if it exists
+ */
+ ATH_TXBUF_LOCK(sc);
+ ath_txq_freeholdingbuf(sc, txq);
+ ATH_TXBUF_UNLOCK(sc);
+
+ /*
* Drain software queued frames which are on
* active TIDs.
*/
diff --git a/sys/dev/ath/if_ath_rx.c b/sys/dev/ath/if_ath_rx.c
index 139e894..3c40f17 100644
--- a/sys/dev/ath/if_ath_rx.c
+++ b/sys/dev/ath/if_ath_rx.c
@@ -399,13 +399,31 @@ ath_rx_tap_vendor(struct ifnet *ifp, struct mbuf *m,
sc->sc_rx_th.wr_v.evm[0] = rs->rs_evm0;
sc->sc_rx_th.wr_v.evm[1] = rs->rs_evm1;
sc->sc_rx_th.wr_v.evm[2] = rs->rs_evm2;
- /* XXX TODO: extend this to include 3-stream EVM */
+ /* These are only populated from the AR9300 or later */
+ sc->sc_rx_th.wr_v.evm[3] = rs->rs_evm3;
+ sc->sc_rx_th.wr_v.evm[4] = rs->rs_evm4;
+
+ /* direction */
+ sc->sc_rx_th.wr_v.vh_flags = ATH_VENDOR_PKT_RX;
+
+ /* RX rate */
+ sc->sc_rx_th.wr_v.vh_rx_hwrate = rs->rs_rate;
+
+ /* RX flags */
+ sc->sc_rx_th.wr_v.vh_rs_flags = rs->rs_flags;
+
+ if (rs->rs_isaggr)
+ sc->sc_rx_th.wr_v.vh_flags |= ATH_VENDOR_PKT_ISAGGR;
+ if (rs->rs_moreaggr)
+ sc->sc_rx_th.wr_v.vh_flags |= ATH_VENDOR_PKT_MOREAGGR;
/* phyerr info */
- if (rs->rs_status & HAL_RXERR_PHY)
+ if (rs->rs_status & HAL_RXERR_PHY) {
sc->sc_rx_th.wr_v.vh_phyerr_code = rs->rs_phyerr;
- else
+ sc->sc_rx_th.wr_v.vh_flags |= ATH_VENDOR_PKT_RXPHYERR;
+ } else {
sc->sc_rx_th.wr_v.vh_phyerr_code = 0xff;
+ }
sc->sc_rx_th.wr_v.vh_rs_status = rs->rs_status;
sc->sc_rx_th.wr_v.vh_rssi = rs->rs_rssi;
}
diff --git a/sys/dev/ath/if_ath_rx_edma.c b/sys/dev/ath/if_ath_rx_edma.c
index 301a22c..3df2341 100644
--- a/sys/dev/ath/if_ath_rx_edma.c
+++ b/sys/dev/ath/if_ath_rx_edma.c
@@ -661,9 +661,12 @@ ath_edma_rxfifo_alloc(struct ath_softc *sc, HAL_RX_QUEUE qtype, int nbufs)
bf = ath_edma_rxbuf_alloc(sc);
/* XXX should ensure the FIFO is not NULL? */
if (bf == NULL) {
- device_printf(sc->sc_dev, "%s: Q%d: alloc failed?\n",
+ device_printf(sc->sc_dev,
+ "%s: Q%d: alloc failed: i=%d, nbufs=%d?\n",
__func__,
- qtype);
+ qtype,
+ i,
+ nbufs);
break;
}
diff --git a/sys/dev/ath/if_ath_sysctl.c b/sys/dev/ath/if_ath_sysctl.c
index bbd1fe8..f55cec8 100644
--- a/sys/dev/ath/if_ath_sysctl.c
+++ b/sys/dev/ath/if_ath_sysctl.c
@@ -361,11 +361,13 @@ ath_sysctl_txagg(SYSCTL_HANDLER_ARGS)
for (i = 0; i < HAL_NUM_TX_QUEUES; i++) {
if (ATH_TXQ_SETUP(sc, i)) {
- printf("HW TXQ %d: axq_depth=%d, axq_aggr_depth=%d, axq_fifo_depth=%d\n",
+ printf("HW TXQ %d: axq_depth=%d, axq_aggr_depth=%d, "
+ "axq_fifo_depth=%d, holdingbf=%p\n",
i,
sc->sc_txq[i].axq_depth,
sc->sc_txq[i].axq_aggr_depth,
- sc->sc_txq[i].axq_fifo_depth);
+ sc->sc_txq[i].axq_fifo_depth,
+ sc->sc_txq[i].axq_holdingbf);
}
}
@@ -395,6 +397,23 @@ ath_sysctl_txagg(SYSCTL_HANDLER_ARGS)
printf("Total mgmt TX buffers: %d; Total mgmt TX buffers busy: %d\n",
t, i);
+ ATH_RX_LOCK(sc);
+ for (i = 0; i < 2; i++) {
+ printf("%d: fifolen: %d/%d; head=%d; tail=%d\n",
+ i,
+ sc->sc_rxedma[i].m_fifo_depth,
+ sc->sc_rxedma[i].m_fifolen,
+ sc->sc_rxedma[i].m_fifo_head,
+ sc->sc_rxedma[i].m_fifo_tail);
+ }
+ i = 0;
+ TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) {
+ i++;
+ }
+ printf("Total RX buffers in free list: %d buffers\n",
+ i);
+ ATH_RX_UNLOCK(sc);
+
return 0;
}
diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c
index 33318ea..c7b0fc1 100644
--- a/sys/dev/ath/if_ath_tx.c
+++ b/sys/dev/ath/if_ath_tx.c
@@ -3757,7 +3757,6 @@ ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an, int tid)
if (bf->bf_state.bfs_isretried) {
bf_next = TAILQ_NEXT(bf, bf_list);
ATH_TID_REMOVE(atid, bf, bf_list);
- atid->axq_depth--;
if (bf->bf_state.bfs_dobaw) {
ath_tx_update_baw(sc, an, atid, bf);
if (! bf->bf_state.bfs_addedbaw)
@@ -4140,11 +4139,10 @@ ath_tx_comp_cleanup_aggr(struct ath_softc *sc, struct ath_buf *bf_first)
int tid = bf_first->bf_state.bfs_tid;
struct ath_tid *atid = &an->an_tid[tid];
- bf = bf_first;
-
ATH_TX_LOCK(sc);
/* update incomp */
+ bf = bf_first;
while (bf) {
atid->incomp--;
bf = bf->bf_next;
@@ -4160,12 +4158,17 @@ ath_tx_comp_cleanup_aggr(struct ath_softc *sc, struct ath_buf *bf_first)
/* Send BAR if required */
/* XXX why would we send a BAR when transitioning to non-aggregation? */
+ /*
+ * XXX TODO: we should likely just tear down the BAR state here,
+ * rather than sending a BAR.
+ */
if (ath_tx_tid_bar_tx_ready(sc, atid))
ath_tx_tid_bar_tx(sc, atid);
ATH_TX_UNLOCK(sc);
/* Handle frame completion */
+ bf = bf_first;
while (bf) {
bf_next = bf->bf_next;
ath_tx_default_comp(sc, bf, 1);
@@ -4176,8 +4179,6 @@ ath_tx_comp_cleanup_aggr(struct ath_softc *sc, struct ath_buf *bf_first)
/*
* Handle completion of an set of aggregate frames.
*
- * XXX for now, simply complete each sub-frame.
- *
* Note: the completion handler is the last descriptor in the aggregate,
* not the last descriptor in the first frame.
*/
diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h
index f7b8600..577b759 100644
--- a/sys/dev/ath/if_athioctl.h
+++ b/sys/dev/ath/if_athioctl.h
@@ -273,6 +273,12 @@ struct ath_rateioctl {
#define ATH_RADIOTAP_MAX_CHAINS 4
/*
+ * AR9380 and later chips are 3x3, which requires
+ * 5 EVM DWORDs in HT40 mode.
+ */
+#define ATH_RADIOTAP_MAX_EVM 5
+
+/*
* The vendor radiotap header data needs to be:
*
* + Aligned to a 4 byte address
@@ -291,7 +297,7 @@ struct ath_radiotap_vendor_hdr { /* 30 bytes */
uint8_t vh_rx_chainmask; /* 1 */
/* At this point it should be 4 byte aligned */
- uint32_t evm[ATH_RADIOTAP_MAX_CHAINS]; /* 4 * 4 = 16 */
+ uint32_t evm[ATH_RADIOTAP_MAX_EVM]; /* 5 * 4 = 20 */
uint8_t rssi_ctl[ATH_RADIOTAP_MAX_CHAINS]; /* 4 */
uint8_t rssi_ext[ATH_RADIOTAP_MAX_CHAINS]; /* 4 */
@@ -299,7 +305,16 @@ struct ath_radiotap_vendor_hdr { /* 30 bytes */
uint8_t vh_phyerr_code; /* Phy error code, or 0xff */
uint8_t vh_rs_status; /* RX status */
uint8_t vh_rssi; /* Raw RSSI */
- uint8_t vh_pad1[1]; /* Pad to 4 byte boundary */
+ uint8_t vh_flags; /* General flags */
+#define ATH_VENDOR_PKT_RX 0x01
+#define ATH_VENDOR_PKT_TX 0x02
+#define ATH_VENDOR_PKT_RXPHYERR 0x04
+#define ATH_VENDOR_PKT_ISAGGR 0x08
+#define ATH_VENDOR_PKT_MOREAGGR 0x10
+
+ uint8_t vh_rx_hwrate; /* hardware RX ratecode */
+ uint8_t vh_rs_flags; /* RX HAL flags */
+ uint8_t vh_pad[2]; /* pad to DWORD boundary */
} __packed;
#endif /* ATH_ENABLE_RADIOTAP_VENDOR_EXT */
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index 06cffb6..d3e4aa30 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -329,6 +329,16 @@ struct ath_txq {
u_int axq_intrcnt; /* interrupt count */
u_int32_t *axq_link; /* link ptr in last TX desc */
TAILQ_HEAD(axq_q_s, ath_buf) axq_q; /* transmit queue */
+ /*
+ * XXX the holdingbf field is protected by the TXBUF lock
+ * for now, NOT the TX lock.
+ *
+ * Architecturally, it would likely be better to move
+ * the holdingbf field to a separate array in ath_softc
+ * just to highlight that it's not protected by the normal
+ * TX path lock.
+ */
+ struct ath_buf *axq_holdingbf; /* holding TX buffer */
char axq_name[12]; /* e.g. "ath0_txq4" */
/* Per-TID traffic queue for software -> hardware TX */
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index db86ec2..cf1a240 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -3594,15 +3594,15 @@ bge_attach(device_t dev)
}
bge_stop_fw(sc);
- bge_sig_pre_reset(sc, BGE_RESET_START);
+ bge_sig_pre_reset(sc, BGE_RESET_SHUTDOWN);
if (bge_reset(sc)) {
device_printf(sc->bge_dev, "chip reset failed\n");
error = ENXIO;
goto fail;
}
- bge_sig_legacy(sc, BGE_RESET_START);
- bge_sig_post_reset(sc, BGE_RESET_START);
+ bge_sig_legacy(sc, BGE_RESET_SHUTDOWN);
+ bge_sig_post_reset(sc, BGE_RESET_SHUTDOWN);
if (bge_chipinit(sc)) {
device_printf(sc->bge_dev, "chip initialization failed\n");
@@ -3960,6 +3960,20 @@ bge_reset(struct bge_softc *sc)
} else
write_op = bge_writereg_ind;
+ if (sc->bge_asicrev != BGE_ASICREV_BCM5700 &&
+ sc->bge_asicrev != BGE_ASICREV_BCM5701) {
+ CSR_WRITE_4(sc, BGE_NVRAM_SWARB, BGE_NVRAMSWARB_SET1);
+ for (i = 0; i < 8000; i++) {
+ if (CSR_READ_4(sc, BGE_NVRAM_SWARB) &
+ BGE_NVRAMSWARB_GNT1)
+ break;
+ DELAY(20);
+ }
+ if (i == 8000) {
+ if (bootverbose)
+ device_printf(dev, "NVRAM lock timedout!\n");
+ }
+ }
/* Take APE lock when performing reset. */
bge_ape_lock(sc, BGE_APE_LOCK_GRC);
diff --git a/sys/dev/ichwd/ichwd.c b/sys/dev/ichwd/ichwd.c
index 2a0feb0..245cfbf 100644
--- a/sys/dev/ichwd/ichwd.c
+++ b/sys/dev/ichwd/ichwd.c
@@ -323,8 +323,6 @@ ichwd_tmr_reload(struct ichwd_softc *sc)
ichwd_write_tco_1(sc, TCO_RLD, 1);
else
ichwd_write_tco_2(sc, TCO_RLD, 1);
-
- ichwd_verbose_printf(sc->device, "timer reloaded\n");
}
/*
diff --git a/sys/dev/iscsi/initiator/isc_soc.c b/sys/dev/iscsi/initiator/isc_soc.c
index 7d0219b..947aadc 100644
--- a/sys/dev/iscsi/initiator/isc_soc.c
+++ b/sys/dev/iscsi/initiator/isc_soc.c
@@ -91,7 +91,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq)
/*
| mbuf for the iSCSI header
*/
- MGETHDR(mh, M_TRYWAIT, MT_DATA);
+ MGETHDR(mh, M_WAITOK, MT_DATA);
mh->m_pkthdr.rcvif = NULL;
mh->m_next = NULL;
mh->m_len = sizeof(union ipdu_u);
@@ -132,7 +132,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq)
while(len > 0) {
int l;
- MGET(md, M_TRYWAIT, MT_DATA);
+ MGET(md, M_WAITOK, MT_DATA);
md->m_ext.ref_cnt = &ou_refcnt;
l = min(MCLBYTES, len);
debug(4, "setting ext_free(arg=%p len/l=%d/%d)", pq->buf, len, l);
@@ -150,7 +150,7 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq)
off += l;
}
if(((pp->ds_len & 03) != 0) || ISOK2DIG(sp->dataDigest, pp)) {
- MGET(md, M_TRYWAIT, MT_DATA);
+ MGET(md, M_WAITOK, MT_DATA);
if(pp->ds_len & 03)
len = 4 - (pp->ds_len & 03);
else
diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c
index 6d933e8..d82f031 100644
--- a/sys/dev/puc/pucdata.c
+++ b/sys/dev/puc/pucdata.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
static puc_config_f puc_config_amc;
static puc_config_f puc_config_diva;
static puc_config_f puc_config_exar;
+static puc_config_f puc_config_exar_pcie;
static puc_config_f puc_config_icbook;
static puc_config_f puc_config_moxa;
static puc_config_f puc_config_oxford_pcie;
@@ -630,6 +631,14 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_8S, 0x10, 0, -1,
},
+ /* The XR17V358 uses the 125MHz PCIe clock as its reference clock. */
+ { 0x13a8, 0x0358, 0xffff, 0,
+ "Exar XR17V358",
+ 125000000,
+ PUC_PORT_8S, 0x10, 0, -1,
+ .config_function = puc_config_exar_pcie
+ },
+
{ 0x13fe, 0x1600, 0x1602, 0x0002,
"Advantech PCI-1602",
DEFAULT_RCLK * 8,
@@ -1186,6 +1195,17 @@ puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
}
static int
+puc_config_exar_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+ intptr_t *res)
+{
+ if (cmd == PUC_CFG_GET_OFS) {
+ *res = port * 0x400;
+ return (0);
+ }
+ return (ENXIO);
+}
+
+static int
puc_config_icbook(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 9ec914a..d9df41a 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -1587,7 +1587,8 @@ re_attach(device_t dev)
* packet has IP options so disable TX IP checksum offloading.
*/
if (sc->rl_hwrev->rl_rev == RL_HWREV_8168C ||
- sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2)
+ sc->rl_hwrev->rl_rev == RL_HWREV_8168C_SPIN2 ||
+ sc->rl_hwrev->rl_rev == RL_HWREV_8168CP)
ifp->if_hwassist = CSUM_TCP | CSUM_UDP;
else
ifp->if_hwassist = CSUM_IP | CSUM_TCP | CSUM_UDP;
@@ -3419,7 +3420,8 @@ re_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) {
rev = sc->rl_hwrev->rl_rev;
if (rev == RL_HWREV_8168C ||
- rev == RL_HWREV_8168C_SPIN2)
+ rev == RL_HWREV_8168C_SPIN2 ||
+ rev == RL_HWREV_8168CP)
ifp->if_hwassist |= CSUM_TCP | CSUM_UDP;
else
ifp->if_hwassist |= RE_CSUM_FEATURES;
diff --git a/sys/dev/sis/if_sis.c b/sys/dev/sis/if_sis.c
index 456c3d4..55bb7ca 100644
--- a/sys/dev/sis/if_sis.c
+++ b/sys/dev/sis/if_sis.c
@@ -625,7 +625,7 @@ sis_miibus_statchg(device_t dev)
SIS_CLRBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS);
}
- if (sc->sis_type == SIS_TYPE_83816) {
+ if (sc->sis_type == SIS_TYPE_83815 && sc->sis_srr >= NS_SRR_16A) {
/*
* MPII03.D: Half Duplex Excessive Collisions.
* Also page 49 in 83816 manual
@@ -1989,7 +1989,7 @@ sis_initl(struct sis_softc *sc)
return;
}
- if (sc->sis_type == SIS_TYPE_83815 || sc->sis_type == SIS_TYPE_83816) {
+ if (sc->sis_type == SIS_TYPE_83815) {
if (sc->sis_manual_pad != 0)
sc->sis_flags |= SIS_FLAG_MANUAL_PAD;
else
diff --git a/sys/dev/sis/if_sisreg.h b/sys/dev/sis/if_sisreg.h
index b400806..6256fde 100644
--- a/sys/dev/sis/if_sisreg.h
+++ b/sys/dev/sis/if_sisreg.h
@@ -439,7 +439,6 @@ struct sis_type {
#define SIS_TYPE_900 1
#define SIS_TYPE_7016 2
#define SIS_TYPE_83815 3
-#define SIS_TYPE_83816 4
struct sis_txdesc {
struct mbuf *tx_m;
diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c
index ef3124a..cd1a4f6 100644
--- a/sys/dev/sound/pci/hda/hdaa_patches.c
+++ b/sys/dev/sound/pci/hda/hdaa_patches.c
@@ -344,7 +344,10 @@ hdac_pin_patch(struct hdaa_widget *w)
break;
}
} else if (id == HDA_CODEC_ALC269 &&
- subid == LENOVO_X1CRBN_SUBVENDOR) {
+ (subid == LENOVO_X1CRBN_SUBVENDOR ||
+ subid == LENOVO_T430_SUBVENDOR ||
+ subid == LENOVO_T430S_SUBVENDOR ||
+ subid == LENOVO_T530_SUBVENDOR)) {
switch (nid) {
case 21:
patch = "as=1 seq=15";
diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h
index e82b6ae..89087f4 100644
--- a/sys/dev/sound/pci/hda/hdac.h
+++ b/sys/dev/sound/pci/hda/hdac.h
@@ -225,7 +225,10 @@
#define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
#define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
#define LENOVO_T420_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
+#define LENOVO_T430_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3)
+#define LENOVO_T430S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb)
#define LENOVO_T520_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21cf)
+#define LENOVO_T530_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f6)
#define LENOVO_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0xffff)
/* Samsung */
diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c
index 7171065..c11eaa3 100644
--- a/sys/dev/sound/pcm/sndstat.c
+++ b/sys/dev/sound/pcm/sndstat.c
@@ -345,8 +345,12 @@ sndstat_prepare(struct sbuf *s)
struct snddev_info *d;
int i, j;
- sbuf_printf(s, "FreeBSD Audio Driver (newpcm: %ubit %d/%s)\n",
- (u_int)sizeof(intpcm32_t) << 3, SND_DRV_VERSION, MACHINE_ARCH);
+ if (snd_verbose > 0) {
+ sbuf_printf(s, "FreeBSD Audio Driver (%ubit %d/%s)\n",
+ (u_int)sizeof(intpcm32_t) << 3, SND_DRV_VERSION,
+ MACHINE_ARCH);
+ }
+
if (SLIST_EMPTY(&sndstat_devlist)) {
sbuf_printf(s, "No devices installed.\n");
sbuf_finish(s);
diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c
index 21479a1..9559ae2 100644
--- a/sys/dev/usb/serial/uftdi.c
+++ b/sys/dev/usb/serial/uftdi.c
@@ -753,6 +753,8 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = {
UFTDI_DEV(MOBILITY, USB_SERIAL, UFTDI_TYPE_AUTO),
UFTDI_DEV(OLIMEX, ARM_USB_OCD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG),
UFTDI_DEV(OLIMEX, ARM_USB_OCD_H, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG),
+ UFTDI_DEV(OPTO, CRD7734, UFTDI_TYPE_AUTO),
+ UFTDI_DEV(OPTO, CRD7734_1, UFTDI_TYPE_AUTO),
UFTDI_DEV(PAPOUCH, AD4USB, UFTDI_TYPE_AUTO),
UFTDI_DEV(PAPOUCH, AP485, UFTDI_TYPE_AUTO),
UFTDI_DEV(PAPOUCH, AP485_2, UFTDI_TYPE_AUTO),
diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c
index 1c40815..43378c0 100644
--- a/sys/dev/usb/usb_device.c
+++ b/sys/dev/usb/usb_device.c
@@ -1698,10 +1698,14 @@ usb_alloc_device(device_t parent_dev, struct usb_bus *bus,
err = usbd_setup_device_desc(udev, NULL);
if (err != 0) {
- /* XXX try to re-enumerate the device */
+ /* try to enumerate two more times */
err = usbd_req_re_enumerate(udev, NULL);
- if (err)
- goto done;
+ if (err != 0) {
+ err = usbd_req_re_enumerate(udev, NULL);
+ if (err != 0) {
+ goto done;
+ }
+ }
}
/*
diff --git a/sys/dev/usb/usb_request.c b/sys/dev/usb/usb_request.c
index 1a366d6..673ec7c 100644
--- a/sys/dev/usb/usb_request.c
+++ b/sys/dev/usb/usb_request.c
@@ -76,6 +76,11 @@ static int usb_no_cs_fail;
SYSCTL_INT(_hw_usb, OID_AUTO, no_cs_fail, CTLFLAG_RW,
&usb_no_cs_fail, 0, "USB clear stall failures are ignored, if set");
+static int usb_full_ddesc;
+
+SYSCTL_INT(_hw_usb, OID_AUTO, full_ddesc, CTLFLAG_RW,
+ &usb_full_ddesc, 0, "USB always read complete device descriptor, if set");
+
#ifdef USB_DEBUG
#ifdef USB_REQ_DEBUG
/* The following structures are used in connection to fault injection. */
@@ -1002,7 +1007,7 @@ usbd_req_get_desc(struct usb_device *udev,
USETW(req.wLength, min_len);
err = usbd_do_request_flags(udev, mtx, &req,
- desc, 0, NULL, 1000);
+ desc, 0, NULL, 500 /* ms */);
if (err) {
if (!retries) {
@@ -1887,32 +1892,41 @@ usbd_setup_device_desc(struct usb_device *udev, struct mtx *mtx)
*/
switch (udev->speed) {
case USB_SPEED_FULL:
- case USB_SPEED_LOW:
+ if (usb_full_ddesc != 0) {
+ /* get full device descriptor */
+ err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc);
+ if (err == 0)
+ break;
+ }
+
+ /* get partial device descriptor, some devices crash on this */
err = usbd_req_get_desc(udev, mtx, NULL, &udev->ddesc,
USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0);
- if (err != 0) {
- DPRINTFN(0, "getting device descriptor "
- "at addr %d failed, %s\n", udev->address,
- usbd_errstr(err));
- return (err);
- }
- break;
- default:
- DPRINTF("Minimum MaxPacketSize is large enough "
- "to hold the complete device descriptor\n");
+ if (err != 0)
+ break;
+
+ /* get the full device descriptor */
+ err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc);
break;
- }
- /* get the full device descriptor */
- err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc);
+ default:
+ DPRINTF("Minimum bMaxPacketSize is large enough "
+ "to hold the complete device descriptor or "
+ "only one bMaxPacketSize choice\n");
- /* try one more time, if error */
- if (err)
+ /* get the full device descriptor */
err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc);
- if (err) {
- DPRINTF("addr=%d, getting full desc failed\n",
- udev->address);
+ /* try one more time, if error */
+ if (err != 0)
+ err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc);
+ break;
+ }
+
+ if (err != 0) {
+ DPRINTFN(0, "getting device descriptor "
+ "at addr %d failed, %s\n", udev->address,
+ usbd_errstr(err));
return (err);
}
diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs
index 958745e..87a09ad 100644
--- a/sys/dev/usb/usbdevs
+++ b/sys/dev/usb/usbdevs
@@ -323,6 +323,7 @@ vendor GUNZE 0x0637 Gunze Electronics USA
vendor AVISION 0x0638 Avision
vendor TEAC 0x0644 TEAC
vendor ACTON 0x0647 Acton Research Corp.
+vendor OPTO 0x065a Optoelectronics Co., Ltd
vendor SGI 0x065e Silicon Graphics
vendor SANWASUPPLY 0x0663 Sanwa Supply
vendor MEGATEC 0x0665 Megatec
@@ -2498,6 +2499,7 @@ product LOGITEC RT2870_2 0x0163 RT2870
product LOGITEC RT2870_3 0x0164 RT2870
product LOGITEC LANW300NU2 0x0166 LAN-W300N/U2
product LOGITEC LANW150NU2 0x0168 LAN-W150N/U2
+product LOGITEC LANW300NU2S 0x0169 LAN-W300N/U2S
/* Longcheer Holdings, Ltd. products */
product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA
@@ -3150,6 +3152,13 @@ product OPTION ICON321 0xd031 Globetrotter HSUPA
product OPTION ICON505 0xd055 Globetrotter iCON 505
product OPTION ICON452 0x7901 Globetrotter iCON 452
+/* Optoelectronics Co., Ltd */
+product OPTO BARCODE 0x0001 Barcode Reader
+product OPTO OPTICONCODE 0x0009 Opticon Code Reader
+product OPTO BARCODE_1 0xa002 Barcode Reader
+product OPTO CRD7734 0xc000 USB Cradle CRD-7734-RU
+product OPTO CRD7734_1 0xc001 USB Cradle CRD-7734-RU
+
/* OvisLink product */
product OVISLINK RT3072 0x3072 RT3072
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c
index dd29b40..aed07a2 100644
--- a/sys/dev/usb/wlan/if_run.c
+++ b/sys/dev/usb/wlan/if_run.c
@@ -211,6 +211,7 @@ static const STRUCT_USB_HOST_ID run_devs[] = {
RUN_DEV(LOGITEC, RT2870_3),
RUN_DEV(LOGITEC, LANW300NU2),
RUN_DEV(LOGITEC, LANW150NU2),
+ RUN_DEV(LOGITEC, LANW300NU2S),
RUN_DEV(MELCO, RT2870_1),
RUN_DEV(MELCO, RT2870_2),
RUN_DEV(MELCO, WLIUCAG300N),
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c
index 21ee0fc..47d4f75 100644
--- a/sys/fs/cd9660/cd9660_vnops.c
+++ b/sys/fs/cd9660/cd9660_vnops.c
@@ -329,7 +329,7 @@ cd9660_read(ap)
if (lblktosize(imp, rablock) < ip->i_size)
error = cluster_read(vp, (off_t)ip->i_size,
lbn, size, NOCRED, uio->uio_resid,
- (ap->a_ioflag >> 16), &bp);
+ (ap->a_ioflag >> 16), 0, &bp);
else
error = bread(vp, lbn, size, NOCRED, &bp);
} else {
diff --git a/sys/fs/ext2fs/ext2_balloc.c b/sys/fs/ext2fs/ext2_balloc.c
index 1c0cc0e..88ad710 100644
--- a/sys/fs/ext2fs/ext2_balloc.c
+++ b/sys/fs/ext2fs/ext2_balloc.c
@@ -276,7 +276,7 @@ ext2_balloc(struct inode *ip, int32_t lbn, int size, struct ucred *cred,
if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
error = cluster_read(vp, ip->i_size, lbn,
(int)fs->e2fs_bsize, NOCRED,
- MAXBSIZE, seqcount, &nbp);
+ MAXBSIZE, seqcount, 0, &nbp);
} else {
error = bread(vp, lbn, (int)fs->e2fs_bsize, NOCRED, &nbp);
}
diff --git a/sys/fs/ext2fs/ext2_vnops.c b/sys/fs/ext2fs/ext2_vnops.c
index 1c0b7a1..77eb74b 100644
--- a/sys/fs/ext2fs/ext2_vnops.c
+++ b/sys/fs/ext2fs/ext2_vnops.c
@@ -1618,10 +1618,11 @@ ext2_read(struct vop_read_args *ap)
if (lblktosize(fs, nextlbn) >= ip->i_size)
error = bread(vp, lbn, size, NOCRED, &bp);
- else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0)
+ else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
error = cluster_read(vp, ip->i_size, lbn, size,
- NOCRED, blkoffset + uio->uio_resid, seqcount, &bp);
- else if (seqcount > 1) {
+ NOCRED, blkoffset + uio->uio_resid, seqcount,
+ 0, &bp);
+ } else if (seqcount > 1) {
int nextsize = blksize(fs, ip, nextlbn);
error = breadn(vp, lbn,
size, &nextlbn, &nextsize, 1, NOCRED, &bp);
@@ -1831,7 +1832,7 @@ ext2_write(struct vop_write_args *ap)
} else if (xfersize + blkoffset == fs->e2fs_fsize) {
if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) {
bp->b_flags |= B_CLUSTEROK;
- cluster_write(vp, bp, ip->i_size, seqcount);
+ cluster_write(vp, bp, ip->i_size, seqcount, 0);
} else {
bawrite(bp);
}
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index 8e045cb..213ae81 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -600,7 +600,7 @@ msdosfs_read(ap)
error = bread(vp, lbn, blsize, NOCRED, &bp);
} else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
error = cluster_read(vp, dep->de_FileSize, lbn, blsize,
- NOCRED, on + uio->uio_resid, seqcount, &bp);
+ NOCRED, on + uio->uio_resid, seqcount, 0, &bp);
} else if (seqcount > 1) {
rasize = blsize;
error = breadn(vp, lbn,
@@ -820,7 +820,7 @@ msdosfs_write(ap)
else if (n + croffset == pmp->pm_bpcluster) {
if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0)
cluster_write(vp, bp, dep->de_FileSize,
- seqcount);
+ seqcount, 0);
else
bawrite(bp);
} else
diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h
index ea04525..2cbba2d 100644
--- a/sys/fs/nfs/nfsport.h
+++ b/sys/fs/nfs/nfsport.h
@@ -140,32 +140,32 @@
* Allocate mbufs. Must succeed and never set the mbuf ptr to NULL.
*/
#define NFSMGET(m) do { \
- MGET((m), M_TRYWAIT, MT_DATA); \
+ MGET((m), M_WAITOK, MT_DATA); \
while ((m) == NULL ) { \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
- MGET((m), M_TRYWAIT, MT_DATA); \
+ MGET((m), M_WAITOK, MT_DATA); \
} \
} while (0)
#define NFSMGETHDR(m) do { \
- MGETHDR((m), M_TRYWAIT, MT_DATA); \
+ MGETHDR((m), M_WAITOK, MT_DATA); \
while ((m) == NULL ) { \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
- MGETHDR((m), M_TRYWAIT, MT_DATA); \
+ MGETHDR((m), M_WAITOK, MT_DATA); \
} \
} while (0)
#define NFSMCLGET(m, w) do { \
- MGET((m), M_TRYWAIT, MT_DATA); \
+ MGET((m), M_WAITOK, MT_DATA); \
while ((m) == NULL ) { \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
- MGET((m), M_TRYWAIT, MT_DATA); \
+ MGET((m), M_WAITOK, MT_DATA); \
} \
MCLGET((m), (w)); \
} while (0)
#define NFSMCLGETHDR(m, w) do { \
- MGETHDR((m), M_TRYWAIT, MT_DATA); \
+ MGETHDR((m), M_WAITOK, MT_DATA); \
while ((m) == NULL ) { \
(void) nfs_catnap(PZERO, 0, "nfsmget"); \
- MGETHDR((m), M_TRYWAIT, MT_DATA); \
+ MGETHDR((m), M_WAITOK, MT_DATA); \
} \
} while (0)
#define NFSMTOD mtod
@@ -981,13 +981,6 @@ struct nfsreq {
#define NFSVNO_DELEGOK(v) (1)
#endif
-/*
- * Define this as the flags argument for msleep() when catching signals
- * while holding a resource that other threads would block for, such as
- * a vnode lock.
- */
-#define NFS_PCATCH (PCATCH | PBDRY)
-
#endif /* _KERNEL */
#endif /* _NFS_NFSPORT_H */
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index f0a44a4..4a3ef41 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -1297,7 +1297,7 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td)
sigset_t oldset;
newnfs_set_sigmask(td, &oldset);
- bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0);
+ bp = getblk(vp, bn, size, PCATCH, 0, 0);
newnfs_restore_sigmask(td, &oldset);
while (bp == NULL) {
if (newnfs_sigintr(nmp, td))
@@ -1332,7 +1332,7 @@ ncl_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg)
if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF))
intrflg = 1;
if (intrflg) {
- slpflag = NFS_PCATCH;
+ slpflag = PCATCH;
slptimeo = 2 * hz;
} else {
slpflag = 0;
@@ -1413,7 +1413,7 @@ ncl_asyncio(struct nfsmount *nmp, struct buf *bp, struct ucred *cred, struct thr
}
again:
if (nmp->nm_flag & NFSMNT_INT)
- slpflag = NFS_PCATCH;
+ slpflag = PCATCH;
gotiod = FALSE;
/*
@@ -1478,7 +1478,7 @@ again:
mtx_unlock(&ncl_iod_mutex);
return (error2);
}
- if (slpflag == NFS_PCATCH) {
+ if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
}
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 2e105f8..4b52a05 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -2660,7 +2660,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct ucred *cred, struct thread *td,
if (called_from_renewthread != 0)
slptimeo = hz;
if (nmp->nm_flag & NFSMNT_INT)
- slpflag = NFS_PCATCH;
+ slpflag = PCATCH;
if (!commit)
passone = 0;
bo = &vp->v_bufobj;
@@ -2866,7 +2866,7 @@ loop:
error = EINTR;
goto done;
}
- if (slpflag & PCATCH) {
+ if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
}
@@ -2912,7 +2912,7 @@ loop:
error = newnfs_sigintr(nmp, td);
if (error)
goto done;
- if (slpflag & PCATCH) {
+ if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
}
diff --git a/sys/fs/nwfs/nwfs.h b/sys/fs/nwfs/nwfs.h
deleted file mode 100644
index af71724..0000000
--- a/sys/fs/nwfs/nwfs.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _NWFS_H_
-#define _NWFS_H_
-
-#include <netncp/ncp.h>
-#include <fs/nwfs/nwfs_mount.h>
-
-#define NR_OPEN 0
-#define NW_NSB_DOS (1 << NW_NS_DOS)
-#define NW_NSB_MAC (1 << NW_NS_MAC)
-#define NW_NSB_NFS (1 << NW_NS_NFS)
-#define NW_NSB_FTAM (1 << NW_NS_FTAM)
-#define NW_NSB_OS2 (1 << NW_NS_OS2)
-
-#define NWFSIOC_GETCONN _IOR('n',1,int)
-#define NWFSIOC_GETEINFO _IOR('n',2,struct nw_entry_info)
-#define NWFSIOC_GETNS _IOR('n',3,int)
-
-#ifdef _KERNEL
-
-#include <sys/vnode.h>
-#include <sys/mount.h>
-
-struct nwfsnode;
-
-struct nwmount {
- struct nwfs_args m;
- struct mount *mp;
- struct ncp_handle *connh;
- int name_space;
- struct nwnode *n_root;
- u_int32_t n_volume;
- ncpfid n_rootent;
- int n_id;
-};
-
-#define VFSTONWFS(mntp) ((struct nwmount *)((mntp)->mnt_data))
-#define NWFSTOVFS(mnp) ((struct mount *)((mnp)->mount))
-#define VTOVFS(vp) ((vp)->v_mount)
-#define VTONWFS(vp) (VFSTONWFS(VTOVFS(vp)))
-#define NWFSTOCONN(nmp) ((nmp)->connh->nh_conn)
-
-int ncp_conn_logged_in(struct nwmount *);
-int nwfs_ioctl(struct vop_ioctl_args *ap);
-int nwfs_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td);
-int nwfs_vinvalbuf(struct vnode *vp, struct thread *td);
-
-extern struct vop_vector nwfs_vnodeops;
-
-#endif /* _KERNEL */
-
-#endif /* _NWFS_H_ */
diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c
deleted file mode 100644
index cd3c989..0000000
--- a/sys/fs/nwfs/nwfs_io.c
+++ /dev/null
@@ -1,599 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- *
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bio.h>
-#include <sys/buf.h>
-#include <sys/mount.h>
-#include <sys/namei.h>
-#include <sys/vnode.h>
-#include <sys/dirent.h>
-#include <sys/sysctl.h>
-
-#include <vm/vm.h>
-#include <vm/vm_param.h>
-#include <vm/vm_page.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_object.h>
-#include <vm/vm_pager.h>
-#include <vm/vnode_pager.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_ncp.h>
-
-#include <fs/nwfs/nwfs.h>
-#include <fs/nwfs/nwfs_node.h>
-#include <fs/nwfs/nwfs_subr.h>
-
-static int nwfs_fastlookup = 1;
-
-SYSCTL_DECL(_vfs_nwfs);
-SYSCTL_INT(_vfs_nwfs, OID_AUTO, fastlookup, CTLFLAG_RW, &nwfs_fastlookup, 0, "");
-
-
-extern int nwfs_pbuf_freecnt;
-
-#define DE_SIZE (sizeof(struct dirent))
-#define NWFS_RWCACHE
-
-static int
-nwfs_readvdir(struct vnode *vp, struct uio *uio, struct ucred *cred) {
- struct nwmount *nmp = VTONWFS(vp);
- int error, count, i;
- struct dirent dp;
- struct nwnode *np = VTONW(vp);
- struct nw_entry_info fattr;
- struct vnode *newvp;
- struct componentname cn;
- ncpfid fid;
-
- np = VTONW(vp);
- NCPVNDEBUG("dirname='%s'\n",np->n_name);
- if (uio->uio_resid < DE_SIZE || (uio->uio_offset < 0))
- return (EINVAL);
- error = 0;
- count = 0;
- i = uio->uio_offset / DE_SIZE; /* offset in directory */
- if (i == 0) {
- error = ncp_initsearch(vp, uio->uio_td, cred);
- if (error) {
- NCPVNDEBUG("cannot initialize search, error=%d",error);
- return( error );
- }
- }
-
- for (; uio->uio_resid >= DE_SIZE; i++) {
- bzero((char *) &dp, DE_SIZE);
- dp.d_reclen = DE_SIZE;
- switch (i) {
- case 0: /* `.' */
- case 1: /* `..' */
- dp.d_fileno = (i == 0) ? np->n_fid.f_id : np->n_parent.f_id;
- if (!dp.d_fileno) dp.d_fileno = NWFS_ROOT_INO;
- dp.d_namlen = i + 1;
- dp.d_name[0] = '.';
- dp.d_name[1] = '.';
- dp.d_name[i + 1] = '\0';
- dp.d_type = DT_DIR;
- break;
- default:
- error = ncp_search_for_file_or_subdir(nmp, &np->n_seq, &fattr, uio->uio_td, cred);
- if (error && error < 0x80) break;
- dp.d_fileno = fattr.dirEntNum;
- dp.d_type = (fattr.attributes & aDIR) ? DT_DIR : DT_REG;
- dp.d_namlen = fattr.nameLen;
- bcopy(fattr.entryName, dp.d_name, dp.d_namlen);
- dp.d_name[dp.d_namlen] = '\0';
-#if 0
- if (error && eofflag) {
- /* *eofflag = 1;*/
- break;
- }
-#endif
- break;
- }
- if (nwfs_fastlookup && !error && i > 1) {
- fid.f_id = fattr.dirEntNum;
- fid.f_parent = np->n_fid.f_id;
- error = nwfs_nget(vp->v_mount, fid, &fattr, vp, &newvp);
- if (!error) {
- VTONW(newvp)->n_ctime = VTONW(newvp)->n_vattr.va_ctime.tv_sec;
- cn.cn_nameptr = dp.d_name;
- cn.cn_namelen = dp.d_namlen;
- cache_enter(vp, newvp, &cn);
- vput(newvp);
- } else
- error = 0;
- }
- if (error >= 0x80) {
- error = 0;
- break;
- }
- if ((error = uiomove(&dp, DE_SIZE, uio)))
- break;
- }
-
- uio->uio_offset = i * DE_SIZE;
- return (error);
-}
-
-int
-nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) {
- struct nwmount *nmp = VFSTONWFS(vp->v_mount);
- struct nwnode *np = VTONW(vp);
- struct thread *td;
- struct vattr vattr;
- int error, biosize;
-
- if (vp->v_type != VREG && vp->v_type != VDIR) {
- printf("%s: vn types other than VREG or VDIR are unsupported !\n",__func__);
- return EIO;
- }
- if (uiop->uio_resid == 0) return 0;
- if (uiop->uio_offset < 0) return EINVAL;
-/* if (uiop->uio_offset + uiop->uio_resid > nmp->nm_maxfilesize)
- return (EFBIG);*/
- td = uiop->uio_td;
- if (vp->v_type == VDIR) {
- error = nwfs_readvdir(vp, uiop, cred);
- return error;
- }
- biosize = NWFSTOCONN(nmp)->buffer_size;
- if (np->n_flag & NMODIFIED) {
- nwfs_attr_cacheremove(vp);
- error = VOP_GETATTR(vp, &vattr, cred);
- if (error) return (error);
- np->n_mtime = vattr.va_mtime.tv_sec;
- } else {
- error = VOP_GETATTR(vp, &vattr, cred);
- if (error) return (error);
- if (np->n_mtime != vattr.va_mtime.tv_sec) {
- error = nwfs_vinvalbuf(vp, td);
- if (error) return (error);
- np->n_mtime = vattr.va_mtime.tv_sec;
- }
- }
- error = ncp_read(NWFSTOCONN(nmp), &np->n_fh, uiop, cred);
- return (error);
-}
-
-int
-nwfs_writevnode(vp, uiop, cred, ioflag)
- struct vnode *vp;
- struct uio *uiop;
- struct ucred *cred;
- int ioflag;
-{
- struct nwmount *nmp = VTONWFS(vp);
- struct nwnode *np = VTONW(vp);
- struct thread *td;
-/* struct vattr vattr;*/
- int error = 0;
-
- if (vp->v_type != VREG) {
- printf("%s: vn types other than VREG unsupported !\n",__func__);
- return EIO;
- }
- NCPVNDEBUG("ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid);
- if (uiop->uio_offset < 0) return EINVAL;
-/* if (uiop->uio_offset + uiop->uio_resid > nmp->nm_maxfilesize)
- return (EFBIG);*/
- td = uiop->uio_td;
- if (ioflag & (IO_APPEND | IO_SYNC)) {
- if (np->n_flag & NMODIFIED) {
- nwfs_attr_cacheremove(vp);
- error = nwfs_vinvalbuf(vp, td);
- if (error) return (error);
- }
- if (ioflag & IO_APPEND) {
- /* We can relay only on local information about file size,
- * because until file is closed NetWare will not return
- * the correct size. */
-#ifdef notyet
- nwfs_attr_cacheremove(vp);
- error = VOP_GETATTR(vp, &vattr, cred);
- if (error) return (error);
-#endif
- uiop->uio_offset = np->n_size;
- }
- }
- if (uiop->uio_resid == 0) return 0;
-
- if (vn_rlimit_fsize(vp, uiop, td))
- return (EFBIG);
-
- error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, uiop, cred);
- NCPVNDEBUG("after: ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid);
- if (!error) {
- if (uiop->uio_offset > np->n_size) {
- np->n_vattr.va_size = np->n_size = uiop->uio_offset;
- vnode_pager_setsize(vp, np->n_size);
- }
- }
- return (error);
-}
-
-/*
- * Do an I/O operation to/from a cache block.
- */
-int
-nwfs_doio(vp, bp, cr, td)
- struct vnode *vp;
- struct buf *bp;
- struct ucred *cr;
- struct thread *td;
-{
- struct uio *uiop;
- struct nwnode *np;
- struct nwmount *nmp;
- int error = 0;
- struct uio uio;
- struct iovec io;
-
- np = VTONW(vp);
- nmp = VFSTONWFS(vp->v_mount);
- uiop = &uio;
- uiop->uio_iov = &io;
- uiop->uio_iovcnt = 1;
- uiop->uio_segflg = UIO_SYSSPACE;
- uiop->uio_td = td;
- if (bp->b_iocmd == BIO_READ) {
- io.iov_len = uiop->uio_resid = bp->b_bcount;
- io.iov_base = bp->b_data;
- uiop->uio_rw = UIO_READ;
- switch (vp->v_type) {
- case VREG:
- uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE;
- error = ncp_read(NWFSTOCONN(nmp), &np->n_fh, uiop, cr);
- if (error)
- break;
- if (uiop->uio_resid) {
- int left = uiop->uio_resid;
- int nread = bp->b_bcount - left;
- if (left > 0)
- bzero((char *)bp->b_data + nread, left);
- }
- break;
-/* case VDIR:
- nfsstats.readdir_bios++;
- uiop->uio_offset = ((u_quad_t)bp->b_lblkno) * NFS_DIRBLKSIZ;
- if (nmp->nm_flag & NFSMNT_RDIRPLUS) {
- error = nfs_readdirplusrpc(vp, uiop, cr);
- if (error == NFSERR_NOTSUPP)
- nmp->nm_flag &= ~NFSMNT_RDIRPLUS;
- }
- if ((nmp->nm_flag & NFSMNT_RDIRPLUS) == 0)
- error = nfs_readdirrpc(vp, uiop, cr);
- if (error == 0 && uiop->uio_resid == bp->b_bcount)
- bp->b_flags |= B_INVAL;
- break;
-*/
- default:
- printf("nwfs_doio: type %x unexpected\n",vp->v_type);
- break;
- };
- if (error) {
- bp->b_ioflags |= BIO_ERROR;
- bp->b_error = error;
- }
- } else { /* write */
- if (((bp->b_blkno * DEV_BSIZE) + bp->b_dirtyend) > np->n_size)
- bp->b_dirtyend = np->n_size - (bp->b_blkno * DEV_BSIZE);
-
- if (bp->b_dirtyend > bp->b_dirtyoff) {
- io.iov_len = uiop->uio_resid = bp->b_dirtyend - bp->b_dirtyoff;
- uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff;
- io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
- uiop->uio_rw = UIO_WRITE;
- error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, uiop, cr);
-
- /*
- * For an interrupted write, the buffer is still valid
- * and the write hasn't been pushed to the server yet,
- * so we can't set BIO_ERROR and report the interruption
- * by setting B_EINTR. For the B_ASYNC case, B_EINTR
- * is not relevant, so the rpc attempt is essentially
- * a noop. For the case of a V3 write rpc not being
- * committed to stable storage, the block is still
- * dirty and requires either a commit rpc or another
- * write rpc with iomode == NFSV3WRITE_FILESYNC before
- * the block is reused. This is indicated by setting
- * the B_DELWRI and B_NEEDCOMMIT flags.
- */
- if (error == EINTR
- || (!error && (bp->b_flags & B_NEEDCOMMIT))) {
- int s;
-
- s = splbio();
- bp->b_flags &= ~(B_INVAL|B_NOCACHE);
- if ((bp->b_flags & B_ASYNC) == 0)
- bp->b_flags |= B_EINTR;
- if ((bp->b_flags & B_PAGING) == 0) {
- bdirty(bp);
- bp->b_flags &= ~B_DONE;
- }
- if ((bp->b_flags & B_ASYNC) == 0)
- bp->b_flags |= B_EINTR;
- splx(s);
- } else {
- if (error) {
- bp->b_ioflags |= BIO_ERROR;
- bp->b_error /*= np->n_error */= error;
-/* np->n_flag |= NWRITEERR;*/
- }
- bp->b_dirtyoff = bp->b_dirtyend = 0;
- }
- } else {
- bp->b_resid = 0;
- bufdone(bp);
- return (0);
- }
- }
- bp->b_resid = uiop->uio_resid;
- bufdone(bp);
- return (error);
-}
-
-/*
- * Vnode op for VM getpages.
- * Wish wish .... get rid from multiple IO routines
- */
-int
-nwfs_getpages(ap)
- struct vop_getpages_args /* {
- struct vnode *a_vp;
- vm_page_t *a_m;
- int a_count;
- int a_reqpage;
- vm_ooffset_t a_offset;
- } */ *ap;
-{
-#ifndef NWFS_RWCACHE
- return vop_stdgetpages(ap);(ap->a_vp, ap->a_m, ap->a_count,
-#else
- int i, error, nextoff, size, toff, npages, count;
- struct uio uio;
- struct iovec iov;
- vm_offset_t kva;
- struct buf *bp;
- struct vnode *vp;
- struct thread *td;
- struct ucred *cred;
- struct nwmount *nmp;
- struct nwnode *np;
- vm_object_t object;
- vm_page_t *pages;
-
- vp = ap->a_vp;
- td = curthread; /* XXX */
- cred = td->td_ucred; /* XXX */
- np = VTONW(vp);
- nmp = VFSTONWFS(vp->v_mount);
- pages = ap->a_m;
- count = ap->a_count;
-
- if ((object = vp->v_object) == NULL) {
- printf("nwfs_getpages: called with non-merged cache vnode??\n");
- return VM_PAGER_ERROR;
- }
-
- bp = getpbuf(&nwfs_pbuf_freecnt);
- npages = btoc(count);
- kva = (vm_offset_t) bp->b_data;
- pmap_qenter(kva, pages, npages);
-
- iov.iov_base = (caddr_t) kva;
- iov.iov_len = count;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_offset = IDX_TO_OFF(pages[0]->pindex);
- uio.uio_resid = count;
- uio.uio_segflg = UIO_SYSSPACE;
- uio.uio_rw = UIO_READ;
- uio.uio_td = td;
-
- error = ncp_read(NWFSTOCONN(nmp), &np->n_fh, &uio,cred);
- pmap_qremove(kva, npages);
-
- relpbuf(bp, &nwfs_pbuf_freecnt);
-
- VM_OBJECT_LOCK(object);
- if (error && (uio.uio_resid == count)) {
- printf("nwfs_getpages: error %d\n",error);
- for (i = 0; i < npages; i++) {
- if (ap->a_reqpage != i) {
- vm_page_lock(pages[i]);
- vm_page_free(pages[i]);
- vm_page_unlock(pages[i]);
- }
- }
- VM_OBJECT_UNLOCK(object);
- return VM_PAGER_ERROR;
- }
-
- size = count - uio.uio_resid;
-
- for (i = 0, toff = 0; i < npages; i++, toff = nextoff) {
- vm_page_t m;
- nextoff = toff + PAGE_SIZE;
- m = pages[i];
-
- if (nextoff <= size) {
- m->valid = VM_PAGE_BITS_ALL;
- KASSERT(m->dirty == 0,
- ("nwfs_getpages: page %p is dirty", m));
- } else {
- int nvalid = ((size + DEV_BSIZE - 1) - toff) & ~(DEV_BSIZE - 1);
- vm_page_set_valid_range(m, 0, nvalid);
- KASSERT((m->dirty & vm_page_bits(0, nvalid)) == 0,
- ("nwfs_getpages: page %p is dirty", m));
- }
-
- if (i != ap->a_reqpage)
- vm_page_readahead_finish(m);
- }
- VM_OBJECT_UNLOCK(object);
- return 0;
-#endif /* NWFS_RWCACHE */
-}
-
-/*
- * Vnode op for VM putpages.
- * possible bug: all IO done in sync mode
- * Note that vop_close always invalidate pages before close, so it's
- * not necessary to open vnode.
- */
-int
-nwfs_putpages(ap)
- struct vop_putpages_args /* {
- struct vnode *a_vp;
- vm_page_t *a_m;
- int a_count;
- int a_sync;
- int *a_rtvals;
- vm_ooffset_t a_offset;
- } */ *ap;
-{
- int error;
- struct vnode *vp = ap->a_vp;
- struct thread *td;
- struct ucred *cred;
-
-#ifndef NWFS_RWCACHE
- td = curthread; /* XXX */
- cred = td->td_ucred; /* XXX */
- VOP_OPEN(vp, FWRITE, cred, td, NULL);
- error = vop_stdputpages(ap);
- VOP_CLOSE(vp, FWRITE, cred, td);
- return error;
-#else
- struct uio uio;
- struct iovec iov;
- vm_offset_t kva;
- struct buf *bp;
- int i, npages, count;
- int *rtvals;
- struct nwmount *nmp;
- struct nwnode *np;
- vm_page_t *pages;
-
- td = curthread; /* XXX */
- cred = td->td_ucred; /* XXX */
-/* VOP_OPEN(vp, FWRITE, cred, td, NULL);*/
- np = VTONW(vp);
- nmp = VFSTONWFS(vp->v_mount);
- pages = ap->a_m;
- count = ap->a_count;
- rtvals = ap->a_rtvals;
- npages = btoc(count);
-
- for (i = 0; i < npages; i++) {
- rtvals[i] = VM_PAGER_ERROR;
- }
-
- bp = getpbuf(&nwfs_pbuf_freecnt);
- kva = (vm_offset_t) bp->b_data;
- pmap_qenter(kva, pages, npages);
-
- iov.iov_base = (caddr_t) kva;
- iov.iov_len = count;
- uio.uio_iov = &iov;
- uio.uio_iovcnt = 1;
- uio.uio_offset = IDX_TO_OFF(pages[0]->pindex);
- uio.uio_resid = count;
- uio.uio_segflg = UIO_SYSSPACE;
- uio.uio_rw = UIO_WRITE;
- uio.uio_td = td;
- NCPVNDEBUG("ofs=%d,resid=%d\n",(int)uio.uio_offset, uio.uio_resid);
-
- error = ncp_write(NWFSTOCONN(nmp), &np->n_fh, &uio, cred);
-/* VOP_CLOSE(vp, FWRITE, cred, td);*/
- NCPVNDEBUG("paged write done: %d\n", error);
-
- pmap_qremove(kva, npages);
- relpbuf(bp, &nwfs_pbuf_freecnt);
-
- if (!error)
- vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
- return rtvals[0];
-#endif /* NWFS_RWCACHE */
-}
-/*
- * Flush and invalidate all dirty buffers. If another process is already
- * doing the flush, just wait for completion.
- */
-int
-nwfs_vinvalbuf(vp, td)
- struct vnode *vp;
- struct thread *td;
-{
- struct nwnode *np = VTONW(vp);
-/* struct nwmount *nmp = VTONWFS(vp);*/
- int error = 0;
-
- if (vp->v_iflag & VI_DOOMED)
- return (0);
-
- while (np->n_flag & NFLUSHINPROG) {
- np->n_flag |= NFLUSHWANT;
- error = tsleep(&np->n_flag, PRIBIO + 2, "nwfsvinv", 2 * hz);
- error = ncp_chkintr(NWFSTOCONN(VTONWFS(vp)), td);
- if (error == EINTR)
- return EINTR;
- }
- np->n_flag |= NFLUSHINPROG;
-
- if (vp->v_bufobj.bo_object != NULL) {
- VM_OBJECT_LOCK(vp->v_bufobj.bo_object);
- vm_object_page_clean(vp->v_bufobj.bo_object, 0, 0, OBJPC_SYNC);
- VM_OBJECT_UNLOCK(vp->v_bufobj.bo_object);
- }
-
- error = vinvalbuf(vp, V_SAVE, PCATCH, 0);
- while (error) {
- if (error == ERESTART || error == EINTR) {
- np->n_flag &= ~NFLUSHINPROG;
- if (np->n_flag & NFLUSHWANT) {
- np->n_flag &= ~NFLUSHWANT;
- wakeup(&np->n_flag);
- }
- return EINTR;
- }
- error = vinvalbuf(vp, V_SAVE, PCATCH, 0);
- }
- np->n_flag &= ~(NMODIFIED | NFLUSHINPROG);
- if (np->n_flag & NFLUSHWANT) {
- np->n_flag &= ~NFLUSHWANT;
- wakeup(&np->n_flag);
- }
- return (error);
-}
diff --git a/sys/fs/nwfs/nwfs_ioctl.c b/sys/fs/nwfs/nwfs_ioctl.c
deleted file mode 100644
index 35fe93e..0000000
--- a/sys/fs/nwfs/nwfs_ioctl.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mount.h>
-#include <sys/vnode.h>
-#include <sys/ioccom.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_subr.h>
-
-#include <fs/nwfs/nwfs.h>
-#include <fs/nwfs/nwfs_node.h>
-#include <fs/nwfs/nwfs_subr.h>
-
-int
-nwfs_ioctl(ap)
- struct vop_ioctl_args /* {
- struct vnode *a_vp;
- u_long a_command;
- caddr_t a_data;
- int fflag;
- struct ucred *cred;
- struct thread *td;
- } */ *ap;
-{
- int error;
- struct thread *td = ap->a_td;
- struct ucred *cred = ap->a_cred;
- struct vnode *vp = ap->a_vp;
- struct nwnode *np = VTONW(vp);
- struct nwmount *nmp = VTONWFS(vp);
- struct ncp_conn *conn = NWFSTOCONN(nmp);
- struct ncp_handle *hp;
- struct nw_entry_info *fap;
- void *data = ap->a_data;
-
- switch (ap->a_command) {
- case NWFSIOC_GETCONN:
- error = ncp_conn_lock(conn, td, cred, NCPM_READ);
- if (error) break;
- error = ncp_conn_gethandle(conn, td, &hp);
- ncp_conn_unlock(conn, td);
- if (error) break;
- *(int*)data = hp->nh_id;
- break;
- case NWFSIOC_GETEINFO:
- if ((error = VOP_ACCESS(vp, VEXEC, cred, td))) break;
- fap = data;
- error = ncp_obtain_info(nmp, np->n_fid.f_id, 0, NULL, fap,
- ap->a_td,ap->a_cred);
- strcpy(fap->entryName, np->n_name);
- fap->nameLen = np->n_nmlen;
- break;
- case NWFSIOC_GETNS:
- if ((error = VOP_ACCESS(vp, VEXEC, cred, td))) break;
- *(int*)data = nmp->name_space;
- break;
- default:
- error = ENOTTY;
- }
- return (error);
-}
diff --git a/sys/fs/nwfs/nwfs_mount.h b/sys/fs/nwfs/nwfs_mount.h
deleted file mode 100644
index 92c11af..0000000
--- a/sys/fs/nwfs/nwfs_mount.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NWFS_MOUNT_H_
-#define _NWFS_MOUNT_H_
-
-#ifndef _NCP_NCP_NLS_H_
-#include <netncp/ncp_nls.h>
-#endif
-
-#define NWFS_VERMAJ 1
-#define NWFS_VERMIN 3400
-#define NWFS_VERSION (NWFS_VERMAJ*100000 + NWFS_VERMIN)
-
-/* Values for flags */
-#define NWFS_MOUNT_SOFT 0x0001
-#define WNFS_MOUNT_INTR 0x0002
-#define NWFS_MOUNT_STRONG 0x0004
-#define NWFS_MOUNT_NO_OS2 0x0008
-#define NWFS_MOUNT_NO_NFS 0x0010
-#define NWFS_MOUNT_NO_LONG 0x0020
-#define NWFS_MOUNT_GET_SYSENT 0x0040 /* special case, look to vfsops :) */
-#define NWFS_MOUNT_HAVE_NLS 0x0080
-
-#define NWFS_VOLNAME_LEN 48
-
-
-/* Layout of the mount control block for a netware filesystem. */
-struct nwfs_args {
- int connRef; /* connection reference */
- char mount_point[MAXPATHLEN];
- u_int flags;
- u_char mounted_vol[NWFS_VOLNAME_LEN + 1];
- u_char root_path[512+1];
- int version;
- uid_t uid;
- gid_t gid;
- mode_t file_mode;
- mode_t dir_mode;
- struct ncp_nlstables nls;
- int tz;
-};
-
-#endif /* !_NWFS_MOUNT_H_ */
diff --git a/sys/fs/nwfs/nwfs_node.c b/sys/fs/nwfs/nwfs_node.c
deleted file mode 100644
index cf6f6d9..0000000
--- a/sys/fs/nwfs/nwfs_node.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/lock.h>
-#include <sys/malloc.h>
-#include <sys/mount.h>
-#include <sys/mutex.h>
-#include <sys/proc.h>
-#include <sys/queue.h>
-#include <sys/sx.h>
-#include <sys/sysctl.h>
-#include <sys/time.h>
-#include <sys/vnode.h>
-
-#include <vm/vm.h>
-#include <vm/vm_extern.h>
-#include <vm/vm_page.h>
-#include <vm/vm_object.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_subr.h>
-
-#include <fs/nwfs/nwfs.h>
-#include <fs/nwfs/nwfs_mount.h>
-#include <fs/nwfs/nwfs_node.h>
-#include <fs/nwfs/nwfs_subr.h>
-
-#define NWNOHASH(fhsum) (&nwhashtbl[(fhsum.f_id) & nwnodehash])
-
-static LIST_HEAD(nwnode_hash_head,nwnode) *nwhashtbl;
-static u_long nwnodehash;
-static struct sx nwhashlock;
-
-static MALLOC_DEFINE(M_NWNODE, "nwfs_node", "NWFS vnode private part");
-static MALLOC_DEFINE(M_NWFSHASH, "nwfs_hash", "NWFS has table");
-
-static int nwfs_sysctl_vnprint(SYSCTL_HANDLER_ARGS);
-
-SYSCTL_DECL(_vfs_nwfs);
-
-SYSCTL_PROC(_vfs_nwfs, OID_AUTO, vnprint, CTLFLAG_WR|CTLTYPE_OPAQUE,
- NULL, 0, nwfs_sysctl_vnprint, "S,vnlist", "vnode hash");
-
-void
-nwfs_hash_init(void) {
- nwhashtbl = hashinit(desiredvnodes, M_NWFSHASH, &nwnodehash);
- sx_init(&nwhashlock, "nwfshl");
-}
-
-void
-nwfs_hash_free(void) {
- sx_destroy(&nwhashlock);
- free(nwhashtbl, M_NWFSHASH);
-}
-
-int
-nwfs_sysctl_vnprint(SYSCTL_HANDLER_ARGS) {
- struct nwnode *np;
- struct nwnode_hash_head *nhpp;
- struct vnode *vp;
- int i;
-
- if (nwfs_debuglevel == 0)
- return 0;
- printf("Name:uc:hc:fid:pfid\n");
- for(i = 0; i <= nwnodehash; i++) {
- nhpp = &nwhashtbl[i];
- LIST_FOREACH(np, nhpp, n_hash) {
- vp = NWTOV(np);
- vprint("", vp);
- printf("%s:%d:%d:%d:%d\n",np->n_name,vrefcnt(vp),
- vp->v_holdcnt,np->n_fid.f_id, np->n_fid.f_parent);
- }
- }
- return 0;
-}
-
-/*
- * Search nwnode with given fid.
- * Hash list should be locked by caller.
- */
-static int
-nwfs_hashlookup(struct nwmount *nmp, ncpfid fid, struct nwnode **npp)
-{
- struct nwnode *np;
- struct nwnode_hash_head *nhpp;
-
- sx_assert(&nwhashlock, SA_XLOCKED);
-
- nhpp = NWNOHASH(fid);
- LIST_FOREACH(np, nhpp, n_hash) {
- if (nmp != np->n_mount || !NWCMPF(&fid, &np->n_fid))
- continue;
- if (npp)
- *npp = np;
- return 0;
- }
- return ENOENT;
-}
-
-/*
- * Allocate new nwfsnode/vnode from given nwnode.
- * Vnode referenced and not locked.
- */
-static int
-nwfs_allocvp(struct mount *mp, ncpfid fid, struct nw_entry_info *fap,
- struct vnode *dvp, struct vnode **vpp)
-{
- struct nwnode *np;
- struct nwnode_hash_head *nhpp;
- struct nwmount *nmp = VFSTONWFS(mp);
- struct vnode *vp;
- int error;
-
-loop:
- sx_xlock(&nwhashlock);
-rescan:
- if (nwfs_hashlookup(nmp, fid, &np) == 0) {
- vp = NWTOV(np);
- VI_LOCK(vp);
- sx_xunlock(&nwhashlock);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, curthread))
- goto loop;
- if (fap)
- np->n_attr = fap->attributes;
- *vpp = vp;
- return(0);
- }
- sx_xunlock(&nwhashlock);
-
- if (fap == NULL || ((fap->attributes & aDIR) == 0 && dvp == NULL))
- panic("nwfs_allocvp: fap = %p, dvp = %p\n", fap, dvp);
- /*
- * Do the MALLOC before the getnewvnode since doing so afterward
- * might cause a bogus v_data pointer to get dereferenced
- * elsewhere if MALLOC should block.
- */
- np = malloc(sizeof *np, M_NWNODE, M_WAITOK | M_ZERO);
- error = getnewvnode("nwfs", mp, &nwfs_vnodeops, &vp);
- if (error) {
- *vpp = NULL;
- free(np, M_NWNODE);
- return (error);
- }
- error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */
- if (error != 0) {
- free(np, M_NWNODE);
- *vpp = NULL;
- return (error);
- }
- vp->v_data = np;
- np->n_vnode = vp;
- np->n_mount = nmp;
- np->n_attr = fap->attributes;
- vp->v_type = np->n_attr & aDIR ? VDIR : VREG;
- np->n_fid = fid;
- if (dvp) {
- np->n_parent = VTONW(dvp)->n_fid;
- }
- sx_xlock(&nwhashlock);
- /*
- * Another process can create vnode while we blocked in malloc() or
- * getnewvnode(). Rescan list again.
- */
- if (nwfs_hashlookup(nmp, fid, NULL) == 0) {
- vp->v_data = NULL;
- np->n_vnode = NULL;
- vrele(vp);
- free(np, M_NWNODE);
- goto rescan;
- }
- *vpp = vp;
- nhpp = NWNOHASH(fid);
- LIST_INSERT_HEAD(nhpp, np, n_hash);
- vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
- VN_LOCK_AREC(vp);
- sx_xunlock(&nwhashlock);
-
- ASSERT_VOP_LOCKED(dvp, "nwfs_allocvp");
- if (vp->v_type == VDIR && dvp && (dvp->v_vflag & VV_ROOT) == 0) {
- np->n_flag |= NREFPARENT;
- vref(dvp);
- }
- return 0;
-}
-
-int
-nwfs_nget(struct mount *mp, ncpfid fid, struct nw_entry_info *fap,
- struct vnode *dvp, struct vnode **vpp)
-{
- struct vnode *vp;
- int error;
-
- *vpp = NULL;
- error = nwfs_allocvp(mp, fid, fap, dvp, &vp);
- if (error)
- return error;
- if (fap)
- nwfs_attr_cacheenter(vp, fap);
- *vpp = vp;
- return 0;
-}
-
-int
-nwfs_lookupnp(struct nwmount *nmp, ncpfid fid, struct thread *td,
- struct nwnode **npp)
-{
- int error;
-
- sx_xlock(&nwhashlock);
- error = nwfs_hashlookup(nmp, fid, npp);
- sx_xunlock(&nwhashlock);
- return error;
-}
-
-/*
- * Free nwnode, and give vnode back to system
- */
-int
-nwfs_reclaim(ap)
- struct vop_reclaim_args /* {
- struct vnode *a_vp;
- struct thread *a_td;
- } */ *ap;
-{
- struct vnode *dvp = NULL, *vp = ap->a_vp;
- struct nwnode *dnp, *np = VTONW(vp);
- struct nwmount *nmp = VTONWFS(vp);
- struct thread *td = ap->a_td;
-
- NCPVNDEBUG("%s,%d\n", np->n_name, vrefcnt(vp));
- /*
- * Destroy the vm object and flush associated pages.
- */
- vnode_destroy_vobject(vp);
-
- if (np->n_flag & NREFPARENT) {
- np->n_flag &= ~NREFPARENT;
- if (nwfs_lookupnp(nmp, np->n_parent, td, &dnp) == 0) {
- dvp = dnp->n_vnode;
- } else {
- NCPVNDEBUG("%s: has no parent ?\n",np->n_name);
- }
- }
- sx_xlock(&nwhashlock);
- LIST_REMOVE(np, n_hash);
- sx_xunlock(&nwhashlock);
- if (nmp->n_root == np) {
- nmp->n_root = NULL;
- }
- vp->v_data = NULL;
- free(np, M_NWNODE);
- if (dvp) {
- vrele(dvp);
- }
- return (0);
-}
-
-int
-nwfs_inactive(ap)
- struct vop_inactive_args /* {
- struct vnode *a_vp;
- struct thread *a_td;
- } */ *ap;
-{
- struct thread *td = ap->a_td;
- struct ucred *cred = td->td_ucred;
- struct vnode *vp = ap->a_vp;
- struct nwnode *np = VTONW(vp);
- int error;
-
- NCPVNDEBUG("%s: %d\n", VTONW(vp)->n_name, vrefcnt(vp));
- if (np->opened) {
- error = nwfs_vinvalbuf(vp, td);
- error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh, td, cred);
- np->opened = 0;
- }
- if (np->n_flag & NSHOULDFREE) {
- cache_purge(vp);
- vgone(vp);
- }
- return (0);
-}
-/*
- * routines to maintain vnode attributes cache
- * nwfs_attr_cacheenter: unpack np.i to va structure
- */
-void
-nwfs_attr_cacheenter(struct vnode *vp, struct nw_entry_info *fi)
-{
- struct nwnode *np = VTONW(vp);
- struct nwmount *nmp = VTONWFS(vp);
- struct vattr *va = &np->n_vattr;
-
- va->va_type = vp->v_type; /* vnode type (for create) */
- np->n_nmlen = fi->nameLen;
- bcopy(fi->entryName, np->n_name, np->n_nmlen);
- np->n_name[fi->nameLen] = 0;
- if (vp->v_type == VREG) {
- if (va->va_size != fi->dataStreamSize) {
- va->va_size = fi->dataStreamSize;
- vnode_pager_setsize(vp, va->va_size);
- }
- va->va_mode = nmp->m.file_mode; /* files access mode and type */
- } else if (vp->v_type == VDIR) {
- va->va_size = 16384; /* should be a better way ... */
- va->va_mode = nmp->m.dir_mode; /* files access mode and type */
- } else
- return;
- np->n_size = va->va_size;
- va->va_nlink = 1; /* number of references to file */
- va->va_uid = nmp->m.uid; /* owner user id */
- va->va_gid = nmp->m.gid; /* owner group id */
- va->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0];
- va->va_fileid = np->n_fid.f_id; /* file id */
- if (va->va_fileid == 0)
- va->va_fileid = NWFS_ROOT_INO;
- va->va_blocksize=nmp->connh->nh_conn->buffer_size;/* blocksize preferred for i/o */
- /* time of last modification */
- ncp_dos2unixtime(fi->modifyDate, fi->modifyTime, 0, nmp->m.tz, &va->va_mtime);
- /* time of last access */
- ncp_dos2unixtime(fi->lastAccessDate, 0, 0, nmp->m.tz, &va->va_atime);
- va->va_ctime = va->va_mtime; /* time file changed */
- va->va_gen = VNOVAL; /* generation number of file */
- va->va_flags = 0; /* flags defined for file */
- va->va_rdev = VNOVAL; /* device the special file represents */
- va->va_bytes = va->va_size; /* bytes of disk space held by file */
- va->va_filerev = 0; /* file modification number */
- va->va_vaflags = 0; /* operations flags */
- np->n_vattr = *va;
- if (np->n_mtime == 0) {
- np->n_mtime = va->va_mtime.tv_sec;
- }
- np->n_atime = time_second;
- np->n_dosfid = fi->DosDirNum;
- return;
-}
-
-int
-nwfs_attr_cachelookup(struct vnode *vp, struct vattr *va)
-{
- struct nwnode *np = VTONW(vp);
- int diff;
-
- diff = time_second - np->n_atime;
- if (diff > 2) { /* XXX should be configurable */
- return ENOENT;
- }
- *va = np->n_vattr;
- return 0;
-}
diff --git a/sys/fs/nwfs/nwfs_node.h b/sys/fs/nwfs/nwfs_node.h
deleted file mode 100644
index 89545eb..0000000
--- a/sys/fs/nwfs/nwfs_node.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NWFS_NODE_H_
-#define _NWFS_NODE_H_
-
-#define NWFS_ROOT_INO 0x7ffffffd
-
-/* Bits for nwnode.n_flag */
-#define NFLUSHINPROG 0x0001
-#define NFLUSHWANT 0x0002 /* they should gone ... */
-#define NMODIFIED 0x0004 /* bogus, until async IO implemented */
-#define NREFPARENT 0x0008 /* vnode holds reference to a parent vnode */
-#define NVOLUME 0x0010 /* vnode references a volume */
-#define NSHOULDFREE 0x0020 /* vnode should be removed from hash */
-
-struct nwnode {
- LIST_ENTRY(nwnode) n_hash;
- struct vnode *n_vnode;
- struct vattr n_vattr;
- struct nwmount *n_mount;
- time_t n_atime; /* attributes cache time*/
- time_t n_ctime;
- time_t n_mtime;
- int n_flag;
- ncpfid n_parent;
- ncpfid n_fid;
- u_long n_attr; /* LH */
- u_long n_size;
- u_long n_dosfid;
- int opened;
-/* int access;*/
- u_long n_origfh;
- ncp_fh n_fh;
- struct nw_search_seq n_seq;
- u_char n_nmlen;
- u_char n_name[256];
-};
-
-#define VTONW(vp) ((struct nwnode *)(vp)->v_data)
-#define NWTOV(np) ((struct vnode *)(np)->n_vnode)
-#define NWCMPF(f1,f2) ((f1)->f_parent == (f2)->f_parent && \
- (f1)->f_id == (f2)->f_id)
-#define NWCMPN(np1,np2) NWCMPF(&(np1)->n_fid, &(np2)->n_fid)
-#define NWCMPV(vp1,vp2) NWCMPN(VTONW(vp1),VTONW(vp2))
-
-struct vop_getpages_args;
-struct vop_inactive_args;
-struct vop_putpages_args;
-struct vop_reclaim_args;
-struct ucred;
-struct uio;
-
-void nwfs_hash_init(void);
-void nwfs_hash_free(void);
-int nwfs_lookupnp(struct nwmount *nmp, ncpfid fid, struct thread *td,
- struct nwnode **npp);
-int nwfs_inactive(struct vop_inactive_args *);
-int nwfs_reclaim(struct vop_reclaim_args *);
-int nwfs_nget(struct mount *mp, ncpfid fid, struct nw_entry_info *fap,
- struct vnode *dvp, struct vnode **vpp);
-
-int nwfs_getpages(struct vop_getpages_args *);
-int nwfs_putpages(struct vop_putpages_args *);
-int nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred);
-int nwfs_writevnode(struct vnode *vp, struct uio *uiop, struct ucred *cred, int ioflag);
-void nwfs_attr_cacheenter(struct vnode *vp, struct nw_entry_info *fi);
-int nwfs_attr_cachelookup(struct vnode *vp,struct vattr *va);
-
-#define nwfs_attr_cacheremove(vp) VTONW(vp)->n_atime = 0
-
-#endif /* _NWFS_NODE_H_ */
diff --git a/sys/fs/nwfs/nwfs_subr.c b/sys/fs/nwfs/nwfs_subr.c
deleted file mode 100644
index cb85450..0000000
--- a/sys/fs/nwfs/nwfs_subr.c
+++ /dev/null
@@ -1,553 +0,0 @@
-/*-
- * Copyright (c) 1999, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/lock.h>
-#include <sys/lockmgr.h>
-#include <sys/malloc.h>
-#include <sys/clock.h>
-#include <sys/time.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_ncp.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_rq.h>
-#include <netncp/nwerror.h>
-
-#include <fs/nwfs/nwfs.h>
-#include <fs/nwfs/nwfs_node.h>
-#include <fs/nwfs/nwfs_subr.h>
-
-#define NCP_INFOSZ (sizeof(struct nw_entry_info) - 257)
-
-MALLOC_DEFINE(M_NWFSDATA, "nwfs_data", "NWFS private data");
-
-static int
-ncp_extract_file_info(struct nwmount *nmp, struct ncp_rq *rqp,
- struct nw_entry_info *target, int withname)
-{
- u_int8_t name_len;
-
- md_get_mem(&rqp->rp, (caddr_t)target, NCP_INFOSZ, MB_MSYSTEM);
- if (!withname)
- return 0;
- md_get_uint8(&rqp->rp, &name_len);
- target->nameLen = name_len;
- md_get_mem(&rqp->rp, (caddr_t)target->entryName, name_len, MB_MSYSTEM);
- target->entryName[name_len] = '\0';
- ncp_path2unix(target->entryName, target->entryName, name_len, &nmp->m.nls);
- return 0;
-}
-
-int
-ncp_initsearch(struct vnode *dvp, struct thread *td, struct ucred *cred)
-{
- struct nwmount *nmp = VTONWFS(dvp);
- struct ncp_conn *conn = NWFSTOCONN(nmp);
- struct nwnode *np = VTONW(dvp);
- struct ncp_rq *rqp;
- u_int8_t volnum = nmp->n_volume;
- u_int32_t dirent = np->n_fid.f_id;
- int error;
-
- NCPNDEBUG("vol=%d,dir=%d\n", volnum, dirent);
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 2); /* subfunction */
- mb_put_uint8(&rqp->rq, nmp->name_space);
- mb_put_uint8(&rqp->rq, 0); /* reserved */
- ncp_rq_dbase_path(rqp, volnum, dirent, 0, NULL, NULL);
- rqp->nr_minrplen = sizeof(np->n_seq);
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_mem(&rqp->rp, (caddr_t)&np->n_seq, sizeof(np->n_seq), MB_MSYSTEM);
- ncp_rq_done(rqp);
- return 0;
-}
-
-int
-ncp_search_for_file_or_subdir(struct nwmount *nmp,
- struct nw_search_seq *seq,
- struct nw_entry_info *target,
- struct thread *td,struct ucred *cred)
-{
- struct ncp_conn *conn = NWFSTOCONN(nmp);
- struct ncp_rq *rqp;
- int error;
-
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 3); /* subfunction */
- mb_put_uint8(&rqp->rq, nmp->name_space);
- mb_put_uint8(&rqp->rq, 0); /* data stream */
- mb_put_uint16le(&rqp->rq, 0xffff); /* Search attribs */
- mb_put_uint32le(&rqp->rq, IM_ALL); /* return info mask */
- mb_put_mem(&rqp->rq, (caddr_t)seq, 9, MB_MSYSTEM);
- mb_put_uint8(&rqp->rq, 2); /* 2 byte pattern */
- mb_put_uint8(&rqp->rq, 0xff); /* following is a wildcard */
- mb_put_uint8(&rqp->rq, '*');
- rqp->nr_minrplen = sizeof(*seq) + 1 + NCP_INFOSZ + 1;
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_mem(&rqp->rp, (caddr_t)seq, sizeof(*seq), MB_MSYSTEM);
- md_get_uint8(&rqp->rp, NULL); /* skip */
- error = ncp_extract_file_info(nmp, rqp, target, 1);
- ncp_rq_done(rqp);
- return error;
-}
-
-/*
- * Returns information for a (one-component) name relative to the specified
- * directory.
- */
-int
-ncp_obtain_info(struct nwmount *nmp, u_int32_t dirent,
- int namelen, char *path, struct nw_entry_info *target,
- struct thread *td,struct ucred *cred)
-{
- struct ncp_conn *conn=NWFSTOCONN(nmp);
- struct ncp_rq *rqp;
- int error;
- u_char volnum = nmp->n_volume, ns;
-
- if (target == NULL) {
- NCPFATAL("target == NULL\n");
- return EINVAL;
- }
- ns = (path == NULL || path[0] == 0) ? NW_NS_DOS : nmp->name_space;
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 6); /* subfunction */
- mb_put_uint8(&rqp->rq, ns);
- mb_put_uint8(&rqp->rq, ns); /* DestNameSpace */
- mb_put_uint16le(&rqp->rq, 0xff); /* get all */
- mb_put_uint32le(&rqp->rq, IM_ALL);
- ncp_rq_dbase_path(rqp, volnum, dirent, namelen, path, &nmp->m.nls);
- error = ncp_request(rqp);
- if (error)
- return error;
- error = ncp_extract_file_info(nmp, rqp, target, path != NULL);
- ncp_rq_done(rqp);
- return error;
-}
-/*
- * lookup name pointed by cnp in directory dvp and return file info in np.
- * May be I should create a little cache, but another way is to minimize
- * number of calls, on other hand, in multiprocess environment ...
- */
-int
-ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap,
- struct thread *td,struct ucred *cred)
-{
- struct nwmount *nmp;
- struct nwnode *dnp;
- int error;
-
- if (!dvp || dvp->v_type != VDIR) {
- nwfs_printf("dvp is NULL or not a directory.\n");
- return (ENOENT);
- }
- dnp = VTONW(dvp);
- nmp = VTONWFS(dvp);
-
- if (len == 1 && name[0] == '.') {
- if (dnp->n_flag & NVOLUME) {
- error = ncp_obtain_info(nmp, dnp->n_fid.f_id, 0, NULL,
- fap, td, cred);
- } else {
- error = ncp_obtain_info(nmp, dnp->n_fid.f_parent,
- dnp->n_nmlen, dnp->n_name, fap, td, cred);
- }
- return error;
- } else if (len == 2 && name[0] == '.' && name[1] == '.') {
- printf("%s: knows NOTHING about '..'\n", __func__);
- return EIO;
- } else {
- error = ncp_obtain_info(nmp, dnp->n_fid.f_id,
- len, name, fap, td, cred);
- }
- return error;
-}
-
-static void ConvertToNWfromDWORD(u_int32_t sfd, ncp_fh *fh);
-static void
-ConvertToNWfromDWORD(u_int32_t sfd, ncp_fh *fh) {
- fh->val1 = (fh->val.val32 = sfd);
- return;
-}
-
-/*
- * If both dir and name are NULL, then in target there's already a looked-up
- * entry that wants to be opened.
- */
-int
-ncp_open_create_file_or_subdir(struct nwmount *nmp,struct vnode *dvp,int namelen,
- char *name, int open_create_mode, u_int32_t create_attributes,
- int desired_acc_rights, struct ncp_open_info *nop,
- struct thread *td,struct ucred *cred)
-{
-
- struct ncp_conn *conn=NWFSTOCONN(nmp);
- struct ncp_rq *rqp;
- u_int16_t search_attribs = SA_ALL & (~SA_SUBDIR_FILES);
- u_int8_t volnum;
- u_int32_t dirent;
- int error;
-
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- volnum = nmp->n_volume;
- dirent = VTONW(dvp)->n_fid.f_id;
- if ((create_attributes & aDIR) != 0) {
- search_attribs |= SA_SUBDIR_FILES;
- }
- mb_put_uint8(&rqp->rq, 1);/* subfunction */
- mb_put_uint8(&rqp->rq, nmp->name_space);
- mb_put_uint8(&rqp->rq, open_create_mode);
- mb_put_uint16le(&rqp->rq, search_attribs);
- mb_put_uint32le(&rqp->rq, IM_ALL);
- mb_put_uint32le(&rqp->rq, create_attributes);
- /*
- * The desired acc rights seem to be the inherited rights mask for
- * directories
- */
- mb_put_uint16le(&rqp->rq, desired_acc_rights);
- ncp_rq_dbase_path(rqp, volnum, dirent, namelen, name, &nmp->m.nls);
- error = ncp_request(rqp);
- if (error) {
- if (error == NWE_FILE_NO_CREATE_PRIV)
- error = EACCES;
- return error;
- }
- md_get_uint32le(&rqp->rp, &nop->origfh);
- md_get_uint8(&rqp->rp, &nop->action);
- md_get_uint8(&rqp->rp, NULL); /* skip */
- error = ncp_extract_file_info(nmp, rqp, &nop->fattr, 1);
- ncp_rq_done(rqp);
- ConvertToNWfromDWORD(nop->origfh, &nop->fh);
- return error;
-}
-
-int
-ncp_close_file(struct ncp_conn *conn, ncp_fh *fh,struct thread *td,struct ucred *cred)
-{
- struct ncp_rq *rqp;
- int error;
-
- error = ncp_rq_alloc(66, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 0);
- mb_put_mem(&rqp->rq, (caddr_t)fh, 6, MB_MSYSTEM);
- error = ncp_request(rqp);
- if (error)
- return error;
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_DeleteNSEntry(struct nwmount *nmp, u_int32_t dirent,
- int namelen,char *name,struct thread *td,struct ucred *cred)
-{
- struct ncp_rq *rqp;
- int error;
- struct ncp_conn *conn=NWFSTOCONN(nmp);
-
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 8); /* subfunction */
- mb_put_uint8(&rqp->rq, nmp->name_space);
- mb_put_uint8(&rqp->rq, 0); /* reserved */
- mb_put_uint16le(&rqp->rq, SA_ALL); /* search attribs: all */
- ncp_rq_dbase_path(rqp, nmp->n_volume, dirent, namelen, name, &nmp->m.nls);
- error = ncp_request(rqp);
- if (!error)
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_nsrename(struct ncp_conn *conn, int volume, int ns, int oldtype,
- struct ncp_nlstables *nt,
- nwdirent fdir, char *old_name, int oldlen,
- nwdirent tdir, char *new_name, int newlen,
- struct thread *td, struct ucred *cred)
-{
- struct ncp_rq *rqp;
- int error;
-
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 4);
- mb_put_uint8(&rqp->rq, ns);
- mb_put_uint8(&rqp->rq, 1); /* RRenameToMySelf */
- mb_put_uint16le(&rqp->rq, oldtype);
- /* source Handle Path */
- mb_put_uint8(&rqp->rq, volume);
- mb_put_mem(&rqp->rq, (c_caddr_t)&fdir, sizeof(fdir), MB_MSYSTEM);
- mb_put_uint8(&rqp->rq, 1);
- mb_put_uint8(&rqp->rq, 1); /* 1 source component */
- /* dest Handle Path */
- mb_put_uint8(&rqp->rq, volume);
- mb_put_mem(&rqp->rq, (c_caddr_t)&tdir, sizeof(tdir), MB_MSYSTEM);
- mb_put_uint8(&rqp->rq, 1);
- mb_put_uint8(&rqp->rq, 1); /* 1 destination component */
- ncp_rq_pathstring(rqp, oldlen, old_name, nt);
- ncp_rq_pathstring(rqp, newlen, new_name, nt);
- error = ncp_request(rqp);
- if (!error)
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_modify_file_or_subdir_dos_info(struct nwmount *nmp, struct vnode *vp,
- u_int32_t info_mask,
- struct nw_modify_dos_info *info,
- struct thread *td,struct ucred *cred)
-{
- struct nwnode *np=VTONW(vp);
- struct ncp_rq *rqp;
- u_int8_t volnum = nmp->n_volume;
- u_int32_t dirent = np->n_fid.f_id;
- struct ncp_conn *conn=NWFSTOCONN(nmp);
- int error;
-
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 7); /* subfunction */
- mb_put_uint8(&rqp->rq, nmp->name_space);
- mb_put_uint8(&rqp->rq, 0); /* reserved */
- mb_put_uint16le(&rqp->rq, SA_ALL); /* search attribs: all */
- mb_put_uint32le(&rqp->rq, info_mask);
- mb_put_mem(&rqp->rq, (caddr_t)info, sizeof(*info), MB_MSYSTEM);
- ncp_rq_dbase_path(rqp, volnum, dirent, 0, NULL, NULL);
- error = ncp_request(rqp);
- if (!error)
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_setattr(vp, vap, cred, td)
- struct vnode *vp;
- struct vattr *vap;
- struct ucred *cred;
- struct thread *td;
-{
- struct nwmount *nmp=VTONWFS(vp);
- struct nwnode *np=VTONW(vp);
- struct ncp_open_info nwn;
- struct ncp_conn *conn=NWFSTOCONN(nmp);
- struct nw_modify_dos_info info;
- struct ncp_rq *rqp;
- int error = 0, info_mask;
-
- if (vap->va_size != VNOVAL) {
- error = ncp_open_create_file_or_subdir(nmp, vp, 0, NULL, OC_MODE_OPEN, 0,
- AR_WRITE | AR_READ, &nwn,td,cred);
- if (error)
- return error;
- error = ncp_rq_alloc(73, conn, td, cred, &rqp);
- if (error) {
- ncp_close_file(conn, &nwn.fh, td, cred);
- return error;
- }
- mb_put_uint8(&rqp->rq, 0);
- mb_put_mem(&rqp->rq, (caddr_t)&nwn.fh, 6, MB_MSYSTEM);
- mb_put_uint32be(&rqp->rq, vap->va_size);
- mb_put_uint16be(&rqp->rq, 0);
- error = ncp_request(rqp);
- np->n_vattr.va_size = np->n_size = vap->va_size;
- if (!error)
- ncp_rq_done(rqp);
- ncp_close_file(conn, &nwn.fh, td, cred);
- if (error)
- return error;
- }
- info_mask = 0;
- bzero(&info, sizeof(info));
-
- if (vap->va_mtime.tv_sec != VNOVAL) {
- info_mask |= (DM_MODIFY_TIME | DM_MODIFY_DATE);
- ncp_unix2dostime(&vap->va_mtime, nmp->m.tz, &info.modifyDate, &info.modifyTime, NULL);
- }
- if (vap->va_atime.tv_sec != VNOVAL) {
- info_mask |= (DM_LAST_ACCESS_DATE);
- ncp_unix2dostime(&vap->va_atime, nmp->m.tz, &info.lastAccessDate, NULL, NULL);
- }
- if (info_mask) {
- error = ncp_modify_file_or_subdir_dos_info(nmp, vp, info_mask, &info,td,cred);
- }
- return (error);
-}
-
-int
-ncp_get_volume_info_with_number(struct ncp_conn *conn,
- int n, struct ncp_volume_info *target,
- struct thread *td,struct ucred *cred)
-{
- struct ncp_rq *rqp;
- u_int32_t tmp32;
- u_int8_t len;
- int error;
-
- error = ncp_rq_alloc_subfn(22, 44, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq,n);
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_uint32le(&rqp->rp, &target->total_blocks);
- md_get_uint32le(&rqp->rp, &target->free_blocks);
- md_get_uint32le(&rqp->rp, &target->purgeable_blocks);
- md_get_uint32le(&rqp->rp, &target->not_yet_purgeable_blocks);
- md_get_uint32le(&rqp->rp, &target->total_dir_entries);
- md_get_uint32le(&rqp->rp, &target->available_dir_entries);
- md_get_uint32le(&rqp->rp, &tmp32);
- md_get_uint8(&rqp->rp, &target->sectors_per_block);
- bzero(&target->volume_name, sizeof(target->volume_name));
- md_get_uint8(&rqp->rp, &len);
- if (len > NCP_VOLNAME_LEN) {
- error = ENAMETOOLONG;
- } else {
- md_get_mem(&rqp->rp, (caddr_t)&target->volume_name, len, MB_MSYSTEM);
- }
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_get_namespaces(struct ncp_conn *conn, u_int32_t volume, int *nsf,
- struct thread *td,struct ucred *cred)
-{
- struct ncp_rq *rqp;
- int error;
- u_int8_t ns;
- u_int16_t nscnt;
-
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 24); /* Subfunction: Get Loaded Name Spaces */
- mb_put_uint16le(&rqp->rq, 0); /* reserved */
- mb_put_uint8(&rqp->rq, volume);
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_uint16le(&rqp->rp, &nscnt);
- *nsf = 0;
- while (nscnt-- > 0) {
- md_get_uint8(&rqp->rp, &ns);
- *nsf |= 1 << ns;
- }
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_lookup_volume(struct ncp_conn *conn, char *volname,
- u_char *volNum, u_int32_t *dirEnt,
- struct thread *td,struct ucred *cred)
-{
- struct ncp_rq *rqp;
- u_int32_t tmp32;
- int error;
-
- NCPNDEBUG("looking up vol %s\n", volname);
- error = ncp_rq_alloc(87, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint8(&rqp->rq, 22); /* Subfunction: Generate dir handle */
- mb_put_uint8(&rqp->rq, 0); /* src name space */
- mb_put_uint8(&rqp->rq, 0); /* dst name space, always zero */
- mb_put_uint16le(&rqp->rq, 0); /* dstNSIndicator (Jn) */
-
- mb_put_uint8(&rqp->rq, 0); /* faked volume number */
- mb_put_uint32be(&rqp->rq, 0); /* faked dir_base */
- mb_put_uint8(&rqp->rq, 0xff); /* Don't have a dir_base */
- mb_put_uint8(&rqp->rq, 1); /* 1 path component */
- ncp_rq_pstring(rqp, volname);
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_uint32le(&rqp->rp, &tmp32);
- md_get_uint32le(&rqp->rp, dirEnt);
- md_get_uint8(&rqp->rp, volNum);
- ncp_rq_done(rqp);
- return error;
-}
-
-/*
- * XXX: I think the timezone in struct nwfs_args is truly bogus, especially
- * XXX: considering that nwfs_mount(8) picks this up from the kernel in
- * XXX: the first place. Since I can't test this, I won't attempt to fix it.
- * XXX: /phk
- */
-
-void
-ncp_unix2dostime(tsp, tzoff, ddp, dtp, dhp)
- struct timespec *tsp;
- int tzoff;
- u_int16_t *ddp;
- u_int16_t *dtp;
- u_int8_t *dhp;
-{
- struct timespec t;
-
- t = *tsp;
-
- t.tv_sec = - tzoff * 60 - utc_offset();
- timespec2fattime(&t, 1, ddp, dtp, dhp);
-}
-
-void
-ncp_dos2unixtime(dd, dt, dh, tzoff, tsp)
- u_int dd;
- u_int dt;
- u_int dh;
- int tzoff;
- struct timespec *tsp;
-{
-
- fattime2timespec(dd, dt, dh, 1, tsp);
- tsp->tv_sec += tzoff * 60 + utc_offset();
-}
diff --git a/sys/fs/nwfs/nwfs_subr.h b/sys/fs/nwfs/nwfs_subr.h
deleted file mode 100644
index e571349..0000000
--- a/sys/fs/nwfs/nwfs_subr.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NWFS_SUBR_H_
-#define _NWFS_SUBR_H_
-
-extern int nwfs_debuglevel;
-
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_NWFSDATA);
-#endif
-
-struct ncp_conn;
-struct ncp_nlstables;
-struct ncp_open_info;
-struct nw_entry_info;
-struct nw_search_info;
-struct nwmount;
-struct thread;
-struct timespec;
-struct ucred;
-struct vattr;
-struct vnode;
-
-int ncp_initsearch(struct vnode *dvp,struct thread *td, struct ucred *cred);
-int ncp_search_for_file_or_subdir(struct nwmount *nmp,struct nw_search_seq *seq,
- struct nw_entry_info *target,
- struct thread *td, struct ucred *cred);
-int ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap,
- struct thread *td, struct ucred *cred);
-int ncp_lookup_volume(struct ncp_conn *conn, char *volname,
- u_char *volNum, u_int32_t *dirEnt,
- struct thread *td, struct ucred *cred);
-int ncp_close_file(struct ncp_conn *conn, ncp_fh *fh,
- struct thread *td, struct ucred *cred);
-int ncp_open_create_file_or_subdir(struct nwmount *nmp,struct vnode *dvp, int namelen,char *name,
- int open_create_mode, u_int32_t create_attributes,
- int desired_acc_rights, struct ncp_open_info *nop,
- struct thread *td, struct ucred *cred);
-int ncp_DeleteNSEntry(struct nwmount *nmp,
- u_int32_t dirent, int namelen, char *name,
- struct thread *td, struct ucred *cred);
-int ncp_nsrename(struct ncp_conn *conn, int volume, int ns, int oldtype,
- struct ncp_nlstables *nt,
- nwdirent fdir, char *old_name, int oldlen,
- nwdirent tdir, char *new_name, int newlen,
- struct thread *td, struct ucred *cred);
-int ncp_obtain_info(struct nwmount *nmp, u_int32_t dirent,
- int namelen, char *path, struct nw_entry_info *target,
- struct thread *td, struct ucred *cred);
-int ncp_modify_file_or_subdir_dos_info(struct nwmount *nmp, struct vnode *vp,
- u_int32_t info_mask,
- struct nw_modify_dos_info *info,
- struct thread *td, struct ucred *cred);
-int ncp_setattr(struct vnode *,struct vattr *,struct ucred *,struct thread *td);
-int ncp_get_namespaces(struct ncp_conn *conn, u_int32_t volume, int *nsf,
- struct thread *td, struct ucred *cred);
-int ncp_get_volume_info_with_number(struct ncp_conn *conn,
- int n, struct ncp_volume_info *target,
- struct thread *td, struct ucred *cred);
-
-void ncp_unix2dostime (struct timespec *tsp, int tz, u_int16_t *ddp,
- u_int16_t *dtp, u_int8_t *dhp);
-void ncp_dos2unixtime (u_int dd, u_int dt, u_int dh, int tz, struct timespec *tsp);
-
-#endif /* !_NWFS_SUBR_H_ */
diff --git a/sys/fs/nwfs/nwfs_vfsops.c b/sys/fs/nwfs/nwfs_vfsops.c
deleted file mode 100644
index f319fb5..0000000
--- a/sys/fs/nwfs/nwfs_vfsops.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/vnode.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/malloc.h>
-#include <sys/bio.h>
-#include <sys/buf.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_ncp.h>
-#include <netncp/ncp_nls.h>
-
-#include <fs/nwfs/nwfs.h>
-#include <fs/nwfs/nwfs_node.h>
-#include <fs/nwfs/nwfs_subr.h>
-
-int nwfs_debuglevel = 0;
-
-static int nwfs_version = NWFS_VERSION;
-
-SYSCTL_DECL(_vfs_nwfs);
-SYSCTL_NODE(_vfs, OID_AUTO, nwfs, CTLFLAG_RW, 0, "Netware filesystem");
-SYSCTL_INT(_vfs_nwfs, OID_AUTO, version, CTLFLAG_RD, &nwfs_version, 0, "");
-SYSCTL_INT(_vfs_nwfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nwfs_debuglevel, 0, "");
-
-MODULE_DEPEND(nwfs, ncp, 1, 1, 1);
-MODULE_DEPEND(nwfs, libmchain, 1, 1, 1);
-
-static vfs_cmount_t nwfs_cmount;
-static vfs_mount_t nwfs_mount;
-static vfs_quotactl_t nwfs_quotactl;
-static vfs_root_t nwfs_root;
-static vfs_statfs_t nwfs_statfs;
-static vfs_unmount_t nwfs_unmount;
-static vfs_init_t nwfs_init;
-static vfs_uninit_t nwfs_uninit;
-
-static struct vfsops nwfs_vfsops = {
- .vfs_init = nwfs_init,
- .vfs_mount = nwfs_mount,
- .vfs_cmount = nwfs_cmount,
- .vfs_quotactl = nwfs_quotactl,
- .vfs_root = nwfs_root,
- .vfs_statfs = nwfs_statfs,
- .vfs_sync = vfs_stdsync,
- .vfs_uninit = nwfs_uninit,
- .vfs_unmount = nwfs_unmount,
-};
-
-
-VFS_SET(nwfs_vfsops, nwfs, VFCF_NETWORK);
-
-int nwfs_pbuf_freecnt = -1; /* start out unlimited */
-static int nwfsid = 1;
-
-static int
-nwfs_initnls(struct nwmount *nmp) {
- char *pc, *pe;
- int error = 0;
-#define COPY_TABLE(t,d) { \
- if (t) { \
- error = copyin((t), pc, 256); \
- if (error) break; \
- } else \
- bcopy(d, pc, 256); \
- (t) = pc; pc += 256; \
- }
-
- nmp->m.nls.opt |= NWHP_NLS | NWHP_DOS;
- if ((nmp->m.flags & NWFS_MOUNT_HAVE_NLS) == 0) {
- nmp->m.nls.to_lower = ncp_defnls.to_lower;
- nmp->m.nls.to_upper = ncp_defnls.to_upper;
- nmp->m.nls.n2u = ncp_defnls.n2u;
- nmp->m.nls.u2n = ncp_defnls.u2n;
- return 0;
- }
- pe = malloc(256 * 4, M_NWFSDATA, M_WAITOK);
- pc = pe;
- do {
- COPY_TABLE(nmp->m.nls.to_lower, ncp_defnls.to_lower);
- COPY_TABLE(nmp->m.nls.to_upper, ncp_defnls.to_upper);
- COPY_TABLE(nmp->m.nls.n2u, ncp_defnls.n2u);
- COPY_TABLE(nmp->m.nls.u2n, ncp_defnls.u2n);
- } while(0);
- if (error) {
- free(pe, M_NWFSDATA);
- return error;
- }
- return 0;
-}
-
-static int nwfs_cmount(struct mntarg *ma, void *data, uint64_t flags)
-{
- struct nwfs_args args; /* will hold data from mount request */
- int error;
-
- error = copyin(data, &args, sizeof(struct nwfs_args));
- if (error)
- return (error);
-
- /*
- * XXX: cheap cop-out here, args contains a structure I don't
- * XXX: know how we should handle, and I don't see any immediate
- * XXX: prospect of avoiding a mount_nwfs(8) binary anyway.
- */
- ma = mount_arg(ma, "nwfs_args", &args, sizeof args);
-
- error = kernel_mount(ma, flags);
-
- return (error);
-}
-
-/*
- * mp - path - addr in user space of mount point (ie /usr or whatever)
- * data - addr in user space of mount params
- */
-static int nwfs_mount(struct mount *mp)
-{
- struct nwfs_args args; /* will hold data from mount request */
- int error;
- struct nwmount *nmp = NULL;
- struct ncp_conn *conn = NULL;
- struct ncp_handle *handle = NULL;
- struct vnode *vp;
- struct thread *td;
- char *pc,*pe;
-
- td = curthread;
- if (mp->mnt_flag & MNT_ROOTFS)
- return (EOPNOTSUPP);
- if (mp->mnt_flag & MNT_UPDATE) {
- nwfs_printf("MNT_UPDATE not implemented");
- return (EOPNOTSUPP);
- }
- error = vfs_copyopt(mp->mnt_optnew, "nwfs_args", &args, sizeof args);
- if (error)
- return (error);
- if (args.version != NWFS_VERSION) {
- nwfs_printf("mount version mismatch: kernel=%d, mount=%d\n",NWFS_VERSION,args.version);
- return (1);
- }
- error = ncp_conn_getbyref(args.connRef, td , td->td_ucred,NCPM_EXECUTE,&conn);
- if (error) {
- nwfs_printf("invalid connection refernce %d\n",args.connRef);
- return (error);
- }
- error = ncp_conn_gethandle(conn, NULL, &handle);
- if (error) {
- nwfs_printf("can't get connection handle\n");
- return (error);
- }
- ncp_conn_unlock(conn, td); /* we keep the ref */
- mp->mnt_stat.f_iosize = conn->buffer_size;
- /* We must malloc our own mount info */
- nmp = malloc(sizeof(struct nwmount), M_NWFSDATA, M_WAITOK | M_ZERO);
- if (nmp == NULL) {
- nwfs_printf("could not alloc nwmount\n");
- error = ENOMEM;
- goto bad;
- }
- mp->mnt_data = nmp;
- nmp->connh = handle;
- nmp->n_root = NULL;
- nmp->n_id = nwfsid++;
- nmp->m = args;
- nmp->m.file_mode = (nmp->m.file_mode &
- (S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFREG;
- nmp->m.dir_mode = (nmp->m.dir_mode &
- (S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFDIR;
- if ((error = nwfs_initnls(nmp)) != 0) goto bad;
- pc = mp->mnt_stat.f_mntfromname;
- pe = pc+sizeof(mp->mnt_stat.f_mntfromname);
- bzero(pc, MNAMELEN);
- *(pc++) = '/';
- pc = strchr(strncpy(pc, conn->li.server, pe - pc - 2), 0);
- if (pc < pe-1) {
- *(pc++) = ':';
- pc = strchr(strncpy(pc, conn->li.user, pe - pc - 2), 0);
- if (pc < pe-1) {
- *(pc++) = '/';
- strncpy(pc, nmp->m.mounted_vol, pe-pc-2);
- }
- }
- /* protect against invalid mount points */
- nmp->m.mount_point[sizeof(nmp->m.mount_point)-1] = '\0';
- vfs_getnewfsid(mp);
- error = nwfs_root(mp, LK_EXCLUSIVE, &vp);
- if (error)
- goto bad;
- /*
- * Lose the lock but keep the ref.
- */
- VOP_UNLOCK(vp, 0);
- NCPVODEBUG("rootvp.vrefcnt=%d\n",vrefcnt(vp));
- return error;
-bad:
- if (nmp)
- free(nmp, M_NWFSDATA);
- if (handle)
- ncp_conn_puthandle(handle, NULL, 0);
- return error;
-}
-
-/* Unmount the filesystem described by mp. */
-static int
-nwfs_unmount(struct mount *mp, int mntflags)
-{
- struct thread *td;
- struct nwmount *nmp = VFSTONWFS(mp);
- struct ncp_conn *conn;
- int error, flags;
-
- NCPVODEBUG("nwfs_unmount: flags=%04x\n",mntflags);
- td = curthread;
- flags = 0;
- if (mntflags & MNT_FORCE)
- flags |= FORCECLOSE;
- /* There is 1 extra root vnode reference from nwfs_mount(). */
- error = vflush(mp, 1, flags, td);
- if (error)
- return (error);
- conn = NWFSTOCONN(nmp);
- ncp_conn_puthandle(nmp->connh,NULL,0);
- if (ncp_conn_lock(conn, td, td->td_ucred,NCPM_WRITE | NCPM_EXECUTE) == 0) {
- if(ncp_conn_free(conn))
- ncp_conn_unlock(conn, td);
- }
- mp->mnt_data = NULL;
- if (nmp->m.flags & NWFS_MOUNT_HAVE_NLS)
- free(nmp->m.nls.to_lower, M_NWFSDATA);
- free(nmp, M_NWFSDATA);
- MNT_ILOCK(mp);
- mp->mnt_flag &= ~MNT_LOCAL;
- MNT_IUNLOCK(mp);
- return (error);
-}
-
-/* Return locked vnode to root of a filesystem */
-static int
-nwfs_root(struct mount *mp, int flags, struct vnode **vpp) {
- struct vnode *vp;
- struct nwmount *nmp;
- struct nwnode *np;
- struct ncp_conn *conn;
- struct nw_entry_info fattr;
- struct thread *td;
- struct ucred *cred;
- int error, nsf, opt;
- u_char vol;
-
- td = curthread;
- cred = td->td_ucred;
-
- nmp = VFSTONWFS(mp);
- conn = NWFSTOCONN(nmp);
- if (nmp->n_root) {
- *vpp = NWTOV(nmp->n_root);
- while (vget(*vpp, LK_EXCLUSIVE, curthread) != 0)
- ;
- return 0;
- }
- error = ncp_lookup_volume(conn, nmp->m.mounted_vol, &vol,
- &nmp->n_rootent.f_id, td, cred);
- if (error)
- return ENOENT;
- nmp->n_volume = vol;
- error = ncp_get_namespaces(conn, vol, &nsf, td, cred);
- if (error)
- return ENOENT;
- if (nsf & NW_NSB_OS2) {
- NCPVODEBUG("volume %s has os2 namespace\n",nmp->m.mounted_vol);
- if ((nmp->m.flags & NWFS_MOUNT_NO_OS2) == 0) {
- nmp->name_space = NW_NS_OS2;
- nmp->m.nls.opt &= ~NWHP_DOS;
- }
- }
- opt = nmp->m.nls.opt;
- nsf = opt & (NWHP_UPPER | NWHP_LOWER);
- if (opt & NWHP_DOS) {
- if (nsf == (NWHP_UPPER | NWHP_LOWER)) {
- nmp->m.nls.opt &= ~(NWHP_LOWER | NWHP_UPPER);
- } else if (nsf == 0) {
- nmp->m.nls.opt |= NWHP_LOWER;
- }
- } else {
- if (nsf == (NWHP_UPPER | NWHP_LOWER)) {
- nmp->m.nls.opt &= ~(NWHP_LOWER | NWHP_UPPER);
- }
- }
- if (nmp->m.root_path[0]) {
- nmp->m.root_path[0]--;
- error = ncp_obtain_info(nmp, nmp->n_rootent.f_id,
- -nmp->m.root_path[0], nmp->m.root_path, &fattr, td, cred);
- if (error) {
- NCPFATAL("Invalid root path specified\n");
- return ENOENT;
- }
- nmp->n_rootent.f_parent = fattr.dirEntNum;
- nmp->m.root_path[0]++;
- error = ncp_obtain_info(nmp, nmp->n_rootent.f_id,
- -nmp->m.root_path[0], nmp->m.root_path, &fattr, td, cred);
- if (error) {
- NCPFATAL("Invalid root path specified\n");
- return ENOENT;
- }
- nmp->n_rootent.f_id = fattr.dirEntNum;
- } else {
- error = ncp_obtain_info(nmp, nmp->n_rootent.f_id,
- 0, NULL, &fattr, td, cred);
- if (error) {
- NCPFATAL("Can't obtain volume info\n");
- return ENOENT;
- }
- fattr.nameLen = strlen(strcpy(fattr.entryName, "#.ROOT"));
- nmp->n_rootent.f_parent = nmp->n_rootent.f_id;
- }
- error = nwfs_nget(mp, nmp->n_rootent, &fattr, NULL, &vp);
- if (error)
- return (error);
- vp->v_vflag |= VV_ROOT;
- np = VTONW(vp);
- if (nmp->m.root_path[0] == 0)
- np->n_flag |= NVOLUME;
- nmp->n_root = np;
-/* error = VOP_GETATTR(vp, &vattr, cred, td);
- if (error) {
- vput(vp);
- NCPFATAL("Can't get root directory entry\n");
- return error;
- }*/
- *vpp = vp;
- return (0);
-}
-
-/*
- * Do operations associated with quotas, not supported
- */
-/* ARGSUSED */
-static int
-nwfs_quotactl(mp, cmd, uid, arg)
- struct mount *mp;
- int cmd;
- uid_t uid;
- void *arg;
-{
- NCPVODEBUG("return EOPNOTSUPP\n");
- return (EOPNOTSUPP);
-}
-
-/*ARGSUSED*/
-int
-nwfs_init(struct vfsconf *vfsp)
-{
- nwfs_hash_init();
- nwfs_pbuf_freecnt = nswbuf / 2 + 1;
- NCPVODEBUG("always happy to load!\n");
- return (0);
-}
-
-/*ARGSUSED*/
-int
-nwfs_uninit(struct vfsconf *vfsp)
-{
-
- nwfs_hash_free();
- NCPVODEBUG("unloaded\n");
- return (0);
-}
-
-/*
- * nwfs_statfs call
- */
-int
-nwfs_statfs(mp, sbp)
- struct mount *mp;
- struct statfs *sbp;
-{
- struct nwmount *nmp = VFSTONWFS(mp);
- struct thread *td = curthread;
- int error = 0, secsize;
- struct nwnode *np = nmp->n_root;
- struct ncp_volume_info vi;
-
- if (np == NULL) return EINVAL;
- error = ncp_get_volume_info_with_number(NWFSTOCONN(nmp),
- nmp->n_volume, &vi, td, td->td_ucred);
- if (error) return error;
- secsize = 512; /* XXX how to get real value ??? */
- /* fundamental filesystem block size */
- sbp->f_bsize = vi.sectors_per_block*secsize;
- /* optimal transfer block size */
- sbp->f_iosize = NWFSTOCONN(nmp)->buffer_size;
- /* total data blocks in filesystem */
- sbp->f_blocks= vi.total_blocks;
- /* free blocks in fs */
- sbp->f_bfree = vi.free_blocks + vi.purgeable_blocks;
- /* free blocks avail to non-superuser */
- sbp->f_bavail= vi.free_blocks+vi.purgeable_blocks;
- /* total file nodes in filesystem */
- sbp->f_files = vi.total_dir_entries;
- /* free file nodes in fs */
- sbp->f_ffree = vi.available_dir_entries;
- sbp->f_flags = 0; /* copy of mount exported flags */
- return 0;
-}
diff --git a/sys/fs/nwfs/nwfs_vnops.c b/sys/fs/nwfs/nwfs_vnops.c
deleted file mode 100644
index b3f26e8..0000000
--- a/sys/fs/nwfs/nwfs_vnops.c
+++ /dev/null
@@ -1,967 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/namei.h>
-#include <sys/kernel.h>
-#include <sys/bio.h>
-#include <sys/buf.h>
-#include <sys/fcntl.h>
-#include <sys/mount.h>
-#include <sys/unistd.h>
-#include <sys/vnode.h>
-
-#include <vm/vm.h>
-#include <vm/vm_extern.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/nwerror.h>
-#include <netncp/ncp_nls.h>
-
-#include <fs/nwfs/nwfs.h>
-#include <fs/nwfs/nwfs_node.h>
-#include <fs/nwfs/nwfs_subr.h>
-
-/*
- * Prototypes for NWFS vnode operations
- */
-static vop_create_t nwfs_create;
-static vop_mknod_t nwfs_mknod;
-static vop_open_t nwfs_open;
-static vop_close_t nwfs_close;
-static vop_access_t nwfs_access;
-static vop_getattr_t nwfs_getattr;
-static vop_setattr_t nwfs_setattr;
-static vop_read_t nwfs_read;
-static vop_write_t nwfs_write;
-static vop_fsync_t nwfs_fsync;
-static vop_remove_t nwfs_remove;
-static vop_link_t nwfs_link;
-static vop_lookup_t nwfs_lookup;
-static vop_rename_t nwfs_rename;
-static vop_mkdir_t nwfs_mkdir;
-static vop_rmdir_t nwfs_rmdir;
-static vop_symlink_t nwfs_symlink;
-static vop_readdir_t nwfs_readdir;
-static vop_strategy_t nwfs_strategy;
-static vop_print_t nwfs_print;
-static vop_pathconf_t nwfs_pathconf;
-
-/* Global vfs data structures for nwfs */
-struct vop_vector nwfs_vnodeops = {
- .vop_default = &default_vnodeops,
-
- .vop_access = nwfs_access,
- .vop_close = nwfs_close,
- .vop_create = nwfs_create,
- .vop_fsync = nwfs_fsync,
- .vop_getattr = nwfs_getattr,
- .vop_getpages = nwfs_getpages,
- .vop_inactive = nwfs_inactive,
- .vop_ioctl = nwfs_ioctl,
- .vop_link = nwfs_link,
- .vop_lookup = nwfs_lookup,
- .vop_mkdir = nwfs_mkdir,
- .vop_mknod = nwfs_mknod,
- .vop_open = nwfs_open,
- .vop_pathconf = nwfs_pathconf,
- .vop_print = nwfs_print,
- .vop_putpages = nwfs_putpages,
- .vop_read = nwfs_read,
- .vop_readdir = nwfs_readdir,
- .vop_reclaim = nwfs_reclaim,
- .vop_remove = nwfs_remove,
- .vop_rename = nwfs_rename,
- .vop_rmdir = nwfs_rmdir,
- .vop_setattr = nwfs_setattr,
- .vop_strategy = nwfs_strategy,
- .vop_symlink = nwfs_symlink,
- .vop_write = nwfs_write,
-};
-
-/*
- * nwfs_access vnode op
- */
-static int
-nwfs_access(ap)
- struct vop_access_args /* {
- struct vnode *a_vp;
- accmode_t a_accmode;
- struct ucred *a_cred;
- struct thread *td;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- mode_t mpmode;
- struct nwmount *nmp = VTONWFS(vp);
-
- NCPVNDEBUG("\n");
- if ((ap->a_accmode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) {
- switch (vp->v_type) {
- case VREG: case VDIR: case VLNK:
- return (EROFS);
- default:
- break;
- }
- }
- mpmode = vp->v_type == VREG ? nmp->m.file_mode :
- nmp->m.dir_mode;
- return (vaccess(vp->v_type, mpmode, nmp->m.uid,
- nmp->m.gid, ap->a_accmode, ap->a_cred, NULL));
-}
-/*
- * nwfs_open vnode op
- */
-/* ARGSUSED */
-static int
-nwfs_open(ap)
- struct vop_open_args /* {
- struct vnode *a_vp;
- int a_mode;
- struct ucred *a_cred;
- struct thread *td;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- int mode = ap->a_mode;
- struct nwnode *np = VTONW(vp);
- struct ncp_open_info no;
- struct nwmount *nmp = VTONWFS(vp);
- struct vattr vattr;
- int error, nwm;
-
- NCPVNDEBUG("%s,%d\n", np->n_name, np->opened);
- if (vp->v_type != VREG && vp->v_type != VDIR) {
- NCPFATAL("open vtype = %d\n", vp->v_type);
- return (EACCES);
- }
- if (vp->v_type == VDIR) return 0; /* nothing to do now */
- if (np->n_flag & NMODIFIED) {
- if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == EINTR)
- return (error);
- np->n_atime = 0;
- error = VOP_GETATTR(vp, &vattr, ap->a_cred);
- if (error) return (error);
- np->n_mtime = vattr.va_mtime.tv_sec;
- } else {
- error = VOP_GETATTR(vp, &vattr, ap->a_cred);
- if (error) return (error);
- if (np->n_mtime != vattr.va_mtime.tv_sec) {
- if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == EINTR)
- return (error);
- np->n_mtime = vattr.va_mtime.tv_sec;
- }
- }
- if (np->opened) {
- np->opened++;
- return 0;
- }
- nwm = AR_READ;
- if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0)
- nwm |= AR_WRITE;
- error = ncp_open_create_file_or_subdir(nmp, vp, 0, NULL, OC_MODE_OPEN,
- 0, nwm, &no, ap->a_td, ap->a_cred);
- if (error) {
- if (mode & FWRITE)
- return EACCES;
- nwm = AR_READ;
- error = ncp_open_create_file_or_subdir(nmp, vp, 0, NULL, OC_MODE_OPEN, 0,
- nwm, &no, ap->a_td, ap->a_cred);
- }
- if (!error) {
- np->opened++;
- np->n_fh = no.fh;
- np->n_origfh = no.origfh;
- }
- np->n_atime = 0;
- return (error);
-}
-
-static int
-nwfs_close(ap)
- struct vop_close_args /* {
- struct vnodeop_desc *a_desc;
- struct vnode *a_vp;
- int a_fflag;
- struct ucred *a_cred;
- struct thread *td;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct nwnode *np = VTONW(vp);
- int error;
-
- NCPVNDEBUG("name=%s,pid=%d,c=%d\n", np->n_name, ap->a_td->td_proc->p_pid,
- np->opened);
-
- if (vp->v_type == VDIR) return 0; /* nothing to do now */
- error = 0;
- VI_LOCK(vp);
- if (np->opened == 0) {
- VI_UNLOCK(vp);
- return 0;
- }
- VI_UNLOCK(vp);
- error = nwfs_vinvalbuf(vp, ap->a_td);
- VI_LOCK(vp);
- if (np->opened == 0) {
- VI_UNLOCK(vp);
- return 0;
- }
- if (--np->opened == 0) {
- VI_UNLOCK(vp);
- error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh,
- ap->a_td, ap->a_cred);
- } else
- VI_UNLOCK(vp);
- np->n_atime = 0;
- return (error);
-}
-
-/*
- * nwfs_getattr call from vfs.
- */
-static int
-nwfs_getattr(ap)
- struct vop_getattr_args /* {
- struct vnode *a_vp;
- struct vattr *a_vap;
- struct ucred *a_cred;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct nwnode *np = VTONW(vp);
- struct vattr *va=ap->a_vap;
- struct nwmount *nmp = VTONWFS(vp);
- struct thread *td = curthread;
- struct nw_entry_info fattr;
- int error;
- u_int32_t oldsize;
-
- NCPVNDEBUG("%lx:%d: '%s' %d\n", (long)vp, nmp->n_volume, np->n_name, (vp->v_vflag & VV_ROOT) != 0);
- error = nwfs_attr_cachelookup(vp, va);
- if (!error) return 0;
- NCPVNDEBUG("not in cache\n");
- oldsize = np->n_size;
- if (np->n_flag & NVOLUME) {
- error = ncp_obtain_info(nmp, np->n_fid.f_id, 0, NULL, &fattr,
- td, ap->a_cred);
- } else {
- error = ncp_obtain_info(nmp, np->n_fid.f_parent, np->n_nmlen,
- np->n_name, &fattr, td, ap->a_cred);
- }
- if (error) {
- NCPVNDEBUG("error %d\n", error);
- return error;
- }
- nwfs_attr_cacheenter(vp, &fattr);
- *va = np->n_vattr;
- if (np->opened)
- np->n_size = oldsize;
- return (0);
-}
-/*
- * nwfs_setattr call from vfs.
- */
-static int
-nwfs_setattr(ap)
- struct vop_setattr_args /* {
- struct vnode *a_vp;
- struct vattr *a_vap;
- struct ucred *a_cred;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct nwnode *np = VTONW(vp);
- struct vattr *vap = ap->a_vap;
- u_quad_t tsize=0;
- int error = 0;
-
- NCPVNDEBUG("\n");
- if (vap->va_flags != VNOVAL)
- return (EOPNOTSUPP);
- /*
- * Disallow write attempts if the filesystem is mounted read-only.
- */
- if ((vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL ||
- vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL ||
- vap->va_mode != (mode_t)VNOVAL) &&(vp->v_mount->mnt_flag & MNT_RDONLY))
- return (EROFS);
- if (vap->va_size != VNOVAL) {
- switch (vp->v_type) {
- case VDIR:
- return (EISDIR);
- case VREG:
- /*
- * Disallow write attempts if the filesystem is
- * mounted read-only.
- */
- if (vp->v_mount->mnt_flag & MNT_RDONLY)
- return (EROFS);
- vnode_pager_setsize(vp, (u_long)vap->va_size);
- tsize = np->n_size;
- np->n_size = vap->va_size;
- break;
- default:
- return EINVAL;
- };
- }
- error = ncp_setattr(vp, vap, ap->a_cred, curthread);
- if (error && vap->va_size != VNOVAL) {
- np->n_size = tsize;
- vnode_pager_setsize(vp, (u_long)tsize);
- }
- np->n_atime = 0; /* invalidate cache */
- VOP_GETATTR(vp, vap, ap->a_cred);
- np->n_mtime = vap->va_mtime.tv_sec;
- return (0);
-}
-/*
- * nwfs_read call.
- */
-static int
-nwfs_read(ap)
- struct vop_read_args /* {
- struct vnode *a_vp;
- struct uio *a_uio;
- int a_ioflag;
- struct ucred *a_cred;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct uio *uio=ap->a_uio;
- int error;
- NCPVNDEBUG("nwfs_read:\n");
-
- if (vp->v_type != VREG && vp->v_type != VDIR)
- return (EPERM);
- error = nwfs_readvnode(vp, uio, ap->a_cred);
- return error;
-}
-
-static int
-nwfs_write(ap)
- struct vop_write_args /* {
- struct vnode *a_vp;
- struct uio *a_uio;
- int a_ioflag;
- struct ucred *a_cred;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct uio *uio = ap->a_uio;
- int error;
-
- NCPVNDEBUG("%d,ofs=%d,sz=%d\n", vp->v_type, (int)uio->uio_offset, uio->uio_resid);
-
- if (vp->v_type != VREG)
- return (EPERM);
- error = nwfs_writevnode(vp, uio, ap->a_cred, ap->a_ioflag);
- return(error);
-}
-/*
- * nwfs_create call
- * Create a regular file. On entry the directory to contain the file being
- * created is locked. We must release before we return. We must also free
- * the pathname buffer pointed at by cnp->cn_pnbuf, always on error, or
- * only if the SAVESTART bit in cn_flags is clear on success.
- */
-static int
-nwfs_create(ap)
- struct vop_create_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- struct vattr *a_vap;
- } */ *ap;
-{
- struct vnode *dvp = ap->a_dvp;
- struct vattr *vap = ap->a_vap;
- struct vnode **vpp=ap->a_vpp;
- struct componentname *cnp = ap->a_cnp;
- struct vnode *vp = (struct vnode *)0;
- int error = 0, fmode;
- struct vattr vattr;
- struct nwnode *np;
- struct ncp_open_info no;
- struct nwmount *nmp=VTONWFS(dvp);
- ncpfid fid;
-
-
- NCPVNDEBUG("\n");
- *vpp = NULL;
- if (vap->va_type == VSOCK)
- return (EOPNOTSUPP);
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)))
- return (error);
- fmode = AR_READ | AR_WRITE;
-/* if (vap->va_vaflags & VA_EXCLUSIVE)
- fmode |= AR_DENY_READ | AR_DENY_WRITE;*/
-
- error = ncp_open_create_file_or_subdir(nmp, dvp, cnp->cn_namelen, cnp->cn_nameptr,
- OC_MODE_CREATE | OC_MODE_OPEN | OC_MODE_REPLACE,
- 0, fmode, &no, cnp->cn_thread, cnp->cn_cred);
- if (!error) {
- error = ncp_close_file(NWFSTOCONN(nmp), &no.fh, cnp->cn_thread, cnp->cn_cred);
- fid.f_parent = VTONW(dvp)->n_fid.f_id;
- fid.f_id = no.fattr.dirEntNum;
- error = nwfs_nget(VTOVFS(dvp), fid, &no.fattr, dvp, &vp);
- if (!error) {
- np = VTONW(vp);
- np->opened = 0;
- *vpp = vp;
- }
- if (cnp->cn_flags & MAKEENTRY)
- cache_enter(dvp, vp, cnp);
- }
- return (error);
-}
-
-/*
- * nwfs_remove call. It isn't possible to emulate UFS behaivour because
- * NetWare doesn't allow delete/rename operations on an opened file.
- */
-static int
-nwfs_remove(ap)
- struct vop_remove_args /* {
- struct vnodeop_desc *a_desc;
- struct vnode * a_dvp;
- struct vnode * a_vp;
- struct componentname * a_cnp;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct vnode *dvp = ap->a_dvp;
- struct componentname *cnp = ap->a_cnp;
- struct nwnode *np = VTONW(vp);
- struct nwmount *nmp = VTONWFS(vp);
- int error;
-
- if (vp->v_type == VDIR || np->opened || vrefcnt(vp) != 1)
- return EPERM;
- cache_purge(vp);
- error = ncp_DeleteNSEntry(nmp, VTONW(dvp)->n_fid.f_id,
- cnp->cn_namelen, cnp->cn_nameptr, cnp->cn_thread, cnp->cn_cred);
- if (error == 0)
- np->n_flag |= NSHOULDFREE;
- else if (error == 0x899c)
- error = EACCES;
- return (error);
-}
-
-/*
- * nwfs_file rename call
- */
-static int
-nwfs_rename(ap)
- struct vop_rename_args /* {
- struct vnode *a_fdvp;
- struct vnode *a_fvp;
- struct componentname *a_fcnp;
- struct vnode *a_tdvp;
- struct vnode *a_tvp;
- struct componentname *a_tcnp;
- } */ *ap;
-{
- struct vnode *fvp = ap->a_fvp;
- struct vnode *tvp = ap->a_tvp;
- struct vnode *fdvp = ap->a_fdvp;
- struct vnode *tdvp = ap->a_tdvp;
- struct componentname *tcnp = ap->a_tcnp;
- struct componentname *fcnp = ap->a_fcnp;
- struct nwmount *nmp=VTONWFS(fvp);
- u_int16_t oldtype = 6;
- int error=0;
-
- /* Check for cross-device rename */
- if ((fvp->v_mount != tdvp->v_mount) ||
- (tvp && (fvp->v_mount != tvp->v_mount))) {
- error = EXDEV;
- goto out;
- }
-
- if (tvp && vrefcnt(tvp) > 1) {
- error = EBUSY;
- goto out;
- }
- if (fvp->v_type == VDIR) {
- oldtype |= NW_TYPE_SUBDIR;
- } else if (fvp->v_type == VREG) {
- oldtype |= NW_TYPE_FILE;
- } else {
- error = EINVAL;
- goto out;
- }
- if (tvp && tvp != fvp) {
- error = ncp_DeleteNSEntry(nmp, VTONW(tdvp)->n_fid.f_id,
- tcnp->cn_namelen, tcnp->cn_nameptr,
- tcnp->cn_thread, tcnp->cn_cred);
- if (error == 0x899c) error = EACCES;
- if (error)
- goto out_cacherem;
- }
- error = ncp_nsrename(NWFSTOCONN(nmp), nmp->n_volume, nmp->name_space,
- oldtype, &nmp->m.nls,
- VTONW(fdvp)->n_fid.f_id, fcnp->cn_nameptr, fcnp->cn_namelen,
- VTONW(tdvp)->n_fid.f_id, tcnp->cn_nameptr, tcnp->cn_namelen,
- tcnp->cn_thread, tcnp->cn_cred);
-
- if (error == 0x8992)
- error = EEXIST;
- if (fvp->v_type == VDIR) {
- if (tvp != NULL && tvp->v_type == VDIR)
- cache_purge(tdvp);
- cache_purge(fdvp);
- }
-out_cacherem:
- nwfs_attr_cacheremove(fdvp);
- nwfs_attr_cacheremove(tdvp);
- nwfs_attr_cacheremove(fvp);
-out:
- if (tdvp == tvp)
- vrele(tdvp);
- else
- vput(tdvp);
- if (tvp)
- vput(tvp);
- vrele(fdvp);
- vrele(fvp);
- if (tvp)
- nwfs_attr_cacheremove(tvp);
- /*
- * Kludge: Map ENOENT => 0 assuming that it is a reply to a retry.
- */
- if (error == ENOENT)
- error = 0;
- return (error);
-}
-
-/*
- * nwfs hard link create call
- * Netware filesystems don't know what links are.
- */
-static int
-nwfs_link(ap)
- struct vop_link_args /* {
- struct vnode *a_tdvp;
- struct vnode *a_vp;
- struct componentname *a_cnp;
- } */ *ap;
-{
- return EOPNOTSUPP;
-}
-
-/*
- * nwfs_symlink link create call
- * Netware filesystems don't know what symlinks are.
- */
-static int
-nwfs_symlink(ap)
- struct vop_symlink_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- struct vattr *a_vap;
- char *a_target;
- } */ *ap;
-{
- return (EOPNOTSUPP);
-}
-
-static int nwfs_mknod(ap)
- struct vop_mknod_args /* {
- } */ *ap;
-{
- return (EOPNOTSUPP);
-}
-
-/*
- * nwfs_mkdir call
- */
-static int
-nwfs_mkdir(ap)
- struct vop_mkdir_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- struct vattr *a_vap;
- } */ *ap;
-{
- struct vnode *dvp = ap->a_dvp;
-/* struct vattr *vap = ap->a_vap;*/
- struct componentname *cnp = ap->a_cnp;
- int len=cnp->cn_namelen;
- struct ncp_open_info no;
- struct vnode *newvp = (struct vnode *)0;
- ncpfid fid;
- int error = 0;
- struct vattr vattr;
- char *name=cnp->cn_nameptr;
-
- if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)))
- return (error);
- if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) {
- return EEXIST;
- }
- if (ncp_open_create_file_or_subdir(VTONWFS(dvp), dvp, cnp->cn_namelen,
- cnp->cn_nameptr, OC_MODE_CREATE, aDIR, 0xffff,
- &no, cnp->cn_thread, cnp->cn_cred) != 0) {
- error = EACCES;
- } else {
- error = 0;
- }
- if (!error) {
- fid.f_parent = VTONW(dvp)->n_fid.f_id;
- fid.f_id = no.fattr.dirEntNum;
- error = nwfs_nget(VTOVFS(dvp), fid, &no.fattr, dvp, &newvp);
- if (!error) {
- newvp->v_type = VDIR;
- *ap->a_vpp = newvp;
- }
- }
- return (error);
-}
-
-/*
- * nwfs_remove directory call
- */
-static int
-nwfs_rmdir(ap)
- struct vop_rmdir_args /* {
- struct vnode *a_dvp;
- struct vnode *a_vp;
- struct componentname *a_cnp;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct vnode *dvp = ap->a_dvp;
- struct componentname *cnp = ap->a_cnp;
- struct nwnode *np = VTONW(vp);
- struct nwmount *nmp = VTONWFS(vp);
- struct nwnode *dnp = VTONW(dvp);
- int error = EIO;
-
- if (dvp == vp)
- return EINVAL;
-
- error = ncp_DeleteNSEntry(nmp, dnp->n_fid.f_id,
- cnp->cn_namelen, cnp->cn_nameptr, cnp->cn_thread, cnp->cn_cred);
- if (error == 0)
- np->n_flag |= NSHOULDFREE;
- else if (error == NWE_DIR_NOT_EMPTY)
- error = ENOTEMPTY;
- dnp->n_flag |= NMODIFIED;
- nwfs_attr_cacheremove(dvp);
- cache_purge(dvp);
- cache_purge(vp);
- return (error);
-}
-
-/*
- * nwfs_readdir call
- */
-static int
-nwfs_readdir(ap)
- struct vop_readdir_args /* {
- struct vnode *a_vp;
- struct uio *a_uio;
- struct ucred *a_cred;
- int *a_eofflag;
- u_long *a_cookies;
- int a_ncookies;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct uio *uio = ap->a_uio;
- int error;
-
- if (vp->v_type != VDIR)
- return (EPERM);
- if (ap->a_ncookies) {
- printf("nwfs_readdir: no support for cookies now...");
- return (EOPNOTSUPP);
- }
-
- error = nwfs_readvnode(vp, uio, ap->a_cred);
- return error;
-}
-/* ARGSUSED */
-static int
-nwfs_fsync(ap)
- struct vop_fsync_args /* {
- struct vnodeop_desc *a_desc;
- struct vnode * a_vp;
- struct ucred * a_cred;
- int a_waitfor;
- struct thread *a_td;
- } */ *ap;
-{
-/* return (nfs_flush(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_td, 1));*/
- return (0);
-}
-
-/* ARGSUSED */
-static
-int nwfs_print (ap)
- struct vop_print_args /* {
- struct vnode *a_vp;
- } */ *ap;
-{
- struct vnode *vp = ap->a_vp;
- struct nwnode *np = VTONW(vp);
-
- printf("\tnwfs node: name = '%s', fid = %d, pfid = %d\n",
- np->n_name, np->n_fid.f_id, np->n_fid.f_parent);
- return (0);
-}
-
-static int nwfs_pathconf (ap)
- struct vop_pathconf_args /* {
- struct vnode *vp;
- int name;
- register_t *retval;
- } */ *ap;
-{
- int name=ap->a_name, error=0;
- register_t *retval=ap->a_retval;
-
- switch(name){
- case _PC_LINK_MAX:
- *retval=0;
- break;
- case _PC_NAME_MAX:
- *retval=NCP_MAX_FILENAME; /* XXX from nwfsnode */
- break;
- case _PC_PATH_MAX:
- *retval=NCP_MAXPATHLEN; /* XXX from nwfsnode */
- break;
- default:
- error=EINVAL;
- }
- return(error);
-}
-
-static int nwfs_strategy (ap)
- struct vop_strategy_args /* {
- struct buf *a_bp
- } */ *ap;
-{
- struct buf *bp=ap->a_bp;
- struct ucred *cr;
- struct thread *td;
-
- NCPVNDEBUG("\n");
- if (bp->b_flags & B_ASYNC)
- td = (struct thread *)0;
- else
- td = curthread; /* XXX */
- if (bp->b_iocmd == BIO_READ)
- cr = bp->b_rcred;
- else
- cr = bp->b_wcred;
- /*
- * If the op is asynchronous and an i/o daemon is waiting
- * queue the request, wake it up and wait for completion
- * otherwise just do it ourselves.
- */
- if ((bp->b_flags & B_ASYNC) == 0 )
- (void)nwfs_doio(ap->a_vp, bp, cr, td);
- return (0);
-}
-
-
-/*
- * How to keep the brain busy ...
- * Currently lookup routine can make two lookup for vnode. This can be
- * avoided by reorg the code.
- */
-int
-nwfs_lookup(ap)
- struct vop_lookup_args /* {
- struct vnodeop_desc *a_desc;
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- } */ *ap;
-{
- struct componentname *cnp = ap->a_cnp;
- struct vnode *dvp = ap->a_dvp;
- struct vnode **vpp = ap->a_vpp;
- int flags = cnp->cn_flags;
- struct vnode *vp;
- struct nwmount *nmp;
- struct mount *mp = dvp->v_mount;
- struct nwnode *dnp, *npp;
- struct nw_entry_info fattr, *fap;
- ncpfid fid;
- int nameiop=cnp->cn_nameiop, islastcn;
- int error = 0, notfound;
- struct thread *td = cnp->cn_thread;
- char _name[cnp->cn_namelen+1];
- bcopy(cnp->cn_nameptr, _name, cnp->cn_namelen);
- _name[cnp->cn_namelen]=0;
-
- if (dvp->v_type != VDIR)
- return (ENOTDIR);
- if ((flags & ISDOTDOT) && (dvp->v_vflag & VV_ROOT)) {
- printf("nwfs_lookup: invalid '..'\n");
- return EIO;
- }
-
- NCPVNDEBUG("%d '%s' in '%s' id=d\n", nameiop, _name,
- VTONW(dvp)->n_name/*, VTONW(dvp)->n_name*/);
-
- islastcn = flags & ISLASTCN;
- if (islastcn && (mp->mnt_flag & MNT_RDONLY) && (nameiop != LOOKUP))
- return (EROFS);
- if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)))
- return (error);
- nmp = VFSTONWFS(mp);
- dnp = VTONW(dvp);
-/*
-printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_vflag & VV_ROOT, (int)flags & ISDOTDOT);
-*/
- error = ncp_pathcheck(cnp->cn_nameptr, cnp->cn_namelen, &nmp->m.nls,
- (nameiop == CREATE || nameiop == RENAME) && (nmp->m.nls.opt & NWHP_NOSTRICT) == 0);
- if (error)
- return ENOENT;
-
- error = cache_lookup(dvp, vpp, cnp, NULL, NULL);
- NCPVNDEBUG("cache_lookup returned %d\n", error);
- if (error > 0)
- return error;
- if (error) { /* name was found */
- struct vattr vattr;
-
- vp = *vpp;
- if (!VOP_GETATTR(vp, &vattr, cnp->cn_cred) &&
- vattr.va_ctime.tv_sec == VTONW(vp)->n_ctime) {
- if (nameiop != LOOKUP && islastcn)
- cnp->cn_flags |= SAVENAME;
- NCPVNDEBUG("use cached vnode");
- return (0);
- }
- cache_purge(vp);
- if (vp != dvp)
- vput(vp);
- else
- vrele(vp);
- *vpp = NULLVP;
- }
- /* not in cache, so ... */
- error = 0;
- *vpp = NULLVP;
- fap = NULL;
- if (flags & ISDOTDOT) {
- if (NWCMPF(&dnp->n_parent, &nmp->n_rootent)) {
- fid = nmp->n_rootent;
- fap = NULL;
- notfound = 0;
- } else {
- error = nwfs_lookupnp(nmp, dnp->n_parent, td, &npp);
- if (error) {
- return error;
- }
- fid = dnp->n_parent;
- fap = &fattr;
- /*np = *npp;*/
- notfound = ncp_obtain_info(nmp, npp->n_dosfid,
- 0, NULL, fap, td, cnp->cn_cred);
- }
- } else {
- fap = &fattr;
- notfound = ncp_lookup(dvp, cnp->cn_namelen, cnp->cn_nameptr,
- fap, td, cnp->cn_cred);
- fid.f_id = fap->dirEntNum;
- if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
- fid.f_parent = dnp->n_fid.f_parent;
- } else
- fid.f_parent = dnp->n_fid.f_id;
- NCPVNDEBUG("call to ncp_lookup returned=%d\n", notfound);
- }
- if (notfound && notfound < 0x80 )
- return (notfound); /* hard error */
- if (notfound) { /* entry not found */
- /* Handle RENAME or CREATE case... */
- if ((nameiop == CREATE || nameiop == RENAME) && islastcn) {
- cnp->cn_flags |= SAVENAME;
- return (EJUSTRETURN);
- }
- return ENOENT;
- }/* else {
- NCPVNDEBUG("Found entry %s with id=%d\n", fap->entryName, fap->dirEntNum);
- }*/
- /* handle DELETE case ... */
- if (nameiop == DELETE && islastcn) { /* delete last component */
- error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, cnp->cn_thread);
- if (error) return (error);
- if (NWCMPF(&dnp->n_fid, &fid)) { /* we found ourselfs */
- VREF(dvp);
- *vpp = dvp;
- return 0;
- }
- error = nwfs_nget(mp, fid, fap, dvp, &vp);
- if (error) return (error);
- *vpp = vp;
- cnp->cn_flags |= SAVENAME; /* I free it later */
- return (0);
- }
- if (nameiop == RENAME && islastcn) {
- error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred, cnp->cn_thread);
- if (error) return (error);
- if (NWCMPF(&dnp->n_fid, &fid)) return EISDIR;
- error = nwfs_nget(mp, fid, fap, dvp, &vp);
- if (error) return (error);
- *vpp = vp;
- cnp->cn_flags |= SAVENAME;
- return (0);
- }
- if (flags & ISDOTDOT) {
- VOP_UNLOCK(dvp, 0); /* race to get the inode */
- error = nwfs_nget(mp, fid, NULL, NULL, &vp);
- vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);
- if (error)
- return (error);
- *vpp = vp;
- } else if (NWCMPF(&dnp->n_fid, &fid)) {
- vref(dvp);
- *vpp = dvp;
- } else {
- error = nwfs_nget(mp, fid, fap, dvp, &vp);
- if (error) return (error);
- *vpp = vp;
- NCPVNDEBUG("lookup: getnewvp!\n");
- }
- if ((cnp->cn_flags & MAKEENTRY)/* && !islastcn*/) {
- VTONW(*vpp)->n_ctime = VTONW(*vpp)->n_vattr.va_ctime.tv_sec;
- cache_enter(dvp, *vpp, cnp);
- }
- return (0);
-}
diff --git a/sys/fs/smbfs/smbfs_smb.c b/sys/fs/smbfs/smbfs_smb.c
index 05d482e..ec4a49d 100644
--- a/sys/fs/smbfs/smbfs_smb.c
+++ b/sys/fs/smbfs/smbfs_smb.c
@@ -1455,15 +1455,9 @@ smbfs_smb_lookup(struct smbnode *dnp, const char *name, int nmlen,
fap->fa_ino = 2;
return 0;
}
- if (nmlen == 1 && name[0] == '.') {
- error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred);
- return error;
- } else if (nmlen == 2 && name[0] == '.' && name[1] == '.') {
- error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap,
- scred);
- printf("%s: knows NOTHING about '..'\n", __func__);
- return error;
- }
+ MPASS(!(nmlen == 2 && name[0] == '.' && name[1] == '.'));
+ MPASS(!(nmlen == 1 && name[0] == '.'));
+ ASSERT_VOP_ELOCKED(dnp->n_vnode, "smbfs_smb_lookup");
error = smbfs_findopen(dnp, name, nmlen,
SMB_FA_SYSTEM | SMB_FA_HIDDEN | SMB_FA_DIR, scred, &ctx);
if (error)
diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c
index 5570de9..6ceed9c 100644
--- a/sys/fs/smbfs/smbfs_vnops.c
+++ b/sys/fs/smbfs/smbfs_vnops.c
@@ -580,6 +580,7 @@ smbfs_rename(ap)
u_int16_t flags = 6;
int error=0;
+ scred = NULL;
/* Check for cross-device rename */
if ((fvp->v_mount != tdvp->v_mount) ||
(tvp && (fvp->v_mount != tvp->v_mount))) {
@@ -730,7 +731,7 @@ smbfs_mkdir(ap)
*ap->a_vpp = vp;
out:
smbfs_free_scred(scred);
- return 0;
+ return error;
}
/*
@@ -1203,13 +1204,20 @@ smbfs_lookup(ap)
smb_makescred(scred, td, cnp->cn_cred);
fap = &fattr;
if (flags & ISDOTDOT) {
- error = smbfs_smb_lookup(VTOSMB(dnp->n_parent), NULL, 0, fap,
- scred);
- SMBVDEBUG("result of dotdot lookup: %d\n", error);
- } else {
- fap = &fattr;
+ /*
+ * In the DOTDOT case, don't go over-the-wire
+ * in order to request attributes. We already
+ * know it's a directory and subsequent call to
+ * smbfs_getattr() will restore consistency.
+ *
+ */
+ SMBVDEBUG("smbfs_smb_lookup: dotdot\n");
+ } else if (isdot) {
+ error = smbfs_smb_lookup(dnp, NULL, 0, fap, scred);
+ SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error);
+ }
+ else {
error = smbfs_smb_lookup(dnp, name, nmlen, fap, scred);
-/* if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')*/
SMBVDEBUG("result of smbfs_smb_lookup: %d\n", error);
}
if (error && error != ENOENT)
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 54c95ff..156fd43 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -1297,6 +1297,7 @@ tmpfs_rename(struct vop_rename_args *v)
cache_purge(fvp);
if (tvp != NULL)
cache_purge(tvp);
+ cache_purge_negative(tdvp);
error = 0;
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c
index b1a3b1d..abe073e 100644
--- a/sys/fs/udf/udf_vnops.c
+++ b/sys/fs/udf/udf_vnops.c
@@ -478,8 +478,9 @@ udf_read(struct vop_read_args *ap)
rablock = lbn + 1;
if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
if (lblktosize(udfmp, rablock) < fsize) {
- error = cluster_read(vp, fsize, lbn, size, NOCRED,
- uio->uio_resid, (ap->a_ioflag >> 16), &bp);
+ error = cluster_read(vp, fsize, lbn, size,
+ NOCRED, uio->uio_resid,
+ (ap->a_ioflag >> 16), 0, &bp);
} else {
error = bread(vp, lbn, size, NOCRED, &bp);
}
diff --git a/sys/geom/gate/g_gate.c b/sys/geom/gate/g_gate.c
index d1ddd40..c44993a 100644
--- a/sys/geom/gate/g_gate.c
+++ b/sys/geom/gate/g_gate.c
@@ -813,7 +813,7 @@ g_gate_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct threa
}
}
ggio->gctl_cmd = bp->bio_cmd;
- if ((bp->bio_cmd == BIO_DELETE || bp->bio_cmd == BIO_WRITE) &&
+ if (bp->bio_cmd == BIO_WRITE &&
bp->bio_length > ggio->gctl_length) {
mtx_unlock(&sc->sc_queue_mtx);
ggio->gctl_length = bp->bio_length;
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 80f07a2..6499986 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -133,6 +133,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_extern.h>
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
+#include <vm/vm_radix.h>
#include <vm/vm_reserv.h>
#include <vm/uma.h>
@@ -392,7 +393,6 @@ pmap_bootstrap(vm_paddr_t firstaddr)
#ifdef PAE
kernel_pmap->pm_pdpt = (pdpt_entry_t *) (KERNBASE + (u_int)IdlePDPT);
#endif
- kernel_pmap->pm_root = NULL;
CPU_FILL(&kernel_pmap->pm_active); /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvchunk);
@@ -1574,7 +1574,8 @@ pmap_free_zero_pages(vm_page_t free)
while (free != NULL) {
m = free;
- free = m->right;
+ free = (void *)m->object;
+ m->object = NULL;
/* Preserve the page's PG_ZERO setting. */
vm_page_free_toq(m);
}
@@ -1593,7 +1594,7 @@ pmap_add_delayed_free_list(vm_page_t m, vm_page_t *free, boolean_t set_PG_ZERO)
m->flags |= PG_ZERO;
else
m->flags &= ~PG_ZERO;
- m->right = *free;
+ m->object = (void *)*free;
*free = m;
}
@@ -1603,31 +1604,12 @@ pmap_add_delayed_free_list(vm_page_t m, vm_page_t *free, boolean_t set_PG_ZERO)
* for mapping a distinct range of virtual addresses. The pmap's collection is
* ordered by this virtual address range.
*/
-static void
+static __inline void
pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte)
{
- vm_page_t root;
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- root = pmap->pm_root;
- if (root == NULL) {
- mpte->left = NULL;
- mpte->right = NULL;
- } else {
- root = vm_page_splay(mpte->pindex, root);
- if (mpte->pindex < root->pindex) {
- mpte->left = root->left;
- mpte->right = root;
- root->left = NULL;
- } else if (mpte->pindex == root->pindex)
- panic("pmap_insert_pt_page: pindex already inserted");
- else {
- mpte->right = root->right;
- mpte->left = root;
- root->right = NULL;
- }
- }
- pmap->pm_root = mpte;
+ vm_radix_insert(&pmap->pm_root, mpte);
}
/*
@@ -1635,19 +1617,12 @@ pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte)
* specified pmap's collection of idle page table pages. Returns NULL if there
* is no page table page corresponding to the specified virtual address.
*/
-static vm_page_t
+static __inline vm_page_t
pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va)
{
- vm_page_t mpte;
- vm_pindex_t pindex = va >> PDRSHIFT;
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- if ((mpte = pmap->pm_root) != NULL && mpte->pindex != pindex) {
- mpte = vm_page_splay(pindex, mpte);
- if ((pmap->pm_root = mpte)->pindex != pindex)
- mpte = NULL;
- }
- return (mpte);
+ return (vm_radix_lookup(&pmap->pm_root, va >> PDRSHIFT));
}
/*
@@ -1655,21 +1630,12 @@ pmap_lookup_pt_page(pmap_t pmap, vm_offset_t va)
* of idle page table pages. The specified page table page must be a member of
* the pmap's collection.
*/
-static void
+static __inline void
pmap_remove_pt_page(pmap_t pmap, vm_page_t mpte)
{
- vm_page_t root;
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- if (mpte != pmap->pm_root)
- vm_page_splay(mpte->pindex, pmap->pm_root);
- if (mpte->left == NULL)
- root = mpte->right;
- else {
- root = vm_page_splay(mpte->pindex, mpte->left);
- root->right = mpte->right;
- }
- pmap->pm_root = root;
+ vm_radix_remove(&pmap->pm_root, mpte->pindex);
}
/*
@@ -1756,7 +1722,7 @@ pmap_pinit0(pmap_t pmap)
#ifdef PAE
pmap->pm_pdpt = (pdpt_entry_t *)(KERNBASE + (vm_offset_t)IdlePDPT);
#endif
- pmap->pm_root = NULL;
+ pmap->pm_root.rt_root = 0;
CPU_ZERO(&pmap->pm_active);
PCPU_SET(curpmap, pmap);
TAILQ_INIT(&pmap->pm_pvchunk);
@@ -1795,9 +1761,9 @@ pmap_pinit(pmap_t pmap)
KASSERT(pmap_kextract((vm_offset_t)pmap->pm_pdpt) < (4ULL<<30),
("pmap_pinit: pdpt above 4g"));
#endif
- pmap->pm_root = NULL;
+ pmap->pm_root.rt_root = 0;
}
- KASSERT(pmap->pm_root == NULL,
+ KASSERT(vm_radix_is_empty(&pmap->pm_root),
("pmap_pinit: pmap has reserved page table page(s)"));
/*
@@ -2061,7 +2027,7 @@ pmap_release(pmap_t pmap)
KASSERT(pmap->pm_stats.resident_count == 0,
("pmap_release: pmap resident count %ld != 0",
pmap->pm_stats.resident_count));
- KASSERT(pmap->pm_root == NULL,
+ KASSERT(vm_radix_is_empty(&pmap->pm_root),
("pmap_release: pmap has reserved page table page(s)"));
pmap_lazyfix(pmap);
@@ -2344,7 +2310,7 @@ out:
}
if (m_pc == NULL && pv_vafree != 0 && free != NULL) {
m_pc = free;
- free = m_pc->right;
+ free = (void *)m_pc->object;
/* Recycle a freed page table page. */
m_pc->wire_count = 1;
atomic_add_int(&cnt.v_wire_count, 1);
@@ -4239,6 +4205,49 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
mtx_unlock(&sysmaps->lock);
}
+void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+ struct sysmaps *sysmaps;
+ vm_page_t a_pg, b_pg;
+ char *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
+ mtx_lock(&sysmaps->lock);
+ if (*sysmaps->CMAP1 != 0)
+ panic("pmap_copy_pages: CMAP1 busy");
+ if (*sysmaps->CMAP2 != 0)
+ panic("pmap_copy_pages: CMAP2 busy");
+ sched_pin();
+ while (xfersize > 0) {
+ invlpg((u_int)sysmaps->CADDR1);
+ invlpg((u_int)sysmaps->CADDR2);
+ a_pg = ma[a_offset >> PAGE_SHIFT];
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ b_pg = mb[b_offset >> PAGE_SHIFT];
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ *sysmaps->CMAP1 = PG_V | VM_PAGE_TO_PHYS(a_pg) | PG_A |
+ pmap_cache_bits(b_pg->md.pat_mode, 0);
+ *sysmaps->CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(b_pg) | PG_A |
+ PG_M | pmap_cache_bits(b_pg->md.pat_mode, 0);
+ a_cp = sysmaps->CADDR1 + a_pg_offset;
+ b_cp = sysmaps->CADDR2 + b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+ *sysmaps->CMAP1 = 0;
+ *sysmaps->CMAP2 = 0;
+ sched_unpin();
+ mtx_unlock(&sysmaps->lock);
+}
+
/*
* Returns true if the pmap's pv is one of the first
* 16 pvs linked to from this page. This count may
diff --git a/sys/i386/include/pmap.h b/sys/i386/include/pmap.h
index 1de47f2..8c20e1b 100644
--- a/sys/i386/include/pmap.h
+++ b/sys/i386/include/pmap.h
@@ -159,6 +159,8 @@
#include <sys/_lock.h>
#include <sys/_mutex.h>
+#include <vm/_vm_radix.h>
+
#ifdef PAE
typedef uint64_t pdpt_entry_t;
@@ -441,7 +443,7 @@ struct pmap {
pdpt_entry_t *pm_pdpt; /* KVA of page director pointer
table */
#endif
- vm_page_t pm_root; /* spare page table pages */
+ struct vm_radix pm_root; /* spare page table pages */
};
typedef struct pmap *pmap_t;
diff --git a/sys/i386/xen/pmap.c b/sys/i386/xen/pmap.c
index 65e2e76..0f7a80f 100644
--- a/sys/i386/xen/pmap.c
+++ b/sys/i386/xen/pmap.c
@@ -1335,7 +1335,8 @@ pmap_free_zero_pages(vm_page_t free)
while (free != NULL) {
m = free;
- free = m->right;
+ free = (void *)m->object;
+ m->object = NULL;
vm_page_free_zero(m);
}
}
@@ -1393,7 +1394,7 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, vm_page_t *free)
* Put page on a list so that it is released after
* *ALL* TLB shootdown is done
*/
- m->right = *free;
+ m->object = (void *)*free;
*free = m;
}
@@ -2090,7 +2091,7 @@ out:
}
if (m_pc == NULL && pv_vafree != 0 && free != NULL) {
m_pc = free;
- free = m_pc->right;
+ free = (void *)m_pc->object;
/* Recycle a freed page table page. */
m_pc->wire_count = 1;
atomic_add_int(&cnt.v_wire_count, 1);
@@ -3447,6 +3448,46 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
mtx_unlock(&sysmaps->lock);
}
+void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+ struct sysmaps *sysmaps;
+ vm_page_t a_pg, b_pg;
+ char *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
+ mtx_lock(&sysmaps->lock);
+ if (*sysmaps->CMAP1 != 0)
+ panic("pmap_copy_pages: CMAP1 busy");
+ if (*sysmaps->CMAP2 != 0)
+ panic("pmap_copy_pages: CMAP2 busy");
+ sched_pin();
+ while (xfersize > 0) {
+ a_pg = ma[a_offset >> PAGE_SHIFT];
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ b_pg = mb[b_offset >> PAGE_SHIFT];
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ PT_SET_MA(sysmaps->CADDR1, PG_V | VM_PAGE_TO_MACH(a_pg) | PG_A);
+ PT_SET_MA(sysmaps->CADDR2, PG_V | PG_RW |
+ VM_PAGE_TO_MACH(b_pg) | PG_A | PG_M);
+ a_cp = sysmaps->CADDR1 + a_pg_offset;
+ b_cp = sysmaps->CADDR2 + b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+ PT_SET_MA(sysmaps->CADDR1, 0);
+ PT_SET_MA(sysmaps->CADDR2, 0);
+ sched_unpin();
+ mtx_unlock(&sysmaps->lock);
+}
+
/*
* Returns true if the pmap's pv is one of the first
* 16 pvs linked to from this page. This count may
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c
index 1dff1f9..3256600 100644
--- a/sys/ia64/ia64/pmap.c
+++ b/sys/ia64/ia64/pmap.c
@@ -2014,6 +2014,30 @@ pmap_copy_page(vm_page_t msrc, vm_page_t mdst)
bcopy(src, dst, PAGE_SIZE);
}
+void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+ void *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ while (xfersize > 0) {
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ a_cp = (char *)pmap_page_to_va(ma[a_offset >> PAGE_SHIFT]) +
+ a_pg_offset;
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ b_cp = (char *)pmap_page_to_va(mb[b_offset >> PAGE_SHIFT]) +
+ b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+}
+
/*
* Returns true if the pmap's pv is one of the first
* 16 pvs linked to from this page. This count may
diff --git a/sys/kern/capabilities.conf b/sys/kern/capabilities.conf
index 71c22bf..be01c9d 100644
--- a/sys/kern/capabilities.conf
+++ b/sys/kern/capabilities.conf
@@ -446,9 +446,9 @@ olio_listio
## Operations relative to directory capabilities.
##
faccessat
-fstatat
fchmodat
fchownat
+fstatat
futimesat
linkat
mkdirat
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index 8e16ca0..7318d0b 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -661,9 +661,8 @@ __elfN(load_file)(struct proc *p, const char *file, u_long *addr,
}
/* Only support headers that fit within first page for now */
- /* (multiplication of two Elf_Half fields will not overflow) */
if ((hdr->e_phoff > PAGE_SIZE) ||
- (hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE - hdr->e_phoff) {
+ (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
error = ENOEXEC;
goto fail;
}
@@ -743,7 +742,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
*/
if ((hdr->e_phoff > PAGE_SIZE) ||
- (hdr->e_phoff + hdr->e_phentsize * hdr->e_phnum) > PAGE_SIZE) {
+ (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) {
/* Only support headers in first page for now */
return (ENOEXEC);
}
@@ -762,8 +761,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp)
case PT_INTERP:
/* Path to interpreter */
if (phdr[i].p_filesz > MAXPATHLEN ||
- phdr[i].p_offset >= PAGE_SIZE ||
- phdr[i].p_offset + phdr[i].p_filesz >= PAGE_SIZE)
+ phdr[i].p_offset > PAGE_SIZE ||
+ phdr[i].p_filesz > PAGE_SIZE - phdr[i].p_offset)
return (ENOEXEC);
interp = imgp->image_header + phdr[i].p_offset;
interp_name_len = phdr[i].p_filesz;
@@ -1553,9 +1552,8 @@ __elfN(parse_notes)(struct image_params *imgp, Elf_Brandnote *checknote,
const char *note_name;
int i;
- if (pnote == NULL || pnote->p_offset >= PAGE_SIZE ||
- pnote->p_filesz > PAGE_SIZE ||
- pnote->p_offset + pnote->p_filesz >= PAGE_SIZE)
+ if (pnote == NULL || pnote->p_offset > PAGE_SIZE ||
+ pnote->p_filesz > PAGE_SIZE - pnote->p_offset)
return (FALSE);
note = note0 = (const Elf_Note *)(imgp->image_header + pnote->p_offset);
diff --git a/sys/kern/kern_et.c b/sys/kern/kern_et.c
index 472db79..d07316c 100644
--- a/sys/kern/kern_et.c
+++ b/sys/kern/kern_et.c
@@ -168,7 +168,7 @@ et_start(struct eventtimer *et, sbintime_t first, sbintime_t period)
KASSERT(period >= 0, ("et_start: negative period"));
KASSERT((et->et_flags & ET_FLAGS_PERIODIC) || period == 0,
("et_start: period specified for oneshot-only timer"));
- KASSERT((et->et_flags & ET_FLAGS_ONESHOT) && period == 0,
+ KASSERT((et->et_flags & ET_FLAGS_ONESHOT) || period != 0,
("et_start: period not specified for periodic-only timer"));
if (period != 0) {
if (period < et->et_min_period)
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
index bf8141c..d31c832 100644
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -1033,6 +1033,7 @@ racct_proc_throttle(struct proc *p)
p->p_throttled = 1;
FOREACH_THREAD_IN_PROC(p, td) {
+ thread_lock(td);
switch (td->td_state) {
case TDS_RUNQ:
/*
@@ -1041,27 +1042,24 @@ racct_proc_throttle(struct proc *p)
* TDF_NEEDRESCHED for the thread, so that once it is
* running, it is taken off the cpu as soon as possible.
*/
- thread_lock(td);
td->td_flags |= TDF_NEEDRESCHED;
- thread_unlock(td);
break;
case TDS_RUNNING:
/*
* If the thread is running, we request a context
* switch for it by setting the TDF_NEEDRESCHED flag.
*/
- thread_lock(td);
td->td_flags |= TDF_NEEDRESCHED;
#ifdef SMP
cpuid = td->td_oncpu;
if ((cpuid != NOCPU) && (td != curthread))
ipi_cpu(cpuid, IPI_AST);
#endif
- thread_unlock(td);
break;
default:
break;
}
+ thread_unlock(td);
}
}
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 5aae8d8..81471ca 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -85,7 +85,7 @@ SYSINIT(synch_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, synch_setup,
NULL);
int hogticks;
-static int pause_wchan;
+static uint8_t pause_wchan[MAXCPU];
static struct callout loadav_callout;
@@ -198,7 +198,8 @@ _sleep(void *ident, struct lock_object *lock, int priority,
if (TD_ON_SLEEPQ(td))
sleepq_remove(td, td->td_wchan);
- if (ident == &pause_wchan)
+ if ((uint8_t *)ident >= &pause_wchan[0] &&
+ (uint8_t *)ident <= &pause_wchan[MAXCPU - 1])
sleepq_flags = SLEEPQ_PAUSE;
else
sleepq_flags = SLEEPQ_SLEEP;
@@ -372,7 +373,7 @@ pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags)
DELAY((sbt & 0xffffffff) / SBT_1US);
return (0);
}
- return (_sleep(&pause_wchan, NULL, 0, wmesg, sbt, pr, flags));
+ return (_sleep(&pause_wchan[curcpu], NULL, 0, wmesg, sbt, pr, flags));
}
/*
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 4225928..b68c949 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -477,7 +477,7 @@ kern_clock_getres(struct thread *td, clockid_t clock_id, struct timespec *ts)
return (0);
}
-static int nanowait;
+static uint8_t nanowait[MAXCPU];
int
kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt)
@@ -503,8 +503,8 @@ kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt)
if (TIMESEL(&sbt, tmp))
sbt += tc_tick_sbt;
sbt += tmp;
- error = tsleep_sbt(&nanowait, PWAIT | PCATCH, "nanslp", sbt, prec,
- C_ABSOLUTE);
+ error = tsleep_sbt(&nanowait[curcpu], PWAIT | PCATCH, "nanslp",
+ sbt, prec, C_ABSOLUTE);
if (error != EWOULDBLOCK) {
if (error == ERESTART)
error = EINTR;
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index fa82abd..c603d34 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -258,6 +258,8 @@ callout_callwheel_init(void *dummy)
/*
* Calculate the size of the callout wheel and the preallocated
* timeout() structures.
+ * XXX: Clip callout to result of previous function of maxusers
+ * maximum 384. This is still huge, but acceptable.
*/
ncallout = imin(16 + maxproc + maxfiles, 18508);
TUNABLE_INT_FETCH("kern.ncallout", &ncallout);
@@ -294,7 +296,7 @@ callout_cpu_init(struct callout_cpu *cc)
mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE);
SLIST_INIT(&cc->cc_callfree);
- cc->cc_callwheel = malloc(sizeof(struct callout_tailq) * callwheelsize,
+ cc->cc_callwheel = malloc(sizeof(struct callout_list) * callwheelsize,
M_CALLOUT, M_WAITOK);
for (i = 0; i < callwheelsize; i++)
LIST_INIT(&cc->cc_callwheel[i]);
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index 2b7e92f..f50a6f9 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/priv.h>
#include <sys/proc.h>
+#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
@@ -64,6 +65,11 @@ __FBSDID("$FreeBSD$");
#define _UMUTEX_TRY 1
#define _UMUTEX_WAIT 2
+#ifdef UMTX_PROFILING
+#define UPROF_PERC_BIGGER(w, f, sw, sf) \
+ (((w) > (sw)) || ((w) == (sw) && (f) > (sf)))
+#endif
+
/* Priority inheritance mutex info. */
struct umtx_pi {
/* Owner thread */
@@ -157,8 +163,8 @@ struct umtxq_chain {
TAILQ_HEAD(,umtx_pi) uc_pi_list;
#ifdef UMTX_PROFILING
- int length;
- int max_length;
+ u_int length;
+ u_int max_length;
#endif
};
@@ -252,6 +258,117 @@ umtx_init_profiling(void)
"max_length1", CTLFLAG_RD, &umtxq_chains[1][i].max_length, 0, NULL);
}
}
+
+static int
+sysctl_debug_umtx_chains_peaks(SYSCTL_HANDLER_ARGS)
+{
+ char buf[512];
+ struct sbuf sb;
+ struct umtxq_chain *uc;
+ u_int fract, i, j, tot, whole;
+ u_int sf0, sf1, sf2, sf3, sf4;
+ u_int si0, si1, si2, si3, si4;
+ u_int sw0, sw1, sw2, sw3, sw4;
+
+ sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN);
+ for (i = 0; i < 2; i++) {
+ tot = 0;
+ for (j = 0; j < UMTX_CHAINS; ++j) {
+ uc = &umtxq_chains[i][j];
+ mtx_lock(&uc->uc_lock);
+ tot += uc->max_length;
+ mtx_unlock(&uc->uc_lock);
+ }
+ if (tot == 0)
+ sbuf_printf(&sb, "%u) Empty ", i);
+ else {
+ sf0 = sf1 = sf2 = sf3 = sf4 = 0;
+ si0 = si1 = si2 = si3 = si4 = 0;
+ sw0 = sw1 = sw2 = sw3 = sw4 = 0;
+ for (j = 0; j < UMTX_CHAINS; j++) {
+ uc = &umtxq_chains[i][j];
+ mtx_lock(&uc->uc_lock);
+ whole = uc->max_length * 100;
+ mtx_unlock(&uc->uc_lock);
+ fract = (whole % tot) * 100;
+ if (UPROF_PERC_BIGGER(whole, fract, sw0, sf0)) {
+ sf0 = fract;
+ si0 = j;
+ sw0 = whole;
+ } else if (UPROF_PERC_BIGGER(whole, fract, sw1,
+ sf1)) {
+ sf1 = fract;
+ si1 = j;
+ sw1 = whole;
+ } else if (UPROF_PERC_BIGGER(whole, fract, sw2,
+ sf2)) {
+ sf2 = fract;
+ si2 = j;
+ sw2 = whole;
+ } else if (UPROF_PERC_BIGGER(whole, fract, sw3,
+ sf3)) {
+ sf3 = fract;
+ si3 = j;
+ sw3 = whole;
+ } else if (UPROF_PERC_BIGGER(whole, fract, sw4,
+ sf4)) {
+ sf4 = fract;
+ si4 = j;
+ sw4 = whole;
+ }
+ }
+ sbuf_printf(&sb, "queue %u:\n", i);
+ sbuf_printf(&sb, "1st: %u.%u%% idx: %u\n", sw0 / tot,
+ sf0 / tot, si0);
+ sbuf_printf(&sb, "2nd: %u.%u%% idx: %u\n", sw1 / tot,
+ sf1 / tot, si1);
+ sbuf_printf(&sb, "3rd: %u.%u%% idx: %u\n", sw2 / tot,
+ sf2 / tot, si2);
+ sbuf_printf(&sb, "4th: %u.%u%% idx: %u\n", sw3 / tot,
+ sf3 / tot, si3);
+ sbuf_printf(&sb, "5th: %u.%u%% idx: %u\n", sw4 / tot,
+ sf4 / tot, si4);
+ }
+ }
+ sbuf_trim(&sb);
+ sbuf_finish(&sb);
+ sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);
+ sbuf_delete(&sb);
+ return (0);
+}
+
+static int
+sysctl_debug_umtx_chains_clear(SYSCTL_HANDLER_ARGS)
+{
+ struct umtxq_chain *uc;
+ u_int i, j;
+ int clear, error;
+
+ clear = 0;
+ error = sysctl_handle_int(oidp, &clear, 0, req);
+ if (error != 0 || req->newptr == NULL)
+ return (error);
+
+ if (clear != 0) {
+ for (i = 0; i < 2; ++i) {
+ for (j = 0; j < UMTX_CHAINS; ++j) {
+ uc = &umtxq_chains[i][j];
+ mtx_lock(&uc->uc_lock);
+ uc->length = 0;
+ uc->max_length = 0;
+ mtx_unlock(&uc->uc_lock);
+ }
+ }
+ }
+ return (0);
+}
+
+SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, clear,
+ CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0,
+ sysctl_debug_umtx_chains_clear, "I", "Clear umtx chains statistics");
+SYSCTL_PROC(_debug_umtx_chains, OID_AUTO, peaks,
+ CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0,
+ sysctl_debug_umtx_chains_peaks, "A", "Highest peaks in chains max length");
#endif
static void
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c
index 3e1c0c3..1e1e263 100644
--- a/sys/kern/subr_sleepqueue.c
+++ b/sys/kern/subr_sleepqueue.c
@@ -88,16 +88,14 @@ __FBSDID("$FreeBSD$");
#endif
/*
- * Constants for the hash table of sleep queue chains. These constants are
- * the same ones that 4BSD (and possibly earlier versions of BSD) used.
- * Basically, we ignore the lower 8 bits of the address since most wait
- * channel pointers are aligned and only look at the next 7 bits for the
- * hash. SC_TABLESIZE must be a power of two for SC_MASK to work properly.
+ * Constants for the hash table of sleep queue chains.
+ * SC_TABLESIZE must be a power of two for SC_MASK to work properly.
*/
-#define SC_TABLESIZE 128 /* Must be power of 2. */
+#define SC_TABLESIZE 256 /* Must be power of 2. */
#define SC_MASK (SC_TABLESIZE - 1)
#define SC_SHIFT 8
-#define SC_HASH(wc) (((uintptr_t)(wc) >> SC_SHIFT) & SC_MASK)
+#define SC_HASH(wc) ((((uintptr_t)(wc) >> SC_SHIFT) ^ (uintptr_t)(wc)) & \
+ SC_MASK)
#define SC_LOOKUP(wc) &sleepq_chains[SC_HASH(wc)]
#define NR_SLEEPQS 2
/*
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 1f24e88..11a4bc4 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -100,9 +100,6 @@ void
userret(struct thread *td, struct trapframe *frame)
{
struct proc *p = td->td_proc;
-#ifdef RACCT
- int sig;
-#endif
CTR3(KTR_SYSC, "userret: thread %p (pid %d, %s)", td, p->p_pid,
td->td_name);
@@ -175,12 +172,8 @@ userret(struct thread *td, struct trapframe *frame)
#endif
#ifdef RACCT
PROC_LOCK(p);
- while (p->p_throttled == 1) {
- sig = msleep(p->p_racct, &p->p_mtx, PCATCH | PBDRY, "racct",
- hz);
- if ((sig == EINTR) || (sig == ERESTART))
- break;
- }
+ while (p->p_throttled == 1)
+ msleep(p->p_racct, &p->p_mtx, 0, "racct", 0);
PROC_UNLOCK(p);
#endif
}
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 4606f37..ea4fd80 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -88,11 +88,10 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, m_defragrandomfailures, CTLFLAG_RW,
* m_get2() allocates minimum mbuf that would fit "size" argument.
*/
struct mbuf *
-m_get2(int how, short type, int flags, int size)
+m_get2(int size, int how, short type, int flags)
{
struct mb_args args;
struct mbuf *m, *n;
- uma_zone_t zone;
args.flags = flags;
args.type = type;
@@ -101,24 +100,15 @@ m_get2(int how, short type, int flags, int size)
return (uma_zalloc_arg(zone_mbuf, &args, how));
if (size <= MCLBYTES)
return (uma_zalloc_arg(zone_pack, &args, how));
- if (size > MJUM16BYTES)
+
+ if (size > MJUMPAGESIZE)
return (NULL);
m = uma_zalloc_arg(zone_mbuf, &args, how);
if (m == NULL)
return (NULL);
-#if MJUMPAGESIZE != MCLBYTES
- if (size <= MJUMPAGESIZE)
- zone = zone_jumbop;
- else
-#endif
- if (size <= MJUM9BYTES)
- zone = zone_jumbo9;
- else
- zone = zone_jumbo16;
-
- n = uma_zalloc_arg(zone, m, how);
+ n = uma_zalloc_arg(zone_jumbop, m, how);
if (n == NULL) {
uma_zfree(zone_mbuf, m);
return (NULL);
@@ -255,25 +245,30 @@ m_freem(struct mbuf *mb)
* Returns:
* Nothing.
*/
-void
+int
m_extadd(struct mbuf *mb, caddr_t buf, u_int size,
- void (*freef)(void *, void *), void *arg1, void *arg2, int flags, int type)
+ void (*freef)(void *, void *), void *arg1, void *arg2, int flags, int type,
+ int wait)
{
KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__));
if (type != EXT_EXTREF)
- mb->m_ext.ref_cnt = (u_int *)uma_zalloc(zone_ext_refcnt, M_NOWAIT);
- if (mb->m_ext.ref_cnt != NULL) {
- *(mb->m_ext.ref_cnt) = 1;
- mb->m_flags |= (M_EXT | flags);
- mb->m_ext.ext_buf = buf;
- mb->m_data = mb->m_ext.ext_buf;
- mb->m_ext.ext_size = size;
- mb->m_ext.ext_free = freef;
- mb->m_ext.ext_arg1 = arg1;
- mb->m_ext.ext_arg2 = arg2;
- mb->m_ext.ext_type = type;
- }
+ mb->m_ext.ref_cnt = uma_zalloc(zone_ext_refcnt, wait);
+
+ if (mb->m_ext.ref_cnt == NULL)
+ return (ENOMEM);
+
+ *(mb->m_ext.ref_cnt) = 1;
+ mb->m_flags |= (M_EXT | flags);
+ mb->m_ext.ext_buf = buf;
+ mb->m_data = mb->m_ext.ext_buf;
+ mb->m_ext.ext_size = size;
+ mb->m_ext.ext_free = freef;
+ mb->m_ext.ext_arg1 = arg1;
+ mb->m_ext.ext_arg2 = arg2;
+ mb->m_ext.ext_type = type;
+
+ return (0);
}
/*
@@ -400,7 +395,7 @@ m_demote(struct mbuf *m0, int all)
m_freem(m->m_nextpkt);
m->m_nextpkt = NULL;
}
- m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_FREELIST|M_NOFREE);
+ m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE);
}
}
@@ -535,8 +530,8 @@ m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int how)
#if 0
/*
* The mbuf allocator only initializes the pkthdr
- * when the mbuf is allocated with MGETHDR. Many users
- * (e.g. m_copy*, m_prepend) use MGET and then
+ * when the mbuf is allocated with m_gethdr(). Many users
+ * (e.g. m_copy*, m_prepend) use m_get() and then
* smash the pkthdr as needed causing these
* assertions to trip. For now just disable them.
*/
@@ -568,15 +563,15 @@ m_prepend(struct mbuf *m, int len, int how)
struct mbuf *mn;
if (m->m_flags & M_PKTHDR)
- MGETHDR(mn, how, m->m_type);
+ mn = m_gethdr(how, m->m_type);
else
- MGET(mn, how, m->m_type);
+ mn = m_get(how, m->m_type);
if (mn == NULL) {
m_freem(m);
return (NULL);
}
if (m->m_flags & M_PKTHDR)
- M_MOVE_PKTHDR(mn, m);
+ m_move_pkthdr(mn, m);
mn->m_next = m;
m = mn;
if(m->m_flags & M_PKTHDR) {
@@ -626,9 +621,9 @@ m_copym(struct mbuf *m, int off0, int len, int wait)
break;
}
if (copyhdr)
- MGETHDR(n, wait, m->m_type);
+ n = m_gethdr(wait, m->m_type);
else
- MGET(n, wait, m->m_type);
+ n = m_get(wait, m->m_type);
*np = n;
if (n == NULL)
goto nospace;
@@ -827,7 +822,7 @@ m_copypacket(struct mbuf *m, int how)
struct mbuf *top, *n, *o;
MBUF_CHECKSLEEP(how);
- MGET(n, how, m->m_type);
+ n = m_get(how, m->m_type);
top = n;
if (n == NULL)
goto nospace;
@@ -845,7 +840,7 @@ m_copypacket(struct mbuf *m, int how)
m = m->m_next;
while (m) {
- MGET(o, how, m->m_type);
+ o = m_get(how, m->m_type);
if (o == NULL)
goto nospace;
@@ -1101,12 +1096,11 @@ m_pullup(struct mbuf *n, int len)
} else {
if (len > MHLEN)
goto bad;
- MGET(m, M_NOWAIT, n->m_type);
+ m = m_get(M_NOWAIT, n->m_type);
if (m == NULL)
goto bad;
- m->m_len = 0;
if (n->m_flags & M_PKTHDR)
- M_MOVE_PKTHDR(m, n);
+ m_move_pkthdr(m, n);
}
space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
do {
@@ -1149,12 +1143,11 @@ m_copyup(struct mbuf *n, int len, int dstoff)
if (len > (MHLEN - dstoff))
goto bad;
- MGET(m, M_NOWAIT, n->m_type);
+ m = m_get(M_NOWAIT, n->m_type);
if (m == NULL)
goto bad;
- m->m_len = 0;
if (n->m_flags & M_PKTHDR)
- M_MOVE_PKTHDR(m, n);
+ m_move_pkthdr(m, n);
m->m_data += dstoff;
space = &m->m_dat[MLEN] - (m->m_data + m->m_len);
do {
@@ -1205,7 +1198,7 @@ m_split(struct mbuf *m0, int len0, int wait)
return (NULL);
remain = m->m_len - len;
if (m0->m_flags & M_PKTHDR) {
- MGETHDR(n, wait, m0->m_type);
+ n = m_gethdr(wait, m0->m_type);
if (n == NULL)
return (NULL);
n->m_pkthdr.rcvif = m0->m_pkthdr.rcvif;
@@ -1231,7 +1224,7 @@ m_split(struct mbuf *m0, int len0, int wait)
m->m_next = NULL;
return (n);
} else {
- MGET(n, wait, m->m_type);
+ n = m_get(wait, m->m_type);
if (n == NULL)
return (NULL);
M_ALIGN(n, remain);
@@ -1884,14 +1877,22 @@ m_mbuftouio(struct uio *uio, struct mbuf *m, int len)
void
m_align(struct mbuf *m, int len)
{
+#ifdef INVARIANTS
+ const char *msg = "%s: not a virgin mbuf";
+#endif
int adjust;
- if (m->m_flags & M_EXT)
+ if (m->m_flags & M_EXT) {
+ KASSERT(m->m_data == m->m_ext.ext_buf, (msg, __func__));
adjust = m->m_ext.ext_size - len;
- else if (m->m_flags & M_PKTHDR)
+ } else if (m->m_flags & M_PKTHDR) {
+ KASSERT(m->m_data == m->m_pktdat, (msg, __func__));
adjust = MHLEN - len;
- else
+ } else {
+ KASSERT(m->m_data == m->m_dat, (msg, __func__));
adjust = MLEN - len;
+ }
+
m->m_data += adjust &~ (sizeof(long)-1);
}
@@ -1973,43 +1974,18 @@ m_unshare(struct mbuf *m0, int how)
}
/*
- * Allocate new space to hold the copy...
- */
- /* XXX why can M_PKTHDR be set past the first mbuf? */
- if (mprev == NULL && (m->m_flags & M_PKTHDR)) {
- /*
- * NB: if a packet header is present we must
- * allocate the mbuf separately from any cluster
- * because M_MOVE_PKTHDR will smash the data
- * pointer and drop the M_EXT marker.
- */
- MGETHDR(n, how, m->m_type);
- if (n == NULL) {
- m_freem(m0);
- return (NULL);
- }
- M_MOVE_PKTHDR(n, m);
- MCLGET(n, how);
- if ((n->m_flags & M_EXT) == 0) {
- m_free(n);
- m_freem(m0);
- return (NULL);
- }
- } else {
- n = m_getcl(how, m->m_type, m->m_flags);
- if (n == NULL) {
- m_freem(m0);
- return (NULL);
- }
- }
- /*
- * ... and copy the data. We deal with jumbo mbufs
- * (i.e. m_len > MCLBYTES) by splitting them into
- * clusters. We could just malloc a buffer and make
- * it external but too many device drivers don't know
- * how to break up the non-contiguous memory when
+ * Allocate new space to hold the copy and copy the data.
+ * We deal with jumbo mbufs (i.e. m_len > MCLBYTES) by
+ * splitting them into clusters. We could just malloc a
+ * buffer and make it external but too many device drivers
+ * don't know how to break up the non-contiguous memory when
* doing DMA.
*/
+ n = m_getcl(how, m->m_type, m->m_flags);
+ if (n == NULL) {
+ m_freem(m0);
+ return (NULL);
+ }
len = m->m_len;
off = 0;
mfirst = n;
diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index 6325840..93c96bf 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -644,8 +644,8 @@ sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa,
if (asa->sa_len > MLEN)
return (0);
#endif
- MGET(m, M_NOWAIT, MT_SONAME);
- if (m == 0)
+ m = m_get(M_NOWAIT, MT_SONAME);
+ if (m == NULL)
return (0);
m->m_len = asa->sa_len;
bcopy(asa, mtod(m, caddr_t), asa->sa_len);
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 7fcac1c..aa5448c 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -136,6 +136,7 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <sys/jail.h>
#include <sys/syslog.h>
+#include <netinet/in.h>
#include <net/vnet.h>
@@ -565,8 +566,12 @@ sonewconn(struct socket *head, int connstatus)
/*
* The accept socket may be tearing down but we just
* won a race on the ACCEPT_LOCK.
+ * However, if sctp_peeloff() is called on a 1-to-many
+ * style socket, the SO_ACCEPTCONN doesn't need to be set.
*/
- if (!(head->so_options & SO_ACCEPTCONN)) {
+ if (!(head->so_options & SO_ACCEPTCONN) &&
+ ((head->so_proto->pr_protocol != IPPROTO_SCTP) ||
+ (head->so_type != SOCK_SEQPACKET))) {
SOCK_LOCK(so);
so->so_head = NULL;
sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 894cffc..3a2f032 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1701,18 +1701,16 @@ sockargs(mp, buf, buflen, type)
struct mbuf *m;
int error;
- if ((u_int)buflen > MLEN) {
+ if (buflen > MLEN) {
#ifdef COMPAT_OLDSOCK
- if (type == MT_SONAME && (u_int)buflen <= 112)
+ if (type == MT_SONAME && buflen <= 112)
buflen = MLEN; /* unix domain compat. hack */
else
#endif
- if ((u_int)buflen > MCLBYTES)
+ if (buflen > MCLBYTES)
return (EINVAL);
}
- m = m_get(M_WAITOK, type);
- if ((u_int)buflen > MLEN)
- MCLGET(m, M_WAITOK);
+ m = m_get2(buflen, M_WAITOK, type, 0);
m->m_len = buflen;
error = copyin(buf, mtod(m, caddr_t), (u_int)buflen);
if (error)
@@ -2222,8 +2220,14 @@ retry_space:
sf_buf_mext((void *)sf_buf_kva(sf), sf);
break;
}
- MEXTADD(m0, sf_buf_kva(sf), PAGE_SIZE, sf_buf_mext,
- sfs, sf, M_RDONLY, EXT_SFBUF);
+ if (m_extadd(m0, (caddr_t )sf_buf_kva(sf), PAGE_SIZE,
+ sf_buf_mext, sfs, sf, M_RDONLY, EXT_SFBUF,
+ (mnw ? M_NOWAIT : M_WAITOK)) != 0) {
+ error = (mnw ? EAGAIN : ENOBUFS);
+ sf_buf_mext((void *)sf_buf_kva(sf), sf);
+ m_freem(m0);
+ break;
+ }
m0->m_data = (char *)sf_buf_kva(sf) + pgoff;
m0->m_len = xfsize;
@@ -2386,8 +2390,10 @@ sys_sctp_peeloff(td, uap)
CURVNET_SET(head->so_vnet);
so = sonewconn(head, SS_ISCONNECTED);
- if (so == NULL)
+ if (so == NULL) {
+ error = ENOMEM;
goto noconnection;
+ }
/*
* Before changing the flags on the socket, we have to bump the
* reference count. Otherwise, if the protocol calls sofree(),
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index dcd8c4e..2ec83c5 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -282,7 +282,7 @@ static void unp_dispose(struct mbuf *);
static void unp_shutdown(struct unpcb *);
static void unp_drop(struct unpcb *, int);
static void unp_gc(__unused void *, int);
-static void unp_scan(struct mbuf *, void (*)(struct file *));
+static void unp_scan(struct mbuf *, void (*)(struct filedescent **, int));
static void unp_discard(struct file *);
static void unp_freerights(struct filedescent **, int);
static void unp_init(void);
@@ -2135,17 +2135,22 @@ static int unp_marked;
static int unp_unreachable;
static void
-unp_accessable(struct file *fp)
+unp_accessable(struct filedescent **fdep, int fdcount)
{
struct unpcb *unp;
+ struct file *fp;
+ int i;
- if ((unp = fptounp(fp)) == NULL)
- return;
- if (unp->unp_gcflag & UNPGC_REF)
- return;
- unp->unp_gcflag &= ~UNPGC_DEAD;
- unp->unp_gcflag |= UNPGC_REF;
- unp_marked++;
+ for (i = 0; i < fdcount; i++) {
+ fp = fdep[i]->fde_file;
+ if ((unp = fptounp(fp)) == NULL)
+ continue;
+ if (unp->unp_gcflag & UNPGC_REF)
+ continue;
+ unp->unp_gcflag &= ~UNPGC_DEAD;
+ unp->unp_gcflag |= UNPGC_REF;
+ unp_marked++;
+ }
}
static void
@@ -2292,19 +2297,16 @@ unp_dispose(struct mbuf *m)
{
if (m)
- unp_scan(m, unp_discard);
+ unp_scan(m, unp_freerights);
}
static void
-unp_scan(struct mbuf *m0, void (*op)(struct file *))
+unp_scan(struct mbuf *m0, void (*op)(struct filedescent **, int))
{
struct mbuf *m;
- struct filedescent **fdep;
struct cmsghdr *cm;
void *data;
- int i;
socklen_t clen, datalen;
- int qfds;
while (m0 != NULL) {
for (m = m0; m; m = m->m_next) {
@@ -2324,10 +2326,8 @@ unp_scan(struct mbuf *m0, void (*op)(struct file *))
if (cm->cmsg_level == SOL_SOCKET &&
cm->cmsg_type == SCM_RIGHTS) {
- qfds = datalen / sizeof(*fdep);
- fdep = data;
- for (i = 0; i < qfds; i++)
- (*op)(fdep[i]->fde_file);
+ (*op)(data, datalen /
+ sizeof(struct filedescent *));
}
if (CMSG_SPACE(datalen) < clen) {
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 6d110ab..d20c829 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -830,9 +830,8 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rabsize,
* getblk(). Also starts asynchronous I/O on read-ahead blocks.
*/
int
-breadn_flags(struct vnode * vp, daddr_t blkno, int size,
- daddr_t * rablkno, int *rabsize, int cnt,
- struct ucred * cred, int flags, struct buf **bpp)
+breadn_flags(struct vnode *vp, daddr_t blkno, int size, daddr_t *rablkno,
+ int *rabsize, int cnt, struct ucred *cred, int flags, struct buf **bpp)
{
struct buf *bp;
int rv = 0, readwait = 0;
@@ -1794,8 +1793,9 @@ vfs_bio_awrite(struct buf *bp)
*/
if (ncl != 1) {
BUF_UNLOCK(bp);
- nwritten = cluster_wbuild(vp, size, lblkno - j, ncl);
- return nwritten;
+ nwritten = cluster_wbuild(vp, size, lblkno - j, ncl,
+ 0);
+ return (nwritten);
}
}
bremfree(bp);
@@ -1808,7 +1808,7 @@ vfs_bio_awrite(struct buf *bp)
nwritten = bp->b_bufsize;
(void) bwrite(bp);
- return nwritten;
+ return (nwritten);
}
/*
@@ -2630,7 +2630,7 @@ vfs_setdirty_locked_object(struct buf *bp)
* prior to issuing the READ. biodone() will *not* clear B_INVAL.
*/
struct buf *
-getblk(struct vnode * vp, daddr_t blkno, int size, int slpflag, int slptimeo,
+getblk(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo,
int flags)
{
struct buf *bp;
@@ -2708,9 +2708,8 @@ loop:
}
/*
- * check for size inconsistancies for non-VMIO case.
+ * check for size inconsistencies for non-VMIO case.
*/
-
if (bp->b_bcount != size) {
if ((bp->b_flags & B_VMIO) == 0 ||
(size > bp->b_kvasize)) {
@@ -3712,8 +3711,7 @@ vfs_bio_set_valid(struct buf *bp, int base, int size)
void
vfs_bio_clrbuf(struct buf *bp)
{
- int i, j, mask;
- caddr_t sa, ea;
+ int i, j, mask, sa, ea, slide;
if ((bp->b_flags & (B_VMIO | B_MALLOC)) != B_VMIO) {
clrbuf(bp);
@@ -3731,30 +3729,33 @@ vfs_bio_clrbuf(struct buf *bp)
if ((bp->b_pages[0]->valid & mask) == mask)
goto unlock;
if ((bp->b_pages[0]->valid & mask) == 0) {
- bzero(bp->b_data, bp->b_bufsize);
+ pmap_zero_page_area(bp->b_pages[0], 0, bp->b_bufsize);
bp->b_pages[0]->valid |= mask;
goto unlock;
}
}
- ea = sa = bp->b_data;
- for(i = 0; i < bp->b_npages; i++, sa = ea) {
- ea = (caddr_t)trunc_page((vm_offset_t)sa + PAGE_SIZE);
- ea = (caddr_t)(vm_offset_t)ulmin(
- (u_long)(vm_offset_t)ea,
- (u_long)(vm_offset_t)bp->b_data + bp->b_bufsize);
+ sa = bp->b_offset & PAGE_MASK;
+ slide = 0;
+ for (i = 0; i < bp->b_npages; i++, sa = 0) {
+ slide = imin(slide + PAGE_SIZE, bp->b_offset + bp->b_bufsize);
+ ea = slide & PAGE_MASK;
+ if (ea == 0)
+ ea = PAGE_SIZE;
if (bp->b_pages[i] == bogus_page)
continue;
- j = ((vm_offset_t)sa & PAGE_MASK) / DEV_BSIZE;
+ j = sa / DEV_BSIZE;
mask = ((1 << ((ea - sa) / DEV_BSIZE)) - 1) << j;
VM_OBJECT_ASSERT_WLOCKED(bp->b_pages[i]->object);
if ((bp->b_pages[i]->valid & mask) == mask)
continue;
if ((bp->b_pages[i]->valid & mask) == 0)
- bzero(sa, ea - sa);
+ pmap_zero_page_area(bp->b_pages[i], sa, ea - sa);
else {
for (; sa < ea; sa += DEV_BSIZE, j++) {
- if ((bp->b_pages[i]->valid & (1 << j)) == 0)
- bzero(sa, DEV_BSIZE);
+ if ((bp->b_pages[i]->valid & (1 << j)) == 0) {
+ pmap_zero_page_area(bp->b_pages[i],
+ sa, DEV_BSIZE);
+ }
}
}
bp->b_pages[i]->valid |= mask;
diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c
index 70937a2..28aa4ff 100644
--- a/sys/kern/vfs_cluster.c
+++ b/sys/kern/vfs_cluster.c
@@ -84,15 +84,9 @@ extern vm_page_t bogus_page;
* cluster_read replaces bread.
*/
int
-cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp)
- struct vnode *vp;
- u_quad_t filesize;
- daddr_t lblkno;
- long size;
- struct ucred *cred;
- long totread;
- int seqcount;
- struct buf **bpp;
+cluster_read(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size,
+ struct ucred *cred, long totread, int seqcount, int gbflags,
+ struct buf **bpp)
{
struct buf *bp, *rbp, *reqbp;
struct bufobj *bo;
@@ -569,14 +563,14 @@ cluster_wbuild_wb(struct vnode *vp, long size, daddr_t start_lbn, int len)
{
int r = 0;
- switch(write_behind) {
+ switch (write_behind) {
case 2:
if (start_lbn < len)
break;
start_lbn -= len;
/* FALLTHROUGH */
case 1:
- r = cluster_wbuild(vp, size, start_lbn, len);
+ r = cluster_wbuild(vp, size, start_lbn, len, 0);
/* FALLTHROUGH */
default:
/* FALLTHROUGH */
@@ -596,7 +590,8 @@ cluster_wbuild_wb(struct vnode *vp, long size, daddr_t start_lbn, int len)
* 4. end of a cluster - asynchronously write cluster
*/
void
-cluster_write(struct vnode *vp, struct buf *bp, u_quad_t filesize, int seqcount)
+cluster_write(struct vnode *vp, struct buf *bp, u_quad_t filesize, int seqcount,
+ int gbflags)
{
daddr_t lbn;
int maxclen, cursize;
@@ -742,11 +737,8 @@ cluster_write(struct vnode *vp, struct buf *bp, u_quad_t filesize, int seqcount)
* the current block (if last_bp == NULL).
*/
int
-cluster_wbuild(vp, size, start_lbn, len)
- struct vnode *vp;
- long size;
- daddr_t start_lbn;
- int len;
+cluster_wbuild(struct vnode *vp, long size, daddr_t start_lbn, int len,
+ int gbflags)
{
struct buf *bp, *tbp;
struct bufobj *bo;
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index fc78235..1c361bd 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -445,7 +445,7 @@ sys_getfsstat(td, uap)
/*
* If (bufsize > 0 && bufseg == UIO_SYSSPACE)
- * The caller is responsible for freeing memory which will be allocated
+ * The caller is responsible for freeing memory which will be allocated
* in '*buf'.
*/
int
@@ -971,7 +971,7 @@ flags_to_rights(int flags)
/* FALLTHROUGH */
case O_WRONLY:
rights |= CAP_WRITE;
- if (!(flags & O_APPEND))
+ if (!(flags & (O_APPEND | O_TRUNC)))
rights |= CAP_SEEK;
break;
}
@@ -2843,7 +2843,6 @@ sys_lchmod(td, uap)
uap->mode, AT_SYMLINK_NOFOLLOW));
}
-
int
kern_fchmodat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
mode_t mode, int flag)
@@ -2854,7 +2853,7 @@ kern_fchmodat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
AUDIT_ARG_MODE(mode);
follow = (flag & AT_SYMLINK_NOFOLLOW) ? NOFOLLOW : FOLLOW;
- NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd,
+ NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path, fd,
CAP_FCHMOD, td);
if ((error = namei(&nd)) != 0)
return (error);
@@ -4679,7 +4678,7 @@ kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len,
new = fa;
fp->f_advice = NULL;
} else if (offset <= fa->fa_start &&
- end >= fa->fa_start)
+ end >= fa->fa_start)
fa->fa_start = end + 1;
else if (offset <= fa->fa_end && end >= fa->fa_end)
fa->fa_end = offset - 1;
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index d367340..c8f832f 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -7,6 +7,12 @@
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
+ * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
+ * Copyright (c) 2013 The FreeBSD Foundation
+ *
+ * Portions of this software were developed by Konstantin Belousov
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -1122,6 +1128,45 @@ vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio)
return (error);
}
+int
+vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize,
+ struct uio *uio)
+{
+ struct thread *td;
+ vm_offset_t iov_base;
+ int cnt, pgadv;
+
+ td = curthread;
+ if ((td->td_pflags & TDP_UIOHELD) == 0 ||
+ uio->uio_segflg != UIO_USERSPACE)
+ return (uiomove_fromphys(ma, offset, xfersize, uio));
+
+ KASSERT(uio->uio_iovcnt == 1, ("uio_iovcnt %d", uio->uio_iovcnt));
+ cnt = xfersize > uio->uio_resid ? uio->uio_resid : xfersize;
+ iov_base = (vm_offset_t)uio->uio_iov->iov_base;
+ switch (uio->uio_rw) {
+ case UIO_WRITE:
+ pmap_copy_pages(td->td_ma, iov_base & PAGE_MASK, ma,
+ offset, cnt);
+ break;
+ case UIO_READ:
+ pmap_copy_pages(ma, offset, td->td_ma, iov_base & PAGE_MASK,
+ cnt);
+ break;
+ }
+ pgadv = ((iov_base + cnt) >> PAGE_SHIFT) - (iov_base >> PAGE_SHIFT);
+ td->td_ma += pgadv;
+ KASSERT(td->td_ma_cnt >= pgadv, ("consumed pages %d %d", td->td_ma_cnt,
+ pgadv));
+ td->td_ma_cnt -= pgadv;
+ uio->uio_iov->iov_base = (char *)(iov_base + cnt);
+ uio->uio_iov->iov_len -= cnt;
+ uio->uio_resid -= cnt;
+ uio->uio_offset += cnt;
+ return (0);
+}
+
+
/*
* File table truncate routine.
*/
diff --git a/sys/netncp/ncpio.h b/sys/libkern/arm/aeabi_unwind.c
index 53c90ea..098e6e6 100644
--- a/sys/netncp/ncpio.h
+++ b/sys/libkern/arm/aeabi_unwind.c
@@ -1,5 +1,5 @@
-/*-
- * Copyright (c) 2003 Tim J. Robbins.
+/*
+ * Copyright (C) 2013 Andrew Turner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,40 +23,36 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
*/
-#ifndef _NETNCP_NCPIO_H_
-#define _NETNCP_NCPIO_H_
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
-#ifndef _KERNEL
#include <sys/types.h>
+#include <sys/systm.h>
+
+#ifdef __ARM_EABI__
+/* We need to provide these functions never call them */
+void __aeabi_unwind_cpp_pr0(void);
+void __aeabi_unwind_cpp_pr1(void);
+void __aeabi_unwind_cpp_pr2(void);
+
+void
+__aeabi_unwind_cpp_pr0(void)
+{
+ panic("__aeabi_unwind_cpp_pr0");
+}
+
+void
+__aeabi_unwind_cpp_pr1(void)
+{
+ panic("__aeabi_unwind_cpp_pr1");
+}
+
+void
+__aeabi_unwind_cpp_pr2(void)
+{
+ panic("__aeabi_unwind_cpp_pr2");
+}
#endif
-#include <sys/ioccom.h>
-#define NCP_NAME "ncp"
-
-struct ncp_conn_args;
-struct ncp_buf;
-
-struct ncpioc_connect {
- struct ncp_conn_args *ioc_li;
- int *ioc_connhandle;
-};
-
-struct ncpioc_request {
- int ioc_connhandle;
- int ioc_fn;
- struct ncp_buf *ioc_ncpbuf;
-};
-
-struct ncpioc_connscan {
- struct ncp_conn_args *ioc_li;
- int *ioc_connhandle;
-};
-
-#define NCPIOC_CONNECT _IOW('N', 100, struct ncpioc_connect)
-#define NCPIOC_REQUEST _IOW('N', 101, struct ncpioc_request)
-#define NCPIOC_CONNSCAN _IOW('N', 102, struct ncpioc_connscan)
-
-#endif /* _NETNCP_NCPIO_H_ */
diff --git a/sys/libkern/arm/divsi3.S b/sys/libkern/arm/divsi3.S
index 700ae37..302f179 100644
--- a/sys/libkern/arm/divsi3.S
+++ b/sys/libkern/arm/divsi3.S
@@ -29,6 +29,7 @@ ENTRY_NP(__umodsi3)
add sp, sp, #4 /* unalign stack */
mov r0, r1
ldmfd sp!, {pc}
+END(__umodsi3)
ENTRY_NP(__modsi3)
stmfd sp!, {lr}
@@ -48,6 +49,7 @@ ENTRY_NP(__modsi3)
mvn r0, #0
#endif
RET
+END(__modsi3)
#ifdef __ARM_EABI__
ENTRY_NP(__aeabi_uidiv)
@@ -74,6 +76,11 @@ ENTRY_NP(__udivsi3)
mov r0, r1
mov r1, #0
RET
+#ifdef __ARM_EABI__
+END(__aeabi_uidiv)
+END(__aeabi_uidivmod)
+#endif
+END(__udivsi3)
#ifdef __ARM_EABI__
ENTRY_NP(__aeabi_idiv)
@@ -393,3 +400,9 @@ ENTRY_NP(__divsi3)
addhs r3, r3, r2
mov r0, r3
RET
+#ifdef __ARM_EABI__
+END(__aeabi_idiv)
+END(__aeabi_idivmod)
+#endif
+END(__divsi3)
+
diff --git a/sys/libkern/arm/ffs.S b/sys/libkern/arm/ffs.S
index ba0af49..a43f2b6 100644
--- a/sys/libkern/arm/ffs.S
+++ b/sys/libkern/arm/ffs.S
@@ -82,3 +82,5 @@ ENTRY(ffs)
rsbne r0, r0, #32
RET
#endif
+END(ffs)
+
diff --git a/sys/libkern/arm/ldivmod.S b/sys/libkern/arm/ldivmod.S
index a88db54..26a3944 100644
--- a/sys/libkern/arm/ldivmod.S
+++ b/sys/libkern/arm/ldivmod.S
@@ -53,6 +53,7 @@ ENTRY_NP(__aeabi_ldivmod)
add sp, sp, #8 /* Move sp to the remainder value */
ldmfd sp!, {r2, r3} /* Load the remainder */
RET
+END(__aeabi_ldivmod)
ENTRY_NP(__aeabi_uldivmod)
sub sp, sp, #8 /* Space for the remainder */
@@ -62,6 +63,7 @@ ENTRY_NP(__aeabi_uldivmod)
add sp, sp, #8 /* Move sp to the remainder value */
ldmfd sp!, {r2, r3} /* Load the remainder */
RET
+END(__aeabi_uldivmod)
#endif
diff --git a/sys/netncp/ncp_login.c b/sys/libkern/arm/memcpy.S
index bce8e68..9fca8f6 100644
--- a/sys/netncp/ncp_login.c
+++ b/sys/libkern/arm/memcpy.S
@@ -1,5 +1,5 @@
-/*-
- * Copyright (c) 1999, 2000, 2001 Boris Popov
+/*
+ * Copyright (C) 2013 Andrew Turner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,22 +22,17 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
*/
-#include <sys/cdefs.h>
+#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
+#ifdef __ARM_EABI__
+
+ENTRY_NP(__aeabi_memcpy)
+ b memcpy
+END(__aeabi_memcpy)
+
+#endif
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_ncp.h>
-#include <netncp/ncp_rq.h>
-#include <netncp/ncp_nls.h>
-#include <netncp/nwerror.h>
diff --git a/usr.bin/vis/extern.h b/sys/libkern/arm/memset.S
index 683402b..57d2507 100644
--- a/usr.bin/vis/extern.h
+++ b/sys/libkern/arm/memset.S
@@ -1,6 +1,6 @@
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
+/*
+ * Copyright (C) 2013 Andrew Turner
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,14 +10,11 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -26,7 +23,27 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
*/
-extern int foldit(char *, int, int);
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
+#ifdef __ARM_EABI__
+
+/*
+ * This implements
+ * void __aeabi_memset(void *dest, size_t len, int c)
+ * by calling:
+ * void *memset(dest, c, len)
+ *
+ * The arguments are in r0-r2, r3 can be used as a scratch register.
+ */
+ENTRY_NP(__aeabi_memset)
+ mov r3, r2
+ mov r2, r1
+ mov r1, r3
+ b memset
+END(__aeabi_memset)
+
+#endif
+
diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c
index 9e1b812..4fe6ebe 100644
--- a/sys/mips/mips/pmap.c
+++ b/sys/mips/mips/pmap.c
@@ -2576,6 +2576,51 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
}
}
+void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+ char *a_cp, *b_cp;
+ vm_page_t a_m, b_m;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ vm_paddr_t a_phys, b_phys;
+ int cnt;
+
+ while (xfersize > 0) {
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ a_m = ma[a_offset >> PAGE_SHIFT];
+ a_phys = VM_PAGE_TO_PHYS(a_m);
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ b_m = mb[b_offset >> PAGE_SHIFT];
+ b_phys = VM_PAGE_TO_PHYS(b_m);
+ if (MIPS_DIRECT_MAPPABLE(a_phys) &&
+ MIPS_DIRECT_MAPPABLE(b_phys)) {
+ pmap_flush_pvcache(a_m);
+ mips_dcache_wbinv_range_index(
+ MIPS_PHYS_TO_DIRECT(b_phys), PAGE_SIZE);
+ a_cp = (char *)MIPS_PHYS_TO_DIRECT(a_phys) +
+ a_pg_offset;
+ b_cp = (char *)MIPS_PHYS_TO_DIRECT(b_phys) +
+ b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ mips_dcache_wbinv_range((vm_offset_t)b_cp, cnt);
+ } else {
+ a_cp = (char *)pmap_lmem_map2(a_phys, b_phys);
+ b_cp = (char *)a_cp + PAGE_SIZE;
+ a_cp += a_pg_offset;
+ b_cp += b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ mips_dcache_wbinv_range((vm_offset_t)b_cp, cnt);
+ pmap_lmem_unmap();
+ }
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+}
+
/*
* Returns true if the pmap's pv is one of the first
* 16 pvs linked to from this page. This count may
diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile
index 4f96c63..a880645 100644
--- a/sys/modules/ath/Makefile
+++ b/sys/modules/ath/Makefile
@@ -124,7 +124,7 @@ SRCS+= ah_eeprom_9287.c
SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c
# + AR9300 HAL
-# .PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9003
+# .PATH: ${.CURDIR}/../../contrib/sys/dev/ath/ath_hal/ar9300
#SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c
#SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c
#SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c
@@ -149,6 +149,7 @@ SRCS+= amrr.c
SRCS+= dfs_null.c
CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal
+# CFLAGS+= -I. -I${.CURDIR}/../../contrib/sys/dev/ath/ath_hal/
.if !defined(KERNBUILDDIR)
opt_ah.h:
@@ -161,3 +162,7 @@ CWARNFLAGS.ah_regdomain.c= ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLO
# XXX Work around clang warnings, until maintainer approves fix.
CWARNFLAGS.if_ath.c= ${NO_WSOMETIMES_UNINITIALIZED}
CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}}
+
+# AR9300 HAL build overrides, as there's still some code to tidy up
+#CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION}
+#CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED}
diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile
index 6d18143..f1f1f1e 100644
--- a/sys/modules/dtrace/Makefile
+++ b/sys/modules/dtrace/Makefile
@@ -19,6 +19,9 @@ SUBDIR= dtmalloc \
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
SUBDIR+= fasttrap fbt systrace_linux32
.endif
+.if ${MACHINE_CPUARCH} == "powerpc"
+SUBDIR+= fbt
+.endif
.if ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= systrace_freebsd32
.endif
diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/dtraceall/dtraceall.c
index 23b48b1..5d70feb 100644
--- a/sys/modules/dtrace/dtraceall/dtraceall.c
+++ b/sys/modules/dtrace/dtraceall/dtraceall.c
@@ -72,8 +72,10 @@ MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1);
#if defined(NFSCLIENT)
MODULE_DEPEND(dtraceall, dtnfsclient, 1, 1, 1);
#endif
-#if defined(__amd64__) || defined(__i386__)
+#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__)
MODULE_DEPEND(dtraceall, fbt, 1, 1, 1);
+#endif
+#if defined(__amd64__) || defined(__i386__)
MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1);
#endif
MODULE_DEPEND(dtraceall, lockstat, 1, 1, 1);
diff --git a/sys/modules/dtrace/fbt/Makefile b/sys/modules/dtrace/fbt/Makefile
index 9b69b22..acc10eb 100644
--- a/sys/modules/dtrace/fbt/Makefile
+++ b/sys/modules/dtrace/fbt/Makefile
@@ -3,7 +3,11 @@
.PATH: ${.CURDIR}/../../../cddl/dev/fbt
KMOD= fbt
+.if ${MACHINE_ARCH} == "powerpc"
+SRCS= fbt_powerpc.c
+.else
SRCS= fbt.c
+.endif
SRCS+= vnode_if.h
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
diff --git a/sys/modules/ncp/Makefile b/sys/modules/ncp/Makefile
deleted file mode 100644
index fb9d993..0000000
--- a/sys/modules/ncp/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../../netncp
-
-KMOD= ncp
-
-SRCS= ncp_conn.c ncp_sock.c ncp_ncp.c ncp_subr.c ncp_crypt.c ncp_mod.c \
- ncp_rq.c ncp_login.c ncp_nls.c opt_ncp.h
-
-.if defined(NCPBURST)
-SRCS+= ncp_burst.c
-CFLAGS+= -DNCPBURST
-.endif
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/nwfs/Makefile b/sys/modules/nwfs/Makefile
deleted file mode 100644
index 9739611..0000000
--- a/sys/modules/nwfs/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../../fs/nwfs
-
-KMOD= nwfs
-
-SRCS= vnode_if.h \
- nwfs_node.c nwfs_ioctl.c nwfs_io.c nwfs_vfsops.c nwfs_vnops.c \
- nwfs_subr.c
-
-.if defined(VNPRINT)
-CFLAGS+= -DVNPRINT
-.endif
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/uart/Makefile b/sys/modules/uart/Makefile
index d8a4869..06b005b 100644
--- a/sys/modules/uart/Makefile
+++ b/sys/modules/uart/Makefile
@@ -4,6 +4,9 @@
.if ${MACHINE_CPUARCH} == "sparc64"
uart_bus_ebus= uart_bus_ebus.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "sparc64"
ofw_bus_if= ofw_bus_if.h
.endif
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index ba31c66..ce83e4a 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -525,7 +525,7 @@ bpf_movein(struct uio *uio, int linktype, struct ifnet *ifp, struct mbuf **mp,
if (len < hlen || len - hlen > ifp->if_mtu)
return (EMSGSIZE);
- m = m_get2(M_WAITOK, MT_DATA, M_PKTHDR, len);
+ m = m_get2(len, M_WAITOK, MT_DATA, M_PKTHDR);
if (m == NULL)
return (EIO);
m->m_pkthdr.len = m->m_len = len;
diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c
index 43dd005..07cf219 100644
--- a/sys/net/bridgestp.c
+++ b/sys/net/bridgestp.c
@@ -234,7 +234,7 @@ bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp)
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
- MGETHDR(m, M_NOWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL)
return;
@@ -348,7 +348,7 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp,
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
return;
- MGETHDR(m, M_NOWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL)
return;
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index cd8f5c3..819e038 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -2314,6 +2314,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
BRIDGE_UNLOCK(sc); \
return (NULL); \
} \
+ eh = mtod(m, struct ether_header *); \
} \
} \
if (bif->bif_flags & IFBIF_LEARNING) { \
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 27e58d8..48255b0 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -384,8 +384,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
mob_h.hcrc = gre_in_cksum((u_int16_t *)&mob_h, msiz);
if ((m->m_data - msiz) < m->m_pktdat) {
- /* need new mbuf */
- MGETHDR(m0, M_NOWAIT, MT_DATA);
+ m0 = m_gethdr(M_NOWAIT, MT_DATA);
if (m0 == NULL) {
_IF_DROP(&ifp->if_snd);
m_freem(m);
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 9a08a76..c3781d5 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1118,20 +1118,17 @@ rt_msg1(int type, struct rt_addrinfo *rtinfo)
default:
len = sizeof(struct rt_msghdr);
}
- if (len > MCLBYTES)
- panic("rt_msg1");
- m = m_gethdr(M_NOWAIT, MT_DATA);
- if (m && len > MHLEN) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_free(m);
- m = NULL;
- }
- }
+
+ /* XXXGL: can we use MJUMPAGESIZE cluster here? */
+ KASSERT(len <= MCLBYTES, ("%s: message too big", __func__));
+ if (len > MHLEN)
+ m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
+ else
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL)
return (m);
+
m->m_pkthdr.len = m->m_len = len;
- m->m_pkthdr.rcvif = NULL;
rtm = mtod(m, struct rt_msghdr *);
bzero((caddr_t)rtm, len);
for (i = 0; i < RTAX_MAX; i++) {
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 0d51a55..675c87b 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -597,10 +597,9 @@ ieee80211_send_setup(
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211_tx_ampdu *tap;
struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
- struct ieee80211com *ic = ni->ni_ic;
ieee80211_seq seqno;
- IEEE80211_TX_LOCK_ASSERT(ic);
+ IEEE80211_TX_LOCK_ASSERT(ni->ni_ic);
wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | type;
if ((type & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_DATA) {
diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c
index 4971f12..d8083c2 100644
--- a/sys/net80211/ieee80211_superg.c
+++ b/sys/net80211/ieee80211_superg.c
@@ -534,8 +534,6 @@ ff_flush(struct mbuf *head, struct mbuf *last)
struct ieee80211_node *ni;
struct ieee80211vap *vap;
- IEEE80211_TX_LOCK_ASSERT(vap->iv_ic);
-
for (m = head; m != last; m = next) {
next = m->m_nextpkt;
m->m_nextpkt = NULL;
diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c
index e87da5e..fd7eb3c 100644
--- a/sys/netinet/igmp.c
+++ b/sys/netinet/igmp.c
@@ -523,7 +523,7 @@ igmp_ra_alloc(void)
struct mbuf *m;
struct ipoption *p;
- MGET(m, M_NOWAIT, MT_DATA);
+ m = m_get(M_WAITOK, MT_DATA);
p = mtod(m, struct ipoption *);
p->ipopt_dst.s_addr = INADDR_ANY;
p->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */
@@ -2203,7 +2203,7 @@ igmp_v1v2_queue_report(struct in_multi *inm, const int type)
ifp = inm->inm_ifp;
- MGETHDR(m, M_NOWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL)
return (ENOMEM);
MH_ALIGN(m, sizeof(struct ip) + sizeof(struct igmp));
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index ae3da96..eaff4f6 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -764,7 +764,7 @@ carp_send_ad_locked(struct carp_softc *sc)
if (sc->sc_naddrs) {
struct ip *ip;
- MGETHDR(m, M_NOWAIT, MT_HEADER);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
CARPSTATS_INC(carps_onomem);
goto resched;
@@ -832,7 +832,7 @@ carp_send_ad_locked(struct carp_softc *sc)
if (sc->sc_naddrs6) {
struct ip6_hdr *ip6;
- MGETHDR(m, M_NOWAIT, MT_HEADER);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
CARPSTATS_INC(carps_onomem);
goto resched;
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 555b5d0..1f1122c 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1406,7 +1406,7 @@ ip_forward(struct mbuf *m, int srcrt)
* assume exclusive access to the IP header in `m', so any
* data in a cluster may change before we reach icmp_error().
*/
- MGETHDR(mcopy, M_NOWAIT, m->m_type);
+ mcopy = m_gethdr(M_NOWAIT, m->m_type);
if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) {
/*
* It's probably ok if the pkthdr dup fails (because
diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c
index 6228933..db8238f 100644
--- a/sys/netinet/ip_mroute.c
+++ b/sys/netinet/ip_mroute.c
@@ -2083,13 +2083,12 @@ bw_upcalls_send(void)
* Allocate a new mbuf, initialize it with the header and
* the payload for the pending calls.
*/
- MGETHDR(m, M_NOWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
log(LOG_WARNING, "bw_upcalls_send: cannot allocate mbuf\n");
return;
}
- m->m_len = m->m_pkthdr.len = 0;
m_copyback(m, 0, sizeof(struct igmpmsg), (caddr_t)&igmpmsg);
m_copyback(m, sizeof(struct igmpmsg), len, (caddr_t)&V_bw_upcalls[0]);
@@ -2430,7 +2429,7 @@ pim_register_send_upcall(struct ip *ip, struct vif *vifp,
/*
* Add a new mbuf with an upcall header
*/
- MGETHDR(mb_first, M_NOWAIT, MT_DATA);
+ mb_first = m_gethdr(M_NOWAIT, MT_DATA);
if (mb_first == NULL) {
m_freem(mb_copy);
return ENOBUFS;
@@ -2488,7 +2487,7 @@ pim_register_send_rp(struct ip *ip, struct vif *vifp, struct mbuf *mb_copy,
/*
* Add a new mbuf with the encapsulating header
*/
- MGETHDR(mb_first, M_NOWAIT, MT_DATA);
+ mb_first = m_gethdr(M_NOWAIT, MT_DATA);
if (mb_first == NULL) {
m_freem(mb_copy);
return ENOBUFS;
diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c
index 239c699..8911992 100644
--- a/sys/netinet/ip_options.c
+++ b/sys/netinet/ip_options.c
@@ -495,12 +495,12 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen)
if (p->ipopt_dst.s_addr)
ip->ip_dst = p->ipopt_dst;
if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
- MGETHDR(n, M_NOWAIT, MT_DATA);
+ n = m_gethdr(M_NOWAIT, MT_DATA);
if (n == NULL) {
*phlen = 0;
return (m);
}
- M_MOVE_PKTHDR(n, m);
+ m_move_pkthdr(n, m);
n->m_pkthdr.rcvif = NULL;
n->m_pkthdr.len += optlen;
m->m_len -= sizeof(struct ip);
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 166bef5..fd418e9 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -784,7 +784,7 @@ smart_frag_failure:
struct mbuf *m;
int mhlen = sizeof (struct ip);
- MGETHDR(m, M_NOWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
error = ENOBUFS;
IPSTAT_INC(ips_odropped);
@@ -951,7 +951,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
error = EMSGSIZE;
break;
}
- MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA);
+ m = m_get(sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA);
if (m == NULL) {
error = ENOBUFS;
break;
diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c
index 3b2068b..8f23699 100644
--- a/sys/netinet/libalias/alias.c
+++ b/sys/netinet/libalias/alias.c
@@ -1749,26 +1749,22 @@ LibAliasUnLoadAllModule(void)
struct mbuf *
m_megapullup(struct mbuf *m, int len) {
struct mbuf *mcl;
-
+
if (len > m->m_pkthdr.len)
goto bad;
-
- /* Do not reallocate packet if it is sequentional,
- * writable and has some extra space for expansion.
- * XXX: Constant 100bytes is completely empirical. */
-#define RESERVE 100
- if (m->m_next == NULL && M_WRITABLE(m) && M_TRAILINGSPACE(m) >= RESERVE)
+
+ if (m->m_next == NULL && M_WRITABLE(m))
return (m);
- mcl = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, len + RESERVE);
+ mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR);
if (mcl == NULL)
goto bad;
-
+ m_align(mcl, len);
m_move_pkthdr(mcl, m);
m_copydata(m, 0, len, mtod(mcl, caddr_t));
mcl->m_len = mcl->m_pkthdr.len = len;
m_freem(m);
-
+
return (mcl);
bad:
m_freem(m);
diff --git a/sys/netinet/libalias/alias_db.c b/sys/netinet/libalias/alias_db.c
index 4e0837f..052e045 100644
--- a/sys/netinet/libalias/alias_db.c
+++ b/sys/netinet/libalias/alias_db.c
@@ -2729,7 +2729,6 @@ static void
InitPunchFW(struct libalias *la)
{
- LIBALIAS_LOCK_ASSERT(la);
la->fireWallField = malloc(la->fireWallNumNums);
if (la->fireWallField) {
memset(la->fireWallField, 0, la->fireWallNumNums);
@@ -2745,7 +2744,6 @@ static void
UninitPunchFW(struct libalias *la)
{
- LIBALIAS_LOCK_ASSERT(la);
ClearAllFWHoles(la);
if (la->fireWallFD >= 0)
close(la->fireWallFD);
@@ -2765,7 +2763,6 @@ PunchFWHole(struct alias_link *lnk)
struct ip_fw rule; /* On-the-fly built rule */
int fwhole; /* Where to punch hole */
- LIBALIAS_LOCK_ASSERT(la);
la = lnk->la;
/* Don't do anything unless we are asked to */
@@ -2839,7 +2836,6 @@ ClearFWHole(struct alias_link *lnk)
{
struct libalias *la;
- LIBALIAS_LOCK_ASSERT(la);
la = lnk->la;
if (lnk->link_type == LINK_TCP) {
int fwhole = lnk->data.tcp->fwhole; /* Where is the firewall
@@ -2864,7 +2860,6 @@ ClearAllFWHoles(struct libalias *la)
struct ip_fw rule; /* On-the-fly built rule */
int i;
- LIBALIAS_LOCK_ASSERT(la);
if (la->fireWallFD < 0)
return;
@@ -2878,7 +2873,7 @@ ClearAllFWHoles(struct libalias *la)
memset(la->fireWallField, 0, la->fireWallNumNums);
}
-#endif
+#endif /* !NO_FW_PUNCH */
void
LibAliasSetFWBase(struct libalias *la, unsigned int base, unsigned int num)
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index ac7ac31..bcfed8a 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -842,23 +842,19 @@ send:
TCPSTAT_INC(tcps_sndpack);
TCPSTAT_ADD(tcps_sndbyte, len);
}
- MGETHDR(m, M_NOWAIT, MT_DATA);
+#ifdef INET6
+ if (MHLEN < hdrlen + max_linkhdr)
+ m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
+ else
+#endif
+ m = m_gethdr(M_NOWAIT, MT_DATA);
+
if (m == NULL) {
SOCKBUF_UNLOCK(&so->so_snd);
error = ENOBUFS;
goto out;
}
-#ifdef INET6
- if (MHLEN < hdrlen + max_linkhdr) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- SOCKBUF_UNLOCK(&so->so_snd);
- m_freem(m);
- error = ENOBUFS;
- goto out;
- }
- }
-#endif
+
m->m_data += max_linkhdr;
m->m_len = hdrlen;
@@ -902,7 +898,7 @@ send:
else
TCPSTAT_INC(tcps_sndwinup);
- MGETHDR(m, M_NOWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
error = ENOBUFS;
goto out;
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 3c9dd34..24e4db2 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1860,7 +1860,7 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp)
if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL))
return (0);
- MGETHDR(m, M_NOWAIT, MT_DATA);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (!m)
return (0);
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 0cd6e5a..8772779 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -578,25 +578,18 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
if ((n->m_flags & M_EXT) != 0
|| n->m_len < off + sizeof(struct icmp6_hdr)) {
struct mbuf *n0 = n;
- const int maxlen = sizeof(*nip6) + sizeof(*nicmp6);
int n0len;
- MGETHDR(n, M_NOWAIT, n0->m_type);
- n0len = n0->m_pkthdr.len; /* save for use below */
- if (n)
- M_MOVE_PKTHDR(n, n0); /* FIB copied. */
- if (n && maxlen >= MHLEN) {
- MCLGET(n, M_NOWAIT);
- if ((n->m_flags & M_EXT) == 0) {
- m_free(n);
- n = NULL;
- }
- }
+ CTASSERT(sizeof(*nip6) + sizeof(*nicmp6) <= MHLEN);
+ n = m_gethdr(M_NOWAIT, n0->m_type);
if (n == NULL) {
/* Give up remote */
m_freem(n0);
break;
}
+
+ m_move_pkthdr(n, n0); /* FIB copied. */
+ n0len = n0->m_pkthdr.len; /* save for use below */
/*
* Copy IPv6 and ICMPv6 only.
*/
@@ -683,7 +676,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
} else {
struct prison *pr;
u_char *p;
- int maxlen, maxhlen, hlen;
+ int maxhlen, hlen;
/*
* XXX: this combination of flags is pointless,
@@ -694,20 +687,14 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
if (code != 0)
goto badcode;
- maxlen = sizeof(*nip6) + sizeof(*nicmp6) + 4;
- if (maxlen >= MCLBYTES) {
+
+ CTASSERT(sizeof(*nip6) + sizeof(*nicmp6) + 4 <= MHLEN);
+ n = m_gethdr(M_NOWAIT, m->m_type);
+ if (n == NULL) {
/* Give up remote */
break;
}
- MGETHDR(n, M_NOWAIT, m->m_type);
- if (n && maxlen > MHLEN) {
- MCLGET(n, M_NOWAIT);
- if ((n->m_flags & M_EXT) == 0) {
- m_free(n);
- n = NULL;
- }
- }
- if (n && !m_dup_pkthdr(n, m, M_NOWAIT)) {
+ if (!m_dup_pkthdr(n, m, M_NOWAIT)) {
/*
* Previous code did a blind M_COPY_PKTHDR
* and said "just for rcvif". If true, then
@@ -718,13 +705,8 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
m_free(n);
n = NULL;
}
- if (n == NULL) {
- /* Give up remote */
- break;
- }
- n->m_pkthdr.rcvif = NULL;
- n->m_len = 0;
- maxhlen = M_TRAILINGSPACE(n) - maxlen;
+ maxhlen = M_TRAILINGSPACE(n) -
+ (sizeof(*nip6) + sizeof(*nicmp6) + 4);
pr = curthread->td_ucred->cr_prison;
mtx_lock(&pr->pr_mtx);
hlen = strlen(pr->pr_hostname);
@@ -1494,26 +1476,23 @@ ni6_input(struct mbuf *m, int off)
break;
}
- /* allocate an mbuf to reply. */
- MGETHDR(n, M_NOWAIT, m->m_type);
+ /* Allocate an mbuf to reply. */
+ if (replylen > MCLBYTES) {
+ /*
+ * XXX: should we try to allocate more? But MCLBYTES
+ * is probably much larger than IPV6_MMTU...
+ */
+ goto bad;
+ }
+ if (replylen > MHLEN)
+ n = m_getcl(M_NOWAIT, m->m_type, M_PKTHDR);
+ else
+ n = m_gethdr(M_NOWAIT, m->m_type);
if (n == NULL) {
m_freem(m);
return (NULL);
}
- M_MOVE_PKTHDR(n, m); /* just for recvif and FIB */
- if (replylen > MHLEN) {
- if (replylen > MCLBYTES) {
- /*
- * XXX: should we try to allocate more? But MCLBYTES
- * is probably much larger than IPV6_MMTU...
- */
- goto bad;
- }
- MCLGET(n, M_NOWAIT);
- if ((n->m_flags & M_EXT) == 0) {
- goto bad;
- }
- }
+ m_move_pkthdr(n, m); /* just for recvif and FIB */
n->m_pkthdr.len = n->m_len = replylen;
/* copy mbuf header and IPv6 + Node Information base headers */
@@ -1608,16 +1587,13 @@ ni6_nametodns(const char *name, int namelen, int old)
else
len = MCLBYTES;
- /* because MAXHOSTNAMELEN is usually 256, we use cluster mbuf */
- MGET(m, M_NOWAIT, MT_DATA);
- if (m && len > MLEN) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0)
- goto fail;
- }
- if (!m)
+ /* Because MAXHOSTNAMELEN is usually 256, we use cluster mbuf. */
+ if (len > MLEN)
+ m = m_getcl(M_NOWAIT, MT_DATA, 0);
+ else
+ m = m_get(M_NOWAIT, MT_DATA);
+ if (m == NULL)
goto fail;
- m->m_next = NULL;
if (old) {
m->m_len = len;
@@ -2063,7 +2039,7 @@ icmp6_rip6_input(struct mbuf **mp, int off)
*/
if ((m->m_flags & M_EXT) && m->m_next == NULL &&
m->m_len <= MHLEN) {
- MGET(n, M_NOWAIT, m->m_type);
+ n = m_get(M_NOWAIT, m->m_type);
if (n != NULL) {
if (m_dup_pkthdr(n, m, M_NOWAIT)) {
bcopy(m->m_data, n->m_data,
@@ -2113,7 +2089,7 @@ icmp6_rip6_input(struct mbuf **mp, int off)
m->m_len <= MHLEN) {
struct mbuf *n;
- MGET(n, M_NOWAIT, m->m_type);
+ n = m_get(M_NOWAIT, m->m_type);
if (n != NULL) {
if (m_dup_pkthdr(n, m, M_NOWAIT)) {
bcopy(m->m_data, n->m_data, m->m_len);
@@ -2592,14 +2568,10 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt)
#if IPV6_MMTU >= MCLBYTES
# error assumption failed about IPV6_MMTU and MCLBYTES
#endif
- MGETHDR(m, M_NOWAIT, MT_HEADER);
- if (m && IPV6_MMTU >= MHLEN)
- MCLGET(m, M_NOWAIT);
- if (!m)
+ m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
+ if (m == NULL)
goto fail;
M_SETFIB(m, rt->rt_fibnum);
- m->m_pkthdr.rcvif = NULL;
- m->m_len = 0;
maxlen = M_TRAILINGSPACE(m);
maxlen = min(IPV6_MMTU, maxlen);
/* just for safety */
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 45c4ff6..e037737 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -497,21 +497,16 @@ ip6_input(struct mbuf *m)
if (m && m->m_next != NULL && m->m_pkthdr.len < MCLBYTES) {
struct mbuf *n;
- MGETHDR(n, M_NOWAIT, MT_HEADER);
- if (n)
- M_MOVE_PKTHDR(n, m);
- if (n && n->m_pkthdr.len > MHLEN) {
- MCLGET(n, M_NOWAIT);
- if ((n->m_flags & M_EXT) == 0) {
- m_freem(n);
- n = NULL;
- }
- }
+ if (m->m_pkthdr.len > MHLEN)
+ n = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
+ else
+ n = m_gethdr(M_NOWAIT, MT_DATA);
if (n == NULL) {
m_freem(m);
return; /* ENOBUFS */
}
+ m_move_pkthdr(n, m);
m_copydata(m, 0, n->m_pkthdr.len, mtod(n, caddr_t));
n->m_len = n->m_pkthdr.len;
m_freem(m);
@@ -1667,22 +1662,12 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt)
else
elen = (ip6e.ip6e_len + 1) << 3;
- MGET(n, M_NOWAIT, MT_DATA);
- if (n && elen >= MLEN) {
- MCLGET(n, M_NOWAIT);
- if ((n->m_flags & M_EXT) == 0) {
- m_free(n);
- n = NULL;
- }
- }
- if (!n)
- return NULL;
-
- n->m_len = 0;
- if (elen >= M_TRAILINGSPACE(n)) {
- m_free(n);
+ if (elen > MLEN)
+ n = m_getcl(M_NOWAIT, MT_DATA, 0);
+ else
+ n = m_get(M_NOWAIT, MT_DATA);
+ if (n == NULL)
return NULL;
- }
m_copydata(m, off, elen, mtod(n, caddr_t));
n->m_len = elen;
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
index a221110..aeeb644 100644
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1698,11 +1698,10 @@ register_send(struct ip6_hdr *ip6, struct mif6 *mif, struct mbuf *m)
#endif
++pim6stat.pim6s_snd_registers;
- /* Make a copy of the packet to send to the user level process */
- MGETHDR(mm, M_NOWAIT, MT_HEADER);
+ /* Make a copy of the packet to send to the user level process. */
+ mm = m_gethdr(M_NOWAIT, MT_DATA);
if (mm == NULL)
return (ENOBUFS);
- mm->m_pkthdr.rcvif = NULL;
mm->m_data += max_linkhdr;
mm->m_len = sizeof(struct ip6_hdr);
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index 5e8c11f..e5042d2 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -774,9 +774,7 @@ again:
/*
* XXX: ip6_mforward expects that rcvif is NULL
* when it is called from the originating path.
- * However, it is not always the case, since
- * some versions of MGETHDR() does not
- * initialize the field.
+ * However, it may not always be the case.
*/
m->m_pkthdr.rcvif = NULL;
if (ip6_mforward(ip6, ifp, m) != 0) {
@@ -1122,13 +1120,12 @@ passout:
*/
m0 = m;
for (off = hlen; off < tlen; off += len) {
- MGETHDR(m, M_NOWAIT, MT_HEADER);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (!m) {
error = ENOBUFS;
V_ip6stat.ip6s_odropped++;
goto sendorfree;
}
- m->m_pkthdr.rcvif = NULL;
m->m_flags = m0->m_flags & M_COPYFLAGS; /* incl. FIB */
*mnext = m;
mnext = &m->m_nextpkt;
@@ -1222,17 +1219,12 @@ ip6_copyexthdr(struct mbuf **mp, caddr_t hdr, int hlen)
if (hlen > MCLBYTES)
return (ENOBUFS); /* XXX */
- MGET(m, M_NOWAIT, MT_DATA);
- if (!m)
+ if (hlen > MLEN)
+ m = m_getcl(M_NOWAIT, MT_DATA, 0);
+ else
+ m = m_get(M_NOWAIT, MT_DATA);
+ if (m == NULL)
return (ENOBUFS);
-
- if (hlen > MLEN) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_free(m);
- return (ENOBUFS);
- }
- }
m->m_len = hlen;
if (hdr)
bcopy(hdr, mtod(m, caddr_t), hlen);
@@ -1260,8 +1252,8 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen)
* Otherwise, use it to store the options.
*/
if (exthdrs->ip6e_hbh == 0) {
- MGET(mopt, M_NOWAIT, MT_DATA);
- if (mopt == 0)
+ mopt = m_get(M_NOWAIT, MT_DATA);
+ if (mopt == NULL)
return (ENOBUFS);
mopt->m_len = JUMBOOPTLEN;
optbuf = mtod(mopt, u_char *);
@@ -1292,15 +1284,8 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen)
* As a consequence, we must always prepare a cluster
* at this point.
*/
- MGET(n, M_NOWAIT, MT_DATA);
- if (n) {
- MCLGET(n, M_NOWAIT);
- if ((n->m_flags & M_EXT) == 0) {
- m_freem(n);
- n = NULL;
- }
- }
- if (!n)
+ n = m_getcl(M_NOWAIT, MT_DATA, 0);
+ if (n == NULL)
return (ENOBUFS);
n->m_len = oldoptlen + JUMBOOPTLEN;
bcopy(mtod(mopt, caddr_t), mtod(n, caddr_t),
@@ -1369,8 +1354,8 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen,
/* allocate a new mbuf for the fragment header */
struct mbuf *mfrg;
- MGET(mfrg, M_NOWAIT, MT_DATA);
- if (mfrg == 0)
+ mfrg = m_get(M_NOWAIT, MT_DATA);
+ if (mfrg == NULL)
return (ENOBUFS);
mfrg->m_len = sizeof(struct ip6_frag);
*frghdrp = mtod(mfrg, struct ip6_frag *);
@@ -3045,12 +3030,12 @@ ip6_splithdr(struct mbuf *m, struct ip6_exthdrs *exthdrs)
ip6 = mtod(m, struct ip6_hdr *);
if (m->m_len > sizeof(*ip6)) {
- MGETHDR(mh, M_NOWAIT, MT_HEADER);
- if (mh == 0) {
+ mh = m_gethdr(M_NOWAIT, MT_DATA);
+ if (mh == NULL) {
m_freem(m);
return ENOBUFS;
}
- M_MOVE_PKTHDR(mh, m);
+ m_move_pkthdr(mh, m);
MH_ALIGN(mh, sizeof(*ip6));
m->m_len -= sizeof(*ip6);
m->m_data += sizeof(*ip6);
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 0d9e300..560e8d6 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -1799,13 +1799,13 @@ mld_v1_transmit_report(struct in6_multi *in6m, const int type)
ia = in6ifa_ifpforlinklocal(ifp, IN6_IFF_NOTREADY|IN6_IFF_ANYCAST);
/* ia may be NULL if link-local address is tentative. */
- MGETHDR(mh, M_NOWAIT, MT_HEADER);
+ mh = m_gethdr(M_NOWAIT, MT_DATA);
if (mh == NULL) {
if (ia != NULL)
ifa_free(&ia->ia_ifa);
return (ENOMEM);
}
- MGET(md, M_NOWAIT, MT_DATA);
+ md = m_get(M_NOWAIT, MT_DATA);
if (md == NULL) {
m_free(mh);
if (ia != NULL)
@@ -3173,7 +3173,7 @@ mld_v2_encap_report(struct ifnet *ifp, struct mbuf *m)
if (ia == NULL)
CTR1(KTR_MLD, "%s: warning: ia is NULL", __func__);
- MGETHDR(mh, M_NOWAIT, MT_HEADER);
+ mh = m_gethdr(M_NOWAIT, MT_DATA);
if (mh == NULL) {
if (ia != NULL)
ifa_free(&ia->ia_ifa);
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 7fe75bf..532c9b8 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -419,17 +419,12 @@ nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6,
return;
}
- MGETHDR(m, M_NOWAIT, MT_DATA);
- if (m && max_linkhdr + maxlen >= MHLEN) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_free(m);
- m = NULL;
- }
- }
+ if (max_linkhdr + maxlen > MHLEN)
+ m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
+ else
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL)
return;
- m->m_pkthdr.rcvif = NULL;
bzero(&ro, sizeof(ro));
@@ -997,17 +992,12 @@ nd6_na_output_fib(struct ifnet *ifp, const struct in6_addr *daddr6_0,
return;
}
- MGETHDR(m, M_NOWAIT, MT_DATA);
- if (m && max_linkhdr + maxlen >= MHLEN) {
- MCLGET(m, M_NOWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_free(m);
- m = NULL;
- }
- }
+ if (max_linkhdr + maxlen > MHLEN)
+ m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
+ else
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL)
return;
- m->m_pkthdr.rcvif = NULL;
M_SETFIB(m, fibnum);
if (IN6_IS_ADDR_MULTICAST(&daddr6)) {
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
index e635041..60960705 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -197,6 +197,7 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
&ip6->ip6_dst) != 0)
continue;
}
+ INP_RLOCK(in6p);
if (in6p->in6p_cksum != -1) {
V_rip6stat.rip6s_isum++;
if (in6_cksum(m, proto, *offp,
@@ -206,7 +207,6 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
continue;
}
}
- INP_RLOCK(in6p);
/*
* If this raw socket has multicast state, and we
* have received a multicast, check if this socket
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index a4b7ecb..67afed2 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -547,7 +547,6 @@ static const char *key_getfqdn __P((void));
static const char *key_getuserfqdn __P((void));
#endif
static void key_sa_chgstate __P((struct secasvar *, u_int8_t));
-static struct mbuf *key_alloc_mbuf __P((int));
static __inline void
sa_initref(struct secasvar *sav)
@@ -1634,15 +1633,11 @@ key_sp2msg(sp)
tlen = key_getspreqmsglen(sp);
- m = key_alloc_mbuf(tlen);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
- return NULL;
- }
-
+ m = m_get2(tlen, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL)
+ return (NULL);
+ m_align(m, tlen);
m->m_len = tlen;
- m->m_next = NULL;
xpl = mtod(m, struct sadb_x_policy *);
bzero(xpl, tlen);
@@ -1732,12 +1727,11 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist)
mtod(n, caddr_t));
} else if (i < ndeep) {
len = mhp->extlen[idx];
- n = key_alloc_mbuf(len);
- if (!n || n->m_next) { /*XXX*/
- if (n)
- m_freem(n);
+ n = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (n == NULL)
goto fail;
- }
+ m_align(n, len);
+ n->m_len = len;
m_copydata(m, mhp->extoff[idx], mhp->extlen[idx],
mtod(n, caddr_t));
} else {
@@ -2602,13 +2596,13 @@ key_spdexpire(sp)
/* create lifetime extension (current and hard) */
len = PFKEY_ALIGN8(sizeof(*lt)) * 2;
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL) {
error = ENOBUFS;
goto fail;
}
+ m_align(m, len);
+ m->m_len = len;
bzero(mtod(m, caddr_t), len);
lt = mtod(m, struct sadb_lifetime *);
lt->sadb_lifetime_len = PFKEY_UNIT64(sizeof(struct sadb_lifetime));
@@ -3602,15 +3596,12 @@ key_setsadbsa(sav)
int len;
len = PFKEY_ALIGN8(sizeof(struct sadb_sa));
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
- return NULL;
- }
-
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL)
+ return (NULL);
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_sa *);
-
bzero(p, len);
p->sadb_sa_len = PFKEY_UNIT64(len);
p->sadb_sa_exttype = SADB_EXT_SA;
@@ -3636,13 +3627,11 @@ key_setsadbaddr(u_int16_t exttype, const struct sockaddr *saddr, u_int8_t prefix
len = PFKEY_ALIGN8(sizeof(struct sadb_address)) +
PFKEY_ALIGN8(saddr->sa_len);
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
- return NULL;
- }
-
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL)
+ return (NULL);
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_address *);
bzero(p, len);
@@ -3682,13 +3671,11 @@ key_setsadbxsa2(u_int8_t mode, u_int32_t seq, u_int32_t reqid)
size_t len;
len = PFKEY_ALIGN8(sizeof(struct sadb_x_sa2));
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
- return NULL;
- }
-
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL)
+ return (NULL);
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_x_sa2 *);
bzero(p, len);
@@ -3716,13 +3703,11 @@ key_setsadbxtype(u_int16_t type)
len = PFKEY_ALIGN8(sizeof(struct sadb_x_nat_t_type));
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL)
return (NULL);
- }
-
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_x_nat_t_type *);
bzero(p, len);
@@ -3745,13 +3730,11 @@ key_setsadbxport(u_int16_t port, u_int16_t type)
len = PFKEY_ALIGN8(sizeof(struct sadb_x_nat_t_port));
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL)
return (NULL);
- }
-
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_x_nat_t_port *);
bzero(p, len);
@@ -3822,13 +3805,11 @@ key_setsadbxpolicy(u_int16_t type, u_int8_t dir, u_int32_t id)
size_t len;
len = PFKEY_ALIGN8(sizeof(struct sadb_x_policy));
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
- return NULL;
- }
-
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL)
+ return (NULL);
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_x_policy *);
bzero(p, len);
@@ -6951,13 +6932,13 @@ key_expire(struct secasvar *sav)
/* create lifetime extension (current and soft) */
len = PFKEY_ALIGN8(sizeof(*lt)) * 2;
- m = key_alloc_mbuf(len);
- if (!m || m->m_next) { /*XXX*/
- if (m)
- m_freem(m);
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
+ if (m == NULL) {
error = ENOBUFS;
goto fail;
}
+ m_align(m, len);
+ m->m_len = len;
bzero(mtod(m, caddr_t), len);
lt = mtod(m, struct sadb_lifetime *);
lt->sadb_lifetime_len = PFKEY_UNIT64(sizeof(struct sadb_lifetime));
@@ -7959,45 +7940,6 @@ key_sa_stir_iv(sav)
key_randomfill(sav->iv, sav->ivlen);
}
-/* XXX too much? */
-static struct mbuf *
-key_alloc_mbuf(l)
- int l;
-{
- struct mbuf *m = NULL, *n;
- int len, t;
-
- len = l;
- while (len > 0) {
- MGET(n, M_NOWAIT, MT_DATA);
- if (n && len > MLEN)
- MCLGET(n, M_NOWAIT);
- if (!n) {
- m_freem(m);
- return NULL;
- }
-
- n->m_next = NULL;
- n->m_len = 0;
- n->m_len = M_TRAILINGSPACE(n);
- /* use the bottom of mbuf, hoping we can prepend afterwards */
- if (n->m_len > len) {
- t = (n->m_len - len) & ~(sizeof(long) - 1);
- n->m_data += t;
- n->m_len = len;
- }
-
- len -= n->m_len;
-
- if (m)
- m_cat(m, n);
- else
- m = n;
- }
-
- return m;
-}
-
/*
* Take one of the kernel's security keys and convert it into a PF_KEY
* structure within an mbuf, suitable for sending up to a waiting
@@ -8022,9 +7964,11 @@ key_setkey(struct seckey *src, u_int16_t exttype)
return NULL;
len = PFKEY_ALIGN8(sizeof(struct sadb_key) + _KEYLEN(src));
- m = key_alloc_mbuf(len);
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
if (m == NULL)
return NULL;
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_key *);
bzero(p, len);
p->sadb_key_len = PFKEY_UNIT64(len);
@@ -8059,9 +8003,11 @@ key_setlifetime(struct seclifetime *src, u_int16_t exttype)
if (src == NULL)
return NULL;
- m = key_alloc_mbuf(len);
+ m = m_get2(len, M_NOWAIT, MT_DATA, 0);
if (m == NULL)
return m;
+ m_align(m, len);
+ m->m_len = len;
p = mtod(m, struct sadb_lifetime *);
bzero(p, len);
diff --git a/sys/netncp/ncp.h b/sys/netncp/ncp.h
deleted file mode 100644
index 5b10d9a..0000000
--- a/sys/netncp/ncp.h
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * ncp.h
- */
-/*-
- * Copyright (C) 1995 by Volker Lendecke
- * New version derived from original ncp.h, 1998 Boris Popov
- *
- * $FreeBSD$
- */
-
-#ifndef _NETNCP_NCP_H_
-#define _NETNCP_NCP_H_
-
-#define NCP_VERMAJ 1
-#define NCP_VERMIN 3500
-#define NCP_VERSION (NCP_VERMAJ*100000 + NCP_VERMIN)
-
-typedef u_int32_t nwdirent;
-
-typedef char nstr8;
-typedef nstr8* pnstr8;
-typedef u_int8_t nuint8;
-typedef u_int8_t* pnuint8;
-typedef u_int16_t nuint16;
-typedef nuint16* pnuint16;
-typedef u_int32_t nuint32;
-typedef nuint32* pnuint32;
-
-
-#define NCP_DEFAULT_BUFSIZE 1024
-#define NCP_MAX_BUFSIZE 1024
-#define NCP_MAX_PACKET_SIZE 4070
-#define NCP_MAXUSERNAMELEN 255
-#define NCP_MAXPASSWORDLEN 255
-#define NCP_MAXPATHLEN 255
-#define NCP_MAX_FILENAME 14
-#define NCP_FILE_ID_LEN 6
-
-#define NCP_BINDERY_USER 0x0001
-#define NCP_BINDERY_UGROUP 0x0002
-#define NCP_BINDERY_PQUEUE 0x0003
-#define NCP_BINDERY_FSERVER 0x0004
-#define NCP_BINDERY_PSERVER 0x0007
-#define NCP_BINDERY_NAME_LEN 48
-
-/* Handle Flags */
-#define NCP_HF_DIRSHORT 0 /* short directory handle */
-#define NCP_HF_DIRBASE 1 /* directory base */
-#define NCP_HF_NONE 0xff /* no handle or dirbase */
-
-/* Options to negotiate */
-#define NCP_IPX_CHECKSUM 1
-#define NCP_SECURITY_LEVEL_SIGN_HEADERS 2
-
-#ifndef NWCONN_HANDLE
-#define NWCONN_HANDLE unsigned int
-#define pNWCONN_HANDLE (unsigned int*)
-#define NWCONN_NUM u_int16_t
-#define NWCCODE unsigned int
-#define NWDIR_HANDLE u_int8_t
-#define NWFILE_HANDLE int
-#endif
-
-struct ncp_fh_s {
- u_int16_t val1;
- union {
- u_int32_t val32;
- u_int16_t val16;
- } val;
-} __packed;
-
-typedef struct ncp_fh_s ncp_fh;
-
-typedef struct ncpfid_s {
- nwdirent f_parent;
- nwdirent f_id;
-} ncpfid;
-
-/* -- Bindery properties -- */
-struct ncp_bindery_object {
- u_int32_t object_id;
- u_int16_t object_type;
- u_int8_t object_name[NCP_BINDERY_NAME_LEN];
- u_int8_t object_flags;
- u_int8_t object_security;
- u_int8_t object_has_prop;
-};
-
-struct nw_property {
- u_int8_t value[128];
- u_int8_t more_flag;
- u_int8_t property_flag;
-};
-
-struct ncp_filesearch_info {
- u_int8_t volume_number;
- u_int16_t directory_id;
- u_int16_t sequence_no;
- u_int8_t access_rights;
-};
-
-
-struct ncp_file_info {
- u_int8_t file_id[NCP_FILE_ID_LEN];
- char file_name[NCP_MAX_FILENAME + 1];
- u_int8_t file_attributes;
- u_int8_t file_mode;
- u_int32_t file_length;
- u_int16_t creation_date;
- u_int16_t access_date;
- u_int16_t update_date;
- u_int16_t update_time;
-};
-
-struct nw_queue_job_entry {
- u_int16_t InUse;
- u_int32_t prev;
- u_int32_t next;
- u_int32_t ClientStation;
- u_int32_t ClientTask;
- u_int32_t ClientObjectID;
- u_int32_t TargetServerID;
- u_int8_t TargetExecTime[6];
- u_int8_t JobEntryTime[6];
- u_int32_t JobNumber;
- u_int16_t JobType;
- u_int16_t JobPosition;
- u_int16_t JobControlFlags;
- u_int8_t FileNameLen;
- char JobFileName[13];
- u_int32_t JobFileHandle;
- u_int32_t ServerStation;
- u_int32_t ServerTaskNumber;
- u_int32_t ServerObjectID;
- char JobTextDescription[50];
- char ClientRecordArea[152];
-} __packed;
-
-struct queue_job {
- struct nw_queue_job_entry j;
- ncp_fh file_handle;
-};
-
-#define QJE_OPER_HOLD 0x80
-#define QJE_USER_HOLD 0x40
-#define QJE_ENTRYOPEN 0x20
-#define QJE_SERV_RESTART 0x10
-#define QJE_SERV_AUTO 0x08
-
-/* ClientRecordArea for print jobs */
-
-#define KEEP_ON 0x0400
-#define NO_FORM_FEED 0x0800
-#define NOTIFICATION 0x1000
-#define DELETE_FILE 0x2000
-#define EXPAND_TABS 0x4000
-#define PRINT_BANNER 0x8000
-
-struct print_job_record {
- u_int8_t Version;
- u_int8_t TabSize;
- u_int16_t Copies;
- u_int16_t CtrlFlags;
- u_int16_t Lines;
- u_int16_t Rows;
- char FormName[16];
- u_int8_t Reserved[6];
- char BannerName[13];
- char FnameBanner[13];
- char FnameHeader[14];
- char Path[80];
-} __packed;
-
-struct ncp_station_addr {
- u_int32_t NetWork;
- u_int8_t Node[6];
- u_int16_t Socket;
-} __packed;
-
-struct ncp_prop_login_control {
- u_int8_t AccountExpireDate[3];
- u_int8_t Disabled;
- u_int8_t PasswordExpireDate[3];
- u_int8_t GraceLogins;
- u_int16_t PasswordExpireInterval;
- u_int8_t MaxGraceLogins;
- u_int8_t MinPasswordLength;
- u_int16_t MaxConnections;
- u_int8_t ConnectionTimeMask[42];
- u_int8_t LastLogin[6];
- u_int8_t RestrictionMask;
- u_int8_t reserved;
- u_int32_t MaxDiskUsage;
- u_int16_t BadLoginCount;
- u_int32_t BadLoginCountDown;
- struct ncp_station_addr LastIntruder;
-} __packed;
-
-#define NCP_VOLNAME_LEN (16)
-#define NCP_NUMBER_OF_VOLUMES (64)
-struct ncp_volume_info {
- u_int32_t total_blocks;
- u_int32_t free_blocks;
- u_int32_t purgeable_blocks;
- u_int32_t not_yet_purgeable_blocks;
- u_int32_t total_dir_entries;
- u_int32_t available_dir_entries;
- u_int8_t sectors_per_block;
- char volume_name[NCP_VOLNAME_LEN + 1];
-};
-/*
- * Name space constants, taken from NDK
- */
-#define aRONLY (ntohl(0x01000000))
-#define aHIDDEN (ntohl(0x02000000))
-#define aSYSTEM (ntohl(0x04000000))
-#define aEXECUTE (ntohl(0x08000000))
-#define aDIR (ntohl(0x10000000))
-#define aARCH (ntohl(0x20000000))
-
-/* Defines for Name Spaces */
-#define NW_NS_DOS 0
-#define NW_NS_MAC 1
-#define NW_NS_NFS 2
-#define NW_NS_FTAM 3
-#define NW_NS_OS2 4
-
-/* for _ScanNSEntryInfo */
-#define IM_NAME 0x00000001
-#define IM_SPACE_ALLOCATED 0x00000002
-#define IM_ATTRIBUTES 0x00000004
-#define IM_SIZE 0x00000008
-#define IM_TOTAL_SIZE 0x00000010
-#define IM_EA 0x00000020
-#define IM_ARCHIVE 0x00000040
-#define IM_MODIFY 0x00000080
-#define IM_CREATION 0x00000100
-#define IM_OWNING_NAMESPACE 0x00000200
-#define IM_DIRECTORY 0x00000400
-#define IM_RIGHTS 0x00000800
-#define IM_ALMOST_ALL 0x00000FED
-#define IM_ALL 0x00000FFF
-#define IM_REFERENCE_ID 0x00001000
-#define IM_NS_ATTRIBUTES 0x00002000
-#define IM_COMPRESSED_INFO 0x80000000UL
-
-/* open/create modes */
-#define OC_MODE_OPEN 0x01
-#define OC_MODE_TRUNCATE 0x02
-#define OC_MODE_REPLACE 0x02
-#define OC_MODE_CREATE 0x08
-
-/* open/create results */
-#define OC_ACTION_NONE 0x00
-#define OC_ACTION_OPEN 0x01
-#define OC_ACTION_CREATE 0x02
-#define OC_ACTION_TRUNCATE 0x04
-#define OC_ACTION_REPLACE 0x04
-
-/* renameFlag in NSRename */
-#define NW_TYPE_FILE 0x8000
-#define NW_TYPE_SUBDIR 0x0010
-
-#define NW_NAME_CONVERT 0x0003 /* don't report error and set comp mode */
-#define NW_NO_NAME_CONVERT 0x0004 /* only in specified name space */
-
-/* search attributes */
-#ifndef SA_HIDDEN
-#define SA_NORMAL 0x0000
-#define SA_HIDDEN 0x0002
-#define SA_SYSTEM 0x0004
-#define SA_SUBDIR_ONLY 0x0010
-#define SA_SUBDIR_FILES 0x8000
-#define SA_ALL 0x8006
-#endif
-
-/* access rights attributes */
-#ifndef AR_READ
-#define AR_READ 0x0001
-#define AR_WRITE 0x0002
-#define AR_READ_ONLY 0x0001
-#define AR_WRITE_ONLY 0x0002
-#define AR_DENY_READ 0x0004
-#define AR_DENY_WRITE 0x0008
-#define AR_COMPATIBILITY 0x0010
-#define AR_WRITE_THROUGH 0x0040
-#define AR_OPEN_COMPRESSED 0x0100
-#endif
-
-struct nw_entry_info {
- u_int32_t spaceAlloc;
- u_int32_t attributes; /* LH */
- u_int16_t flags; /* internal */
- u_int32_t dataStreamSize;
- u_int32_t totalStreamSize;
- u_int16_t numberOfStreams;
- u_int16_t creationTime; /* LH */
- u_int16_t creationDate; /* LH */
- u_int32_t creatorID; /* HL */
- u_int16_t modifyTime; /* LH */
- u_int16_t modifyDate; /* LH */
- u_int32_t modifierID; /* HL */
- u_int16_t lastAccessDate; /* LH */
- u_int16_t archiveTime; /* LH */
- u_int16_t archiveDate; /* LH */
- u_int32_t archiverID; /* HL */
- u_int16_t inheritedRightsMask; /* LH */
- u_int32_t dirEntNum;
- u_int32_t DosDirNum;
- u_int32_t volNumber;
- u_int32_t EADataSize;
- u_int32_t EAKeyCount;
- u_int32_t EAKeySize;
- u_int32_t NSCreator;
- u_int8_t nameLen;
- u_int8_t entryName[256];
-} __packed;
-
-typedef struct nw_entry_info NW_ENTRY_INFO;
-
-/* modify mask - use with MODIFY_DOS_INFO structure */
-#define DM_ATTRIBUTES 0x0002L
-#define DM_CREATE_DATE 0x0004L
-#define DM_CREATE_TIME 0x0008L
-#define DM_CREATOR_ID 0x0010L
-#define DM_ARCHIVE_DATE 0x0020L
-#define DM_ARCHIVE_TIME 0x0040L
-#define DM_ARCHIVER_ID 0x0080L
-#define DM_MODIFY_DATE 0x0100L
-#define DM_MODIFY_TIME 0x0200L
-#define DM_MODIFIER_ID 0x0400L
-#define DM_LAST_ACCESS_DATE 0x0800L
-#define DM_INHERITED_RIGHTS_MASK 0x1000L
-#define DM_MAXIMUM_SPACE 0x2000L
-
-struct nw_modify_dos_info {
- u_int32_t attributes;
- u_int16_t creationDate;
- u_int16_t creationTime;
- u_int32_t creatorID;
- u_int16_t modifyDate;
- u_int16_t modifyTime;
- u_int32_t modifierID;
- u_int16_t archiveDate;
- u_int16_t archiveTime;
- u_int32_t archiverID;
- u_int16_t lastAccessDate;
- u_int16_t inheritanceGrantMask;
- u_int16_t inheritanceRevokeMask;
- u_int32_t maximumSpace;
-} __packed;
-
-struct nw_search_seq {
- u_int8_t volNumber;
- u_int32_t dirNumber;
- u_int32_t searchDirNumber;
-} __packed;
-
-typedef struct nw_search_seq SEARCH_SEQUENCE;
-
-struct ncp_file_server_info {
- u_int8_t ServerName[48];
- u_int8_t FileServiceVersion;
- u_int8_t FileServiceSubVersion;
- u_int16_t MaximumServiceConnections;
- u_int16_t ConnectionsInUse;
- u_int16_t NumberMountedVolumes;
- u_int8_t Revision;
- u_int8_t SFTLevel;
- u_int8_t TTSLevel;
- u_int16_t MaxConnectionsEverUsed;
- u_int8_t AccountVersion;
- u_int8_t VAPVersion;
- u_int8_t QueueVersion;
- u_int8_t PrintVersion;
- u_int8_t VirtualConsoleVersion;
- u_int8_t RestrictionLevel;
- u_int8_t InternetBridge;
- u_int8_t Reserved[60];
-} __packed;
-
-struct nw_time_buffer {
- u_int8_t year;
- u_int8_t month;
- u_int8_t day;
- u_int8_t hour;
- u_int8_t minute;
- u_int8_t second;
- u_int8_t wday;
-} __packed;
-
-#endif /*_NCP_H_ */
diff --git a/sys/netncp/ncp_cfg.h b/sys/netncp/ncp_cfg.h
deleted file mode 100644
index 82a30d7..0000000
--- a/sys/netncp/ncp_cfg.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * static configuration for libncp
- *
- * $FreeBSD$
- */
-
-#define NCP_NLS_KOI2CP866
-#define NCP_NLS_DEFAULT NCP_NLS_KOI_866
-#define NCP_PREFIX ""
diff --git a/sys/netncp/ncp_conn.c b/sys/netncp/ncp_conn.c
deleted file mode 100644
index 03ef5e3..0000000
--- a/sys/netncp/ncp_conn.c
+++ /dev/null
@@ -1,662 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Connection tables
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/priv.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-#include <sys/sysctl.h>
-
-#include <netncp/ncp.h>
-#include <netncp/nwerror.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_sock.h>
-#include <netncp/ncp_ncp.h>
-
-SLIST_HEAD(ncp_handle_head,ncp_handle);
-
-int ncp_burst_enabled = 1;
-
-struct ncp_conn_head conn_list={NULL};
-static int ncp_conn_cnt = 0;
-static int ncp_next_ref = 1;
-static struct lock listlock;
-
-struct ncp_handle_head lhlist={NULL};
-static int ncp_next_handle = 1;
-static struct lock lhlock;
-
-static int ncp_sysctl_connstat(SYSCTL_HANDLER_ARGS);
-static int ncp_conn_lock_any(struct ncp_conn *conn, struct thread *td,
- struct ucred *cred);
-
-SYSCTL_DECL(_net_ncp);
-SYSCTL_INT (_net_ncp, OID_AUTO, burst_enabled, CTLFLAG_RD, &ncp_burst_enabled, 0, "");
-SYSCTL_INT (_net_ncp, OID_AUTO, conn_cnt, CTLFLAG_RD, &ncp_conn_cnt, 0, "");
-SYSCTL_PROC(_net_ncp, OID_AUTO, conn_stat, CTLFLAG_RD|CTLTYPE_OPAQUE,
- NULL, 0, ncp_sysctl_connstat, "S,connstat", "Connections list");
-
-MALLOC_DEFINE(M_NCPDATA, "ncp_data", "NCP private data");
-
-int
-ncp_conn_init(void)
-{
- lockinit(&listlock, PSOCK, "ncpll", 0, 0);
- lockinit(&lhlock, PSOCK, "ncplh", 0, 0);
- return 0;
-}
-
-int
-ncp_conn_destroy(void)
-{
- if (ncp_conn_cnt) {
- NCPERROR("There are %d connections active\n", ncp_conn_cnt);
- return EBUSY;
- }
- lockdestroy(&listlock);
- lockdestroy(&lhlock);
- return 0;
-}
-
-int
-ncp_conn_locklist(int flags, struct thread *td)
-{
- return lockmgr(&listlock, flags | LK_CANRECURSE, 0);
-}
-
-void
-ncp_conn_unlocklist(struct thread *td)
-{
- lockmgr(&listlock, LK_RELEASE, 0);
-}
-
-int
-ncp_conn_access(struct ncp_conn *conn, struct ucred *cred, mode_t mode)
-{
- int error;
-
- if (cred == NOCRED || ncp_suser(cred) == 0 ||
- cred->cr_uid == conn->nc_owner->cr_uid)
- return 0;
- mode >>= 3;
- if (!groupmember(conn->nc_group, cred))
- mode >>= 3;
- error = (conn->li.access_mode & mode) == mode ? 0 : EACCES;
- return error;
-}
-
-int
-ncp_conn_lock_any(struct ncp_conn *conn, struct thread *td, struct ucred *cred)
-{
- int error;
-
- if (conn->nc_id == 0) return EACCES;
- error = lockmgr(&conn->nc_lock, LK_EXCLUSIVE | LK_CANRECURSE, 0);
- if (error == ERESTART)
- return EINTR;
- error = ncp_chkintr(conn, td);
- if (error) {
- lockmgr(&conn->nc_lock, LK_RELEASE, 0);
- return error;
- }
-
- if (conn->nc_id == 0) {
- lockmgr(&conn->nc_lock, LK_RELEASE, 0);
- return EACCES;
- }
- conn->td = td; /* who currently operates */
- conn->ucred = cred;
- return 0;
-}
-
-int
-ncp_conn_lock(struct ncp_conn *conn, struct thread *td, struct ucred *cred, int mode)
-{
- int error;
-
- error = ncp_conn_access(conn, cred, mode);
- if (error) return error;
- return ncp_conn_lock_any(conn, td, cred);
-}
-
-/*
- * Lock conn but unlock connlist
- */
-static int
-ncp_conn_lock2(struct ncp_conn *conn, struct thread *td, struct ucred *cred, int mode)
-{
- int error;
-
- error = ncp_conn_access(conn, cred, mode);
- if (error) {
- ncp_conn_unlocklist(td);
- return error;
- }
- conn->nc_lwant++;
- ncp_conn_unlocklist(td);
- error = ncp_conn_lock_any(conn, td, cred);
- conn->nc_lwant--;
- if (conn->nc_lwant == 0) {
- wakeup(&conn->nc_lwant);
- }
- return error;
-}
-
-void
-ncp_conn_unlock(struct ncp_conn *conn, struct thread *td)
-{
- /*
- * note, that LK_RELASE will do wakeup() instead of wakeup_one().
- * this will do a little overhead
- */
- lockmgr(&conn->nc_lock, LK_RELEASE, 0);
-}
-
-int
-ncp_conn_assert_locked(struct ncp_conn *conn, const char *checker, struct thread *td)
-{
- if (lockstatus(&conn->nc_lock) == LK_EXCLUSIVE) return 0;
- printf("%s: connection isn't locked!\n", checker);
- return EIO;
-}
-
-void
-ncp_conn_invalidate(struct ncp_conn *ncp)
-{
- ncp->flags &= ~(NCPFL_ATTACHED | NCPFL_LOGGED | NCPFL_INVALID);
-}
-
-int
-ncp_conn_invalid(struct ncp_conn *ncp)
-{
- return ncp->flags & NCPFL_INVALID;
-}
-
-/*
- * create, fill with defaults and return in locked state
- */
-int
-ncp_conn_alloc(struct ncp_conn_args *cap, struct thread *td, struct ucred *cred,
- struct ncp_conn **conn)
-{
- struct ncp_conn *ncp;
- struct ucred *owner;
- int error, isroot;
-
- if (cap->saddr.sa_family != AF_INET && cap->saddr.sa_family != AF_IPX)
- return EPROTONOSUPPORT;
- /*
- * Only root can change ownership.
- */
- isroot = ncp_suser(cred) == 0;
- if (cap->owner != NCP_DEFAULT_OWNER && !isroot)
- return EPERM;
- if (cap->group != NCP_DEFAULT_GROUP &&
- !groupmember(cap->group, cred) && !isroot)
- return EPERM;
- if (cap->owner != NCP_DEFAULT_OWNER) {
- owner = crget();
- crcopy(owner, cred);
- owner->cr_uid = cap->owner;
- } else
- owner = crhold(cred);
- ncp = malloc(sizeof(struct ncp_conn),
- M_NCPDATA, M_WAITOK | M_ZERO);
- error = 0;
- lockinit(&ncp->nc_lock, PZERO, "ncplck", 0, 0);
- ncp_conn_cnt++;
- ncp->nc_id = ncp_next_ref++;
- ncp->nc_owner = owner;
- ncp->seq = 0;
- ncp->connid = 0xFFFF;
- ncp->li = *cap;
- ncp->nc_group = (cap->group != NCP_DEFAULT_GROUP) ?
- cap->group : cred->cr_groups[0];
-
- if (cap->retry_count == 0)
- ncp->li.retry_count = NCP_RETRY_COUNT;
- if (cap->timeout == 0)
- ncp->li.timeout = NCP_RETRY_TIMEOUT;
- ncp_conn_lock_any(ncp, td, ncp->nc_owner);
- *conn = ncp;
- ncp_conn_locklist(LK_EXCLUSIVE, td);
- SLIST_INSERT_HEAD(&conn_list,ncp,nc_next);
- ncp_conn_unlocklist(td);
- return (error);
-}
-
-/*
- * Remove the connection, on entry it must be locked
- */
-int
-ncp_conn_free(struct ncp_conn *ncp)
-{
- struct thread *td;
- int error;
-
- if (ncp == NULL) {
- NCPFATAL("ncp == NULL\n");
- return 0;
- }
- if (ncp->nc_id == 0) {
- NCPERROR("nc_id == 0\n");
- return EACCES;
- }
- td = ncp->td;
- error = ncp_conn_assert_locked(ncp, __func__, td);
- if (error)
- return error;
- if (ncp->ref_cnt != 0 || (ncp->flags & NCPFL_PERMANENT))
- return EBUSY;
- if (ncp_conn_access(ncp, ncp->ucred, NCPM_WRITE))
- return EACCES;
-
- if (ncp->flags & NCPFL_ATTACHED)
- ncp_ncp_disconnect(ncp);
- ncp_sock_disconnect(ncp);
-
- /*
- * Mark conn as dead and wait for other process
- */
- ncp->nc_id = 0;
- ncp_conn_unlock(ncp, td);
- /*
- * if signal is raised - how I do react ?
- */
- lockmgr(&ncp->nc_lock, LK_DRAIN, 0);
- lockmgr(&ncp->nc_lock, LK_RELEASE, 0);
- lockdestroy(&ncp->nc_lock);
- while (ncp->nc_lwant) {
- printf("lwant = %d\n", ncp->nc_lwant);
- tsleep(&ncp->nc_lwant, PZERO,"ncpdr",2*hz);
- }
- ncp_conn_locklist(LK_EXCLUSIVE, td);
- SLIST_REMOVE(&conn_list, ncp, ncp_conn, nc_next);
- ncp_conn_cnt--;
- ncp_conn_unlocklist(td);
- if (ncp->li.user)
- free(ncp->li.user, M_NCPDATA);
- if (ncp->li.password)
- free(ncp->li.password, M_NCPDATA);
- crfree(ncp->nc_owner);
- free(ncp, M_NCPDATA);
- return (0);
-}
-
-int
-ncp_conn_reconnect(struct ncp_conn *ncp)
-{
- int error;
-
- /*
- * Close opened sockets if any
- */
- ncp_sock_disconnect(ncp);
- error = ncp_sock_connect(ncp);
- if (error)
- return error;
- error = ncp_ncp_connect(ncp);
- if (error)
- return error;
- error = ncp_renegotiate_connparam(ncp, NCP_DEFAULT_BUFSIZE, 0);
- if (error == NWE_SIGNATURE_LEVEL_CONFLICT) {
- printf("Unable to negotiate requested security level\n");
- error = EOPNOTSUPP;
- }
- if (error) {
- ncp_ncp_disconnect(ncp);
- return error;
- }
-#ifdef NCPBURST
- error = ncp_burst_connect(ncp);
- if (error) {
- ncp_ncp_disconnect(ncp);
- return error;
- }
-#endif
- return 0;
-}
-
-int
-ncp_conn_login(struct ncp_conn *conn, struct thread *td, struct ucred *cred)
-{
- struct ncp_bindery_object user;
- u_char ncp_key[8];
- int error;
-
- error = ncp_get_encryption_key(conn, ncp_key);
- if (error) {
- printf("%s: Warning: use unencrypted login\n", __func__);
- error = ncp_login_unencrypted(conn, conn->li.objtype,
- conn->li.user, conn->li.password, td, cred);
- } else {
- error = ncp_get_bindery_object_id(conn, conn->li.objtype,
- conn->li.user, &user, td, cred);
- if (error)
- return error;
- error = ncp_login_encrypted(conn, &user, ncp_key,
- conn->li.password, td, cred);
- }
- if (!error)
- conn->flags |= NCPFL_LOGGED | NCPFL_WASLOGGED;
- return error;
-}
-
-/*
- * Lookup connection by handle, return a locked conn descriptor
- */
-int
-ncp_conn_getbyref(int ref, struct thread *td, struct ucred *cred, int mode,
- struct ncp_conn **connpp)
-{
- struct ncp_conn *ncp;
- int error = 0;
-
- ncp_conn_locklist(LK_SHARED, td);
- SLIST_FOREACH(ncp, &conn_list, nc_next)
- if (ncp->nc_id == ref) break;
- if (ncp == NULL) {
- ncp_conn_unlocklist(td);
- return(EBADF);
- }
- error = ncp_conn_lock2(ncp, td, cred, mode);
- if (!error)
- *connpp = ncp;
- return (error);
-}
-/*
- * find attached, but not logged in connection to specified server
- */
-int
-ncp_conn_getattached(struct ncp_conn_args *li, struct thread *td,
- struct ucred *cred, int mode, struct ncp_conn **connpp)
-{
- struct ncp_conn *ncp, *ncp2 = NULL;
- int error = 0;
-
- ncp_conn_locklist(LK_SHARED, td);
- SLIST_FOREACH(ncp, &conn_list, nc_next) {
- if ((ncp->flags & NCPFL_LOGGED) != 0 ||
- strcmp(ncp->li.server,li->server) != 0 ||
- ncp->li.saddr.sa_len != li->saddr.sa_len ||
- bcmp(&ncp->li.saddr,&ncp->li.saddr,li->saddr.sa_len) != 0)
- continue;
- if (ncp_suser(cred) == 0 ||
- cred->cr_uid == ncp->nc_owner->cr_uid)
- break;
- error = ncp_conn_access(ncp,cred,mode);
- if (!error && ncp2 == NULL)
- ncp2 = ncp;
- }
- if (ncp == NULL) ncp = ncp2;
- if (ncp == NULL) {
- ncp_conn_unlocklist(td);
- return(EBADF);
- }
- error = ncp_conn_lock2(ncp, td, cred, mode);
- if (!error)
- *connpp=ncp;
- return (error);
-}
-
-/*
- * Lookup connection by server/user pair, return a locked conn descriptor.
- * if li is NULL or server/user pair incomplete, try to select best connection
- * based on owner.
- * Connection selected in next order:
- * 1. Try to search conn with ucred owner, if li is NULL also find a primary
- * 2. If 1. fails try to get first suitable shared connection
- * 3. If 2. fails then nothing can help to poor ucred owner
- */
-
-int
-ncp_conn_getbyli(struct ncp_conn_args *li, struct thread *td,
- struct ucred *cred, int mode, struct ncp_conn **connpp)
-{
- struct ncp_conn *ncp, *ncp2 = NULL;
- int error = 0, partial, haveserv;
-
- partial = (li == NULL || li->server[0] == 0 || li->user == NULL);
- haveserv = (li && li->server[0]);
- ncp_conn_locklist(LK_SHARED, td);
- SLIST_FOREACH(ncp, &conn_list, nc_next) {
- if (partial) {
- if (cred->cr_uid == ncp->nc_owner->cr_uid) {
- if (haveserv) {
- if (strcmp(ncp->li.server,li->server) == 0)
- break;
- } else {
- if (ncp->flags & NCPFL_PRIMARY)
- break;
- ncp2 = ncp;
- }
- continue;
- }
- } else {
- if (strcmp(ncp->li.server,li->server) != 0 ||
- ncp->li.user == NULL ||
- strcmp(ncp->li.user,li->user) != 0)
- continue;
- if (cred->cr_uid == ncp->nc_owner->cr_uid)
- break;
- if (ncp_suser(cred) == 0)
- ncp2 = ncp;
- }
- error = ncp_conn_access(ncp,cred,mode);
- if (!error && ncp2 == NULL)
- ncp2 = ncp;
- }
- if (ncp == NULL) ncp = ncp2;
- if (ncp == NULL) {
- ncp_conn_unlocklist(td);
- return(EBADF);
- }
- error = ncp_conn_lock2(ncp, td, cred,mode);
- if (!error)
- *connpp=ncp;
- return (error);
-}
-
-/*
- * Set primary connection flag, since it have sence only for an owner,
- * only owner can modify this flag.
- * connection expected to be locked.
- */
-int
-ncp_conn_setprimary(struct ncp_conn *conn, int on)
-{
- struct ncp_conn *ncp=NULL;
-
- if (conn->ucred->cr_uid != conn->nc_owner->cr_uid)
- return EACCES;
- ncp_conn_locklist(LK_SHARED, conn->td);
- SLIST_FOREACH(ncp, &conn_list, nc_next) {
- if (conn->ucred->cr_uid == ncp->nc_owner->cr_uid)
- ncp->flags &= ~NCPFL_PRIMARY;
- }
- ncp_conn_unlocklist(conn->td);
- if (on)
- conn->flags |= NCPFL_PRIMARY;
- return 0;
-}
-/*
- * Lease conn to given proc, returning unique handle
- * problem: how locks should be applied ?
- */
-int
-ncp_conn_gethandle(struct ncp_conn *conn, struct thread *td, struct ncp_handle **handle)
-{
- struct ncp_handle *refp;
-
- lockmgr(&lhlock, LK_EXCLUSIVE, 0);
- SLIST_FOREACH(refp, &lhlist, nh_next)
- if (refp->nh_conn == conn && td == refp->nh_td) break;
- if (refp) {
- conn->ref_cnt++;
- refp->nh_ref++;
- *handle = refp;
- lockmgr(&lhlock, LK_RELEASE, 0);
- return 0;
- }
- refp = malloc(sizeof(struct ncp_handle),M_NCPDATA,
- M_WAITOK | M_ZERO);
- SLIST_INSERT_HEAD(&lhlist,refp,nh_next);
- refp->nh_ref++;
- refp->nh_td = td;
- refp->nh_conn = conn;
- refp->nh_id = ncp_next_handle++;
- *handle = refp;
- conn->ref_cnt++;
- lockmgr(&lhlock, LK_RELEASE, 0);
- return 0;
-}
-/*
- * release reference, if force - ignore refcount
- */
-int
-ncp_conn_puthandle(struct ncp_handle *handle, struct thread *td, int force)
-{
- struct ncp_handle *refp = handle;
-
- lockmgr(&lhlock, LK_EXCLUSIVE, 0);
- refp->nh_ref--;
- refp->nh_conn->ref_cnt--;
- if (force) {
- refp->nh_conn->ref_cnt -= refp->nh_ref;
- refp->nh_ref = 0;
- }
- if (refp->nh_ref == 0) {
- SLIST_REMOVE(&lhlist, refp, ncp_handle, nh_next);
- free(refp, M_NCPDATA);
- }
- lockmgr(&lhlock, LK_RELEASE, 0);
- return 0;
-}
-/*
- * find a connHandle
- */
-int
-ncp_conn_findhandle(int connHandle, struct thread *td, struct ncp_handle **handle) {
- struct ncp_handle *refp;
-
- lockmgr(&lhlock, LK_SHARED, 0);
- SLIST_FOREACH(refp, &lhlist, nh_next)
- if (refp->nh_td == td && refp->nh_id == connHandle) break;
- lockmgr(&lhlock, LK_RELEASE, 0);
- if (refp == NULL) {
- return EBADF;
- }
- *handle = refp;
- return 0;
-}
-/*
- * Clear handles associated with specified process
- */
-int
-ncp_conn_putprochandles(struct thread *td)
-{
- struct ncp_handle *hp, *nhp;
- int haveone = 0;
-
- lockmgr(&lhlock, LK_EXCLUSIVE, 0);
- for (hp = SLIST_FIRST(&lhlist); hp; hp = nhp) {
- nhp = SLIST_NEXT(hp, nh_next);
- if (hp->nh_td != td) continue;
- haveone = 1;
- hp->nh_conn->ref_cnt -= hp->nh_ref;
- SLIST_REMOVE(&lhlist, hp, ncp_handle, nh_next);
- free(hp, M_NCPDATA);
- }
- lockmgr(&lhlock, LK_RELEASE, 0);
- return haveone;
-}
-/*
- * remove references in all possible connections,
- * XXX - possible problem is a locked list.
- */
-/*void
-ncp_conn_list_rm_ref(pid_t pid) {
- struct ncp_conn *ncp;
-
- ncp_conn_locklist(LK_SHARED, NULL);
- SLIST_FOREACH(ncp, &conn_list, nc_next) {
- ncp_conn_rm_ref(ncp,pid,1);
- }
- ncp_conn_unlocklist(NULL);
- return;
-}
-*/
-int
-ncp_conn_getinfo(struct ncp_conn *ncp, struct ncp_conn_stat *ncs) {
- bzero(ncs,sizeof(*ncs));
- ncs->li = ncp->li;
- ncs->li.user = ncs->user;
- if (ncp->li.user)
- strcpy(ncs->user, ncp->li.user);
- ncs->li.password = NULL;
- ncs->connRef = ncp->nc_id;
- ncs->ref_cnt = ncp->ref_cnt;
- ncs->connid = ncp->connid;
- ncs->owner = ncp->nc_owner->cr_uid;
- ncs->group = ncp->nc_group;
- ncs->flags = ncp->flags;
- ncs->buffer_size = ncp->buffer_size;
- return 0;
-}
-
-static int
-ncp_sysctl_connstat(SYSCTL_HANDLER_ARGS)
-{
- int error;
- struct ncp_conn_stat ncs;
- struct ncp_conn *ncp;
-/* struct ucred *cred = req->td->td_ucred;*/
-
- error = sysctl_wire_old_buffer(req, 0);
- if (error != 0)
- return (error);
- ncp_conn_locklist(LK_SHARED, req->td);
- error = SYSCTL_OUT(req, &ncp_conn_cnt, sizeof(ncp_conn_cnt));
- SLIST_FOREACH(ncp, &conn_list, nc_next) {
- if (error) break;
- /* I can't do conn_lock while list is locked */
- ncp->nc_lwant++;
- ncp_conn_getinfo(ncp, &ncs);
- ncp->nc_lwant--;
- error = SYSCTL_OUT(req, &ncs, sizeof(ncs));
- }
- ncp_conn_unlocklist(req->td);
- return(error);
-}
diff --git a/sys/netncp/ncp_conn.h b/sys/netncp/ncp_conn.h
deleted file mode 100644
index 0a87051..0000000
--- a/sys/netncp/ncp_conn.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NETNCP_NCP_CONN_H_
-#define _NETNCP_NCP_CONN_H_
-
-#ifndef _NETINET_IN_H_
-#include <netinet/in.h>
-#endif
-
-#ifndef _NETIPX_IPX_H_
-#include <netipx/ipx.h>
-#endif
-
-#ifndef _SYS_SOCKET_H_
-#include <sys/socket.h>
-#endif
-
-/* type of transport we use */
-/*#define NCP_ON_IPX 0
-#define NCP_ON_TCP 1*/
-
-/* flags field in conn structure */
-#define NCPFL_SOCONN 0x0001 /* socket layer is up */
-#define NCPFL_ATTACHED 0x0002 /* ncp layer is up */
-#define NCPFL_LOGGED 0x0004 /* logged in to server */
-#define NCPFL_INVALID 0x0008 /* last request was not completed */
-#define NCPFL_INTR 0x0010 /* interrupted call */
-#define NCPFL_RESTORING 0x0020 /* trying to reconnect */
-#define NCPFL_PERMANENT 0x0040 /* no way to kill conn, when this set */
-#define NCPFL_PRIMARY 0x0080 /* have meaning only for owner */
-#define NCPFL_WASATTACHED 0x0100 /* there was at least one successfull connect */
-#define NCPFL_WASLOGGED 0x0200 /* there was at least one successfull login */
-#define NCPFL_SIGNACTIVE 0x1000 /* packet signing active */
-#define NCPFL_SIGNWANTED 0x2000 /* signing should start */
-
-/* access mode for connection */
-#define NCPM_READ 0400 /* able to fetch conn params */
-#define NCPM_WRITE 0200 /* modify/close */
-#define NCPM_EXECUTE 0100 /* run requests */
-
-#define NCP_DEFAULT_OWNER ((uid_t)-1)
-#define NCP_DEFAULT_GROUP ((uid_t)-1)
-
-
-/* args used to create connection */
-#define ncp_conn_loginfo ncp_conn_args
-struct ncp_conn_args {
- int opt;
-#define NCP_OPT_WDOG 1 /* need watch dog socket */
-#define NCP_OPT_MSG 2 /* need message socket */
-#define NCP_OPT_SIGN 4 /* signatures wanted */
-#define NCP_OPT_BIND 8 /* force bindery login */
-#define NCP_OPT_PERMANENT 0x10 /* only for refernce, completly ignored */
-#define NCP_OPT_NOUPCASEPASS 0x20 /* leave password as is */
- int sig_level; /* wanted signature level */
- char server[NCP_BINDERY_NAME_LEN+1];
- char *user;
- char *password;
- u_int32_t objtype;
- union {
- struct sockaddr addr;
- struct sockaddr_ipx ipxaddr;
- struct sockaddr_in inaddr;
- } addr;
- int timeout; /* ncp rq timeout */
- int retry_count; /* counts to give an error */
- uid_t owner; /* proposed owner of connection */
- gid_t group; /* proposed group of connection */
- mode_t access_mode; /* R/W - can do rq's, X - can see the conn */
-};
-
-#define ipxaddr addr.ipxaddr
-#define inaddr addr.inaddr
-#define saddr addr.addr
-
-/* user side structure to issue ncp calls */
-struct ncp_buf {
- int rqsize; /* request size without ncp header */
- int rpsize; /* reply size minus ncp header */
- int cc; /* completion code */
- int cs; /* connection state */
- char packet[NCP_MAX_PACKET_SIZE];/* Here we prepare requests and receive replies */
-};
-
-/*
- * Connection status, returned via sysctl(vfs.nwfs.connstat)
- */
-struct ncp_conn_stat {
- struct ncp_conn_args li;
- int connRef;
- int ref_cnt;
- int connid;
- int buffer_size;
- int flags;
- int sign_active;
- uid_t owner;
- gid_t group;
- char user[NCP_MAXUSERNAMELEN+1];
-};
-
-#ifdef _KERNEL
-
-#ifndef LK_SHARED
-#include <sys/lock.h>
-#include <sys/lockmgr.h>
-#endif
-
-struct socket;
-struct u_cred;
-
-SLIST_HEAD(ncp_conn_head,ncp_conn);
-
-struct ncp_rq;
-struct ncp_conn;
-
-/*
- * External and internal processes can reference connection only by handle.
- * This gives us a freedom in maintance of underlying connections.
- */
-struct ncp_handle {
- SLIST_ENTRY(ncp_handle) nh_next;
- int nh_id; /* handle id */
- struct ncp_conn*nh_conn; /* which conn we are refernce */
- struct thread * nh_td; /* who owns the handle */
- int nh_ref; /* one process can asquire many handles, but we return the one */
-};
-
-/*
- * Describes any connection to server
- */
-struct ncp_conn {
- SLIST_ENTRY(ncp_conn) nc_next;
- struct ncp_conn_args li;
- struct ucred *nc_owner;
- gid_t nc_group;
- int flags;
- int nc_id;
- struct socket *ncp_so;
- struct socket *wdg_so;
- struct socket *msg_so;
- struct socket *bc_so;
- int ref_cnt; /* how many handles leased */
- SLIST_HEAD(ncp_ref_hd,ncp_ref) ref_list;/* list of handles */
- struct lock nc_lock; /* excl locks */
- int nc_lwant; /* number of wanted locks */
- struct thread *td; /* pid currently operates */
- struct ucred *ucred; /* usr currently operates */
- /* Fields used to process ncp requests */
- int connid; /* assigned by server */
- u_int8_t seq;
- int buffer_size; /* Negotiated bufsize */
- /* Fields used to make packet signatures */
- u_int32_t sign_root[2];
- u_int32_t sign_state[4]; /* md4 state */
-#ifdef NCPBURST
- /* Fields used for packet bursting */
- u_long bc_pktseq; /* raw packet sequence */
- u_short bc_seq; /* burst sequence */
- u_long bc_locid; /* local connection id */
- u_long bc_remid; /* remote connection id */
- u_long bc_pktsize; /* negotiated burst packet size */
-#endif
-};
-
-int ncp_conn_init(void);
-int ncp_conn_destroy(void);
-int ncp_conn_alloc(struct ncp_conn_args *cap,
- struct thread *td, struct ucred *cred, struct ncp_conn **connid);
-int ncp_conn_free(struct ncp_conn *conn);
-int ncp_conn_access(struct ncp_conn *conn,struct ucred *cred,mode_t mode);
-int ncp_conn_lock(struct ncp_conn *conn,struct thread *td, struct ucred *cred,int mode);
-void ncp_conn_unlock(struct ncp_conn *conn,struct thread *td);
-int ncp_conn_assert_locked(struct ncp_conn *conn,const char *checker,struct thread *td);
-void ncp_conn_invalidate(struct ncp_conn *ncp);
-int ncp_conn_invalid(struct ncp_conn *ncp);
-/*int ncp_conn_ref(struct ncp_conn *conn, pid_t pid);
-int ncp_conn_rm_ref(struct ncp_conn *conn, pid_t pid, int force);
-void ncp_conn_list_rm_ref(pid_t pid);*/
-int ncp_conn_getbyref(int connRef,struct thread *td, struct ucred *cred, int mode,
- struct ncp_conn **connpp);
-int ncp_conn_getbyli(struct ncp_conn_loginfo *li,struct thread *td, struct ucred *cred,
- int mode, struct ncp_conn **connpp);
-int ncp_conn_setprimary(struct ncp_conn *conn, int on);
-int ncp_conn_locklist(int flags, struct thread *td);
-void ncp_conn_unlocklist(struct thread *td);
-int ncp_conn_gethandle(struct ncp_conn *conn, struct thread *td, struct ncp_handle **handle);
-int ncp_conn_puthandle(struct ncp_handle *handle, struct thread *td, int force);
-int ncp_conn_findhandle(int connHandle, struct thread *td, struct ncp_handle **handle);
-int ncp_conn_getattached(struct ncp_conn_args *li,struct thread *td, struct ucred *cred,int mode, struct ncp_conn **connpp);
-int ncp_conn_putprochandles(struct thread *td);
-int ncp_conn_getinfo(struct ncp_conn *ncp, struct ncp_conn_stat *ncs);
-
-int ncp_conn_reconnect(struct ncp_conn *ncp);
-int ncp_conn_login(struct ncp_conn *conn, struct thread *td, struct ucred *cred);
-
-extern struct ncp_conn_head conn_list;
-extern int ncp_burst_enabled;
-
-#ifdef MALLOC_DECLARE
-MALLOC_DECLARE(M_NCPDATA);
-#endif
-
-#endif /* _KERNEL */
-#endif /* _NCP_CONN_H_ */
diff --git a/sys/netncp/ncp_crypt.c b/sys/netncp/ncp_crypt.c
deleted file mode 100644
index 9899ef6..0000000
--- a/sys/netncp/ncp_crypt.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Routines in this file based on work of Volker Lendecke
- */
-/*$*********************************************************
- $*
- $* This code has been taken from DDJ 11/93, from an
- $* article by Pawel Szczerbina.
- $*
- $* Password encryption routines follow.
- $* Converted to C from Barry Nance's Pascal
- $* prog published in the March -93 issue of Byte.
- $*
- $* Adapted to be useable for ncpfs by
- $* Volker Lendecke <lendecke@namu01.gwdg.de> in
- $* October 1995.
- $*
- $********************************************************* */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <netncp/ncp.h>
-#include <netncp/ncp_subr.h>
-
-typedef unsigned char buf32[32];
-
-static unsigned char encrypttable[256] = {
-0x7, 0x8, 0x0, 0x8, 0x6, 0x4, 0xE, 0x4, 0x5, 0xC, 0x1, 0x7, 0xB, 0xF, 0xA, 0x8,
-0xF, 0x8, 0xC, 0xC, 0x9, 0x4, 0x1, 0xE, 0x4, 0x6, 0x2, 0x4, 0x0, 0xA, 0xB, 0x9,
-0x2, 0xF, 0xB, 0x1, 0xD, 0x2, 0x1, 0x9, 0x5, 0xE, 0x7, 0x0, 0x0, 0x2, 0x6, 0x6,
-0x0, 0x7, 0x3, 0x8, 0x2, 0x9, 0x3, 0xF, 0x7, 0xF, 0xC, 0xF, 0x6, 0x4, 0xA, 0x0,
-0x2, 0x3, 0xA, 0xB, 0xD, 0x8, 0x3, 0xA, 0x1, 0x7, 0xC, 0xF, 0x1, 0x8, 0x9, 0xD,
-0x9, 0x1, 0x9, 0x4, 0xE, 0x4, 0xC, 0x5, 0x5, 0xC, 0x8, 0xB, 0x2, 0x3, 0x9, 0xE,
-0x7, 0x7, 0x6, 0x9, 0xE, 0xF, 0xC, 0x8, 0xD, 0x1, 0xA, 0x6, 0xE, 0xD, 0x0, 0x7,
-0x7, 0xA, 0x0, 0x1, 0xF, 0x5, 0x4, 0xB, 0x7, 0xB, 0xE, 0xC, 0x9, 0x5, 0xD, 0x1,
-0xB, 0xD, 0x1, 0x3, 0x5, 0xD, 0xE, 0x6, 0x3, 0x0, 0xB, 0xB, 0xF, 0x3, 0x6, 0x4,
-0x9, 0xD, 0xA, 0x3, 0x1, 0x4, 0x9, 0x4, 0x8, 0x3, 0xB, 0xE, 0x5, 0x0, 0x5, 0x2,
-0xC, 0xB, 0xD, 0x5, 0xD, 0x5, 0xD, 0x2, 0xD, 0x9, 0xA, 0xC, 0xA, 0x0, 0xB, 0x3,
-0x5, 0x3, 0x6, 0x9, 0x5, 0x1, 0xE, 0xE, 0x0, 0xE, 0x8, 0x2, 0xD, 0x2, 0x2, 0x0,
-0x4, 0xF, 0x8, 0x5, 0x9, 0x6, 0x8, 0x6, 0xB, 0xA, 0xB, 0xF, 0x0, 0x7, 0x2, 0x8,
-0xC, 0x7, 0x3, 0xA, 0x1, 0x4, 0x2, 0x5, 0xF, 0x7, 0xA, 0xC, 0xE, 0x5, 0x9, 0x3,
-0xE, 0x7, 0x1, 0x2, 0xE, 0x1, 0xF, 0x4, 0xA, 0x6, 0xC, 0x6, 0xF, 0x4, 0x3, 0x0,
-0xC, 0x0, 0x3, 0x6, 0xF, 0x8, 0x7, 0xB, 0x2, 0xD, 0xC, 0x6, 0xA, 0xA, 0x8, 0xD
-};
-
-static buf32 encryptkeys = {
- 0x48, 0x93, 0x46, 0x67, 0x98, 0x3D, 0xE6, 0x8D,
- 0xB7, 0x10, 0x7A, 0x26, 0x5A, 0xB9, 0xB1, 0x35,
- 0x6B, 0x0F, 0xD5, 0x70, 0xAE, 0xFB, 0xAD, 0x11,
- 0xF4, 0x47, 0xDC, 0xA7, 0xEC, 0xCF, 0x50, 0xC0
-};
-
-/*
- * Create table-based 16-bytes hash from a 32-bytes array
- */
-static void
-nw_hash(buf32 temp, unsigned char *target) {
- short sum;
- unsigned char b3;
- int s, b2, i;
-
- sum = 0;
-
- for (b2 = 0; b2 <= 1; ++b2) {
- for (s = 0; s <= 31; ++s) {
- b3 = (temp[s] + sum) ^ (temp[(s + sum) & 31] - encryptkeys[s]);
- sum += b3;
- temp[s] = b3;
- }
- }
-
- for (i = 0; i <= 15; ++i) {
- target[i] = encrypttable[temp[2 * i]]
- | (encrypttable[temp[2 * i + 1]] << 4);
- }
-}
-
-
-/*
- * Create a 16-bytes pattern from given buffer based on a four bytes key
- */
-void
-nw_keyhash(const u_char *key, const u_char *buf, int buflen, u_char *target) {
- int b2, d, s;
- buf32 temp;
-
- while (buflen > 0 && buf[buflen - 1] == 0)
- buflen--;
-
- bzero(temp, sizeof(temp));
-
- d = 0;
- while (buflen >= 32) {
- for (s = 0; s <= 31; ++s)
- temp[s] ^= buf[d++];
- buflen -= 32;
- }
- b2 = d;
- if (buflen > 0) {
- for (s = 0; s <= 31; ++s) {
- if (d + buflen == b2) {
- temp[s] ^= encryptkeys[s];
- b2 = d;
- } else
- temp[s] ^= buf[b2++];
- }
- }
- for (s = 0; s <= 31; ++s)
- temp[s] ^= key[s & 3];
-
- nw_hash(temp, target);
-}
-
-/*
- * Create an 8-bytes pattern from an 8-bytes key and 16-bytes of data
- */
-void
-nw_encrypt(const u_char *fra, const u_char *buf, u_char *target) {
- buf32 k;
- int s;
-
- nw_keyhash(fra, buf, 16, k);
- nw_keyhash(fra + 4, buf, 16, k + 16);
-
- for (s = 0; s < 16; s++)
- k[s] ^= k[31 - s];
-
- for (s = 0; s < 8; s++)
- *target++ = k[s] ^ k[15 - s];
-}
-
-#ifdef _KERNEL
-/*
- * MD4 routine taken from libmd sources
- */
-typedef u_int32_t UINT4;
-typedef unsigned char *POINTER;
-
-#define PROTO_LIST(list) list
-
-static void Decode PROTO_LIST
- ((UINT4 *, const unsigned char *, unsigned int));
-
-/* Constants for MD4Transform routine.
- */
-#define S11 3
-#define S12 7
-#define S13 11
-#define S14 19
-#define S21 3
-#define S22 5
-#define S23 9
-#define S24 13
-#define S31 3
-#define S32 9
-#define S33 11
-#define S34 15
-
-/* F, G and H are basic MD4 functions.
- */
-#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
-#define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z)))
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-
-/* ROTATE_LEFT rotates x left n bits.
- */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
-
-/* FF, GG and HH are transformations for rounds 1, 2 and 3 */
-/* Rotation is separate from addition to prevent recomputation */
-#define FF(a, b, c, d, x, s) { \
- (a) += F ((b), (c), (d)) + (x); \
- (a) = ROTATE_LEFT ((a), (s)); \
- }
-#define GG(a, b, c, d, x, s) { \
- (a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; \
- (a) = ROTATE_LEFT ((a), (s)); \
- }
-#define HH(a, b, c, d, x, s) { \
- (a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; \
- (a) = ROTATE_LEFT ((a), (s)); \
- }
-
-void
-ncp_sign(const u_int32_t *state, const char *block, u_int32_t *ostate) {
- UINT4 a, b, c, d, x[16];
-
- Decode (x, block, 64);
- a = state[0];
- b = state[1];
- c = state[2];
- d = state[3];
- /* Round 1 */
- FF (a, b, c, d, x[ 0], S11); /* 1 */
- FF (d, a, b, c, x[ 1], S12); /* 2 */
- FF (c, d, a, b, x[ 2], S13); /* 3 */
- FF (b, c, d, a, x[ 3], S14); /* 4 */
- FF (a, b, c, d, x[ 4], S11); /* 5 */
- FF (d, a, b, c, x[ 5], S12); /* 6 */
- FF (c, d, a, b, x[ 6], S13); /* 7 */
- FF (b, c, d, a, x[ 7], S14); /* 8 */
- FF (a, b, c, d, x[ 8], S11); /* 9 */
- FF (d, a, b, c, x[ 9], S12); /* 10 */
- FF (c, d, a, b, x[10], S13); /* 11 */
- FF (b, c, d, a, x[11], S14); /* 12 */
- FF (a, b, c, d, x[12], S11); /* 13 */
- FF (d, a, b, c, x[13], S12); /* 14 */
- FF (c, d, a, b, x[14], S13); /* 15 */
- FF (b, c, d, a, x[15], S14); /* 16 */
-
- /* Round 2 */
- GG (a, b, c, d, x[ 0], S21); /* 17 */
- GG (d, a, b, c, x[ 4], S22); /* 18 */
- GG (c, d, a, b, x[ 8], S23); /* 19 */
- GG (b, c, d, a, x[12], S24); /* 20 */
- GG (a, b, c, d, x[ 1], S21); /* 21 */
- GG (d, a, b, c, x[ 5], S22); /* 22 */
- GG (c, d, a, b, x[ 9], S23); /* 23 */
- GG (b, c, d, a, x[13], S24); /* 24 */
- GG (a, b, c, d, x[ 2], S21); /* 25 */
- GG (d, a, b, c, x[ 6], S22); /* 26 */
- GG (c, d, a, b, x[10], S23); /* 27 */
- GG (b, c, d, a, x[14], S24); /* 28 */
- GG (a, b, c, d, x[ 3], S21); /* 29 */
- GG (d, a, b, c, x[ 7], S22); /* 30 */
- GG (c, d, a, b, x[11], S23); /* 31 */
- GG (b, c, d, a, x[15], S24); /* 32 */
-
- /* Round 3 */
- HH (a, b, c, d, x[ 0], S31); /* 33 */
- HH (d, a, b, c, x[ 8], S32); /* 34 */
- HH (c, d, a, b, x[ 4], S33); /* 35 */
- HH (b, c, d, a, x[12], S34); /* 36 */
- HH (a, b, c, d, x[ 2], S31); /* 37 */
- HH (d, a, b, c, x[10], S32); /* 38 */
- HH (c, d, a, b, x[ 6], S33); /* 39 */
- HH (b, c, d, a, x[14], S34); /* 40 */
- HH (a, b, c, d, x[ 1], S31); /* 41 */
- HH (d, a, b, c, x[ 9], S32); /* 42 */
- HH (c, d, a, b, x[ 5], S33); /* 43 */
- HH (b, c, d, a, x[13], S34); /* 44 */
- HH (a, b, c, d, x[ 3], S31); /* 45 */
- HH (d, a, b, c, x[11], S32); /* 46 */
- HH (c, d, a, b, x[ 7], S33); /* 47 */
- HH (b, c, d, a, x[15], S34); /* 48 */
-
- ostate[0] = state[0] + a;
- ostate[1] = state[1] + b;
- ostate[2] = state[2] + c;
- ostate[3] = state[3] + d;
-}
-
-/* Decodes input (unsigned char) into output (UINT4). Assumes len is
- a multiple of 4.
- */
-static void Decode (output, input, len)
-
-UINT4 *output;
-const unsigned char *input;
-unsigned int len;
-{
- unsigned int i, j;
-
- for (i = 0, j = 0; j < len; i++, j += 4)
- output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) |
- (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24);
-}
-
-#endif /* _KERNEL */
diff --git a/sys/netncp/ncp_file.h b/sys/netncp/ncp_file.h
deleted file mode 100644
index 207a158..0000000
--- a/sys/netncp/ncp_file.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _NETNCP_NCP_FILE_H_
-#define _NETNCP_NCP_FILE_H_
-
-typedef struct {
- nuint32 sequence;
- nuint32 parent;
- nuint32 attributes;
- nuint8 uniqueID;
- nuint8 flags;
- nuint8 nameSpace;
- nuint8 nameLength;
- nuint8 name [256];
- nuint32 creationDateAndTime;
- nuint32 ownerID;
- nuint32 lastArchiveDateAndTime;
- nuint32 lastArchiverID;
- nuint32 updateDateAndTime;
- nuint32 updatorID;
- nuint32 fileSize;
- nuint8 reserved[44];
- nuint16 inheritedRightsMask;
- nuint16 lastAccessDate;
- nuint32 deletedTime;
- nuint32 deletedDateAndTime;
- nuint32 deletorID;
- nuint8 reserved3 [16];
-} __packed NWDELETED_INFO;
-
-__BEGIN_DECLS
-
-int ncp_AllocTempDirHandle(char *, NWDIR_HANDLE *);
-int ncp_DeallocateDirHandle(NWDIR_HANDLE);
-int ncp_GetNSEntryInfo(NWDIR_HANDLE, struct nw_entry_info *, int *);
-
-NWCCODE ncp_ScanNSEntryInfo(NWCONN_HANDLE, nuint8, nuint16,
- SEARCH_SEQUENCE *, pnstr8, nuint32, NW_ENTRY_INFO *);
-
-NWCCODE ncp_PurgeDeletedFile(NWCONN_HANDLE, nuint32, nuint32, nuint32, nuint8);
-
-NWCCODE NWRecoverDeletedFile(NWCONN_HANDLE, NWDIR_HANDLE,
- nuint32, nuint32, nuint32, pnstr8, pnstr8);
-
-NWCCODE ncp_ScanForDeletedFiles(NWCONN_HANDLE, pnuint32, pnuint32, pnuint32,
- nuint8, NWDELETED_INFO *);
-
-__END_DECLS
-
-#endif /* _NCP_NCP_FILE_ */
diff --git a/sys/netncp/ncp_lib.h b/sys/netncp/ncp_lib.h
deleted file mode 100644
index 275b53b..0000000
--- a/sys/netncp/ncp_lib.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _NETNCP_NCP_LIB_H_
-#define _NETNCP_NCP_LIB_H_
-
-#define IPX
-#define INET
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_user.h>
-#include <netncp/ncp_rq.h>
-
-#define ncp_printf printf
-
-#define sipx_cnetwork sipx_addr.x_net.c_net
-#define sipx_node sipx_addr.x_host.c_host
-#define ipx_netlong(iaddr) (((union ipx_net_u *)(&((iaddr).x_net)))->long_e)
-
-#define STDPARAM_ARGS 'A':case 'B':case 'C':case 'I':case 'M': \
- case 'N':case 'U':case 'R':case 'S':case 'T': \
- case 'W':case 'O':case 'P'
-
-#define STDPARAM_OPT "A:BCI:M:NO:P:U:R:S:T:W:"
-
-#ifndef min
-#define min(a,b) (((a)<(b)) ? (a) : (b))
-#endif
-
-
-/*
- * An attempt to do a unified options parser
- */
-enum ncp_argtype {NCA_STR,NCA_INT,NCA_BOOL};
-
-struct ncp_args;
-
-typedef int ncp_setopt_t (struct ncp_args*);
-
-#define NAFL_NONE 0x0000
-#define NAFL_HAVEMIN 0x0001
-#define NAFL_HAVEMAX 0x0002
-#define NAFL_MINMAX NAFL_HAVEMIN | NAFL_HAVEMAX
-
-struct ncp_args {
- enum ncp_argtype at;
- int opt; /* command line option */
- char *name; /* rc file equiv */
- int flag; /* NAFL_* */
- int ival; /* int/bool values, or max len for str value */
- char *str; /* string value */
- int min; /* min for ival */
- int max; /* max for ival */
- ncp_setopt_t *fn;/* call back to validate */
-};
-
-typedef struct {
- nuint8 day;
- nuint8 month;
- nuint16 year;
-} NW_DATE;
-
-/* hours is a nuint16 so that this structure will be the same length as a dword */
-typedef struct {
- nuint8 seconds;
- nuint8 minutes;
- nuint16 hours;
-} NW_TIME;
-
-struct ncp_bitname {
- u_int bn_bit;
- const char *bn_name;
-};
-
-__BEGIN_DECLS
-
-int ncp_args_parserc(struct ncp_args *, char *, ncp_setopt_t *);
-int ncp_args_parseopt(struct ncp_args *, int, char *, ncp_setopt_t *);
-
-
-struct sockaddr_ipx;
-struct ipx_addr;
-struct sockaddr;
-struct ncp_buf;
-struct rcfile;
-
-int ncp_initlib(void);
-int ncp_connect(struct ncp_conn_args *, int *);
-int ncp_connect_addr(struct sockaddr *, NWCONN_HANDLE *);
-int ncp_disconnect(int);
-int ncp_request(int, int, struct ncp_buf *);
-int ncp_conn_request(int, struct ncp_buf *);
-int ncp_login(int, const char *, int, const char *);
-int ncp_conn_scan(struct ncp_conn_loginfo *, int *);
-int ncp_conn_cnt(void);
-void *ncp_conn_list(void);
-int ncp_conn_getinfo(int, struct ncp_conn_stat *);
-int ncp_conn_getuser(int, char **);
-int ncp_conn2ref(int, int *);
-int ncp_conn_dup(NWCONN_HANDLE, NWCONN_HANDLE *);
-int ncp_path2conn(char *, int *);
-int ncp_li_init(struct ncp_conn_loginfo *, int, char *[]);
-void ncp_li_done(struct ncp_conn_loginfo *);
-int ncp_li_login(struct ncp_conn_loginfo *, int *);
-int ncp_li_readrc(struct ncp_conn_loginfo *);
-int ncp_li_check(struct ncp_conn_loginfo *);
-int ncp_li_arg(struct ncp_conn_loginfo *, int, char *);
-int ncp_li_setserver(struct ncp_conn_loginfo *, const char *);
-int ncp_li_setuser(struct ncp_conn_loginfo *, char *);
-int ncp_li_setpassword(struct ncp_conn_loginfo *, const char *);
-int ncp_conn_setflags(int, u_int16_t, u_int16_t);
-int ncp_conn_find(char *, char *);
-NWCCODE NWRequest(NWCONN_HANDLE, nuint16, nuint16, NW_FRAGMENT *,
- nuint16, NW_FRAGMENT *);
-
-#define ncp_setpermanent(connHandle,on) ncp_conn_setflags(connHandle, NCPFL_PERMANENT, (on) ? NCPFL_PERMANENT : 0)
-#define ncp_setprimary(connHandle,on) ncp_conn_setflags(connHandle, NCPFL_PRIMARY, (on) ? NCPFL_PRIMARY : 0)
-
-int ncp_find_fileserver(struct ncp_conn_loginfo *, int, char *);
-int ncp_find_server(struct ncp_conn_loginfo *, int, int, char *);
-
-/* misc rotines */
-char* ncp_str_upper(char *);
-int ncp_open_rcfile(void);
-int ncp_getopt(int, char * const *, const char *);
-void NWUnpackDateTime(nuint32, NW_DATE *, NW_TIME *);
-void NWUnpackDate(nuint16, NW_DATE *);
-void NWUnpackTime(nuint16, NW_TIME *);
-time_t ncp_UnpackDateTime(nuint32);
-int ncp_GetFileServerDateAndTime(NWCONN_HANDLE, time_t *);
-int ncp_SetFileServerDateAndTime(NWCONN_HANDLE, time_t *);
-NWCCODE NWDownFileServer(NWCONN_HANDLE, int);
-NWCCODE NWCloseBindery(NWCONN_HANDLE);
-NWCCODE NWOpenBindery(NWCONN_HANDLE);
-NWCCODE NWDisableTTS(NWCONN_HANDLE);
-NWCCODE NWEnableTTS(NWCONN_HANDLE);
-NWCCODE NWDisableFileServerLogin(NWCONN_HANDLE);
-NWCCODE NWEnableFileServerLogin(NWCONN_HANDLE);
-void ncp_error(const char *, int, ...) __printf0like(1, 3);
-char *ncp_printb(char *, int, const struct ncp_bitname *);
-void nw_keyhash(const u_char *, const u_char *, int, u_char *);
-void nw_encrypt(const u_char *, const u_char *, u_char *);
-void ipx_print_addr(struct ipx_addr *);
-
-/* bindery calls */
-int ncp_get_bindery_object_id(NWCONN_HANDLE, u_int16_t, const char *,
- struct ncp_bindery_object *);
-int ncp_get_bindery_object_name(NWCONN_HANDLE, u_int32_t,
- struct ncp_bindery_object *);
-int ncp_scan_bindery_object(NWCONN_HANDLE, u_int32_t, u_int16_t,
- const char *, struct ncp_bindery_object *);
-int ncp_read_property_value(NWCONN_HANDLE, int object_type, const char *,
- int, const char *, struct nw_property *);
-int ncp_get_encryption_key(NWCONN_HANDLE, char *);
-int ncp_change_obj_passwd(NWCONN_HANDLE,
- const struct ncp_bindery_object *, const u_char *,
- const u_char *, const u_char *);
-int ncp_keyed_verify_password(NWCONN_HANDLE, char *, char *,
- struct ncp_bindery_object *);
-
-/* queue calls */
-int ncp_create_queue_job_and_file(NWCONN_HANDLE, u_int32_t, struct queue_job *);
-int ncp_close_file_and_start_job(NWCONN_HANDLE, u_int32_t, struct queue_job *);
-int ncp_attach_to_queue(NWCONN_HANDLE, u_int32_t);
-int ncp_detach_from_queue(NWCONN_HANDLE, u_int32_t);
-int ncp_service_queue_job(NWCONN_HANDLE, u_int32_t, u_int16_t,
- struct queue_job *);
-int ncp_finish_servicing_job(NWCONN_HANDLE, u_int32_t, u_int32_t, u_int32_t);
-int ncp_abort_servicing_job(NWCONN_HANDLE, u_int32_t, u_int32_t);
-int ncp_get_queue_length(NWCONN_HANDLE, u_int32_t, u_int32_t *);
-int ncp_get_queue_job_ids(NWCONN_HANDLE, u_int32_t, u_int32_t,
- u_int32_t *, u_int32_t *, u_int32_t []);
-int ncp_get_queue_job_info(NWCONN_HANDLE, u_int32_t, u_int32_t,
- struct nw_queue_job_entry *);
-/*
- * filesystem and volume calls
- */
-int ncp_read(NWCONN_HANDLE, ncp_fh *, off_t, size_t, char *);
-int ncp_write(NWCONN_HANDLE, ncp_fh *, off_t, size_t, char *);
-int ncp_geteinfo(char *, struct nw_entry_info *);
-int ncp_NSEntryInfo(NWCONN_HANDLE, nuint8, nuint8, nuint32, NW_ENTRY_INFO *);
-
-NWCCODE NWGetVolumeName(NWCONN_HANDLE, u_char, char *);
-
-/* misc ncp calls */
-int ncp_get_file_server_information(NWCONN_HANDLE, struct ncp_file_server_info *);
-int ncp_get_stations_logged_info(NWCONN_HANDLE, u_int32_t,
- struct ncp_bindery_object *, time_t *);
-int ncp_get_internet_address(NWCONN_HANDLE, u_int32_t, struct ipx_addr *,
- u_int8_t *);
-NWCCODE NWGetObjectConnectionNumbers(NWCONN_HANDLE, pnstr8, nuint16,
- pnuint16, pnuint16, nuint16);
-/*
- * Message broadcast
- */
-NWCCODE NWDisableBroadcasts(NWCONN_HANDLE);
-NWCCODE NWEnableBroadcasts(NWCONN_HANDLE);
-NWCCODE NWBroadcastToConsole(NWCONN_HANDLE, pnstr8);
-NWCCODE NWSendBroadcastMessage(NWCONN_HANDLE, pnstr8, nuint16, pnuint16, pnuint8);
-NWCCODE NWGetBroadcastMessage(NWCONN_HANDLE, pnstr8);
-
-/*
- * RPC calls
- */
-NWCCODE NWSMExecuteNCFFile(NWCONN_HANDLE, pnstr8);
-NWCCODE NWSMLoadNLM(NWCONN_HANDLE, pnstr8);
-NWCCODE NWSMUnloadNLM(NWCONN_HANDLE, pnstr8);
-NWCCODE NWSMMountVolume(NWCONN_HANDLE, pnstr8, nuint32 *);
-NWCCODE NWSMDismountVolumeByName(NWCONN_HANDLE, pnstr8);
-NWCCODE NWSMSetDynamicCmdIntValue(NWCONN_HANDLE, pnstr8, nuint32);
-NWCCODE NWSMSetDynamicCmdStrValue(NWCONN_HANDLE, pnstr8, pnstr8);
-
-__END_DECLS
-
-extern int ncp_opterr, ncp_optind, ncp_optopt, ncp_optreset;
-extern char *ncp_optarg;
-
-extern struct rcfile *ncp_rc;
-extern int sysentoffset;
-#endif /* _NETNCP_NCP_LIB_H_ */
diff --git a/sys/netncp/ncp_mod.c b/sys/netncp/ncp_mod.c
deleted file mode 100644
index 955fa31..0000000
--- a/sys/netncp/ncp_mod.c
+++ /dev/null
@@ -1,529 +0,0 @@
-/*-
- * Copyright (c) 2003 Tim J. Robbins.
- * Copyright (c) 1999, 2000, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Boris Popov.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/priv.h>
-#include <sys/proc.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/sysctl.h>
-#include <sys/malloc.h>
-#include <sys/uio.h>
-#include <sys/ioccom.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_ncp.h>
-#include <netncp/ncp_user.h>
-#include <netncp/ncp_rq.h>
-#include <netncp/ncp_nls.h>
-#include <netncp/ncpio.h>
-
-int ncp_version = NCP_VERSION;
-
-SYSCTL_NODE(_net, OID_AUTO, ncp, CTLFLAG_RW, NULL, "NetWare requester");
-SYSCTL_INT(_net_ncp, OID_AUTO, version, CTLFLAG_RD, &ncp_version, 0, "");
-
-MODULE_VERSION(ncp, 1);
-MODULE_DEPEND(ncp, libmchain, 1, 1, 1);
-
-static struct cdev *ncp_dev;
-
-static d_ioctl_t ncp_ioctl;
-
-static struct cdevsw ncp_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
- .d_ioctl = ncp_ioctl,
- .d_name = "ncp",
-};
-
-static int ncp_conn_frag_rq(struct ncp_conn *, struct thread *,
- struct ncp_conn_frag *);
-static int ncp_conn_handler(struct thread *, struct ncpioc_request *,
- struct ncp_conn *, struct ncp_handle *);
-static int sncp_conn_scan(struct thread *, struct ncpioc_connscan *);
-static int sncp_connect(struct thread *, struct ncpioc_connect *);
-static int sncp_request(struct thread *, struct ncpioc_request *);
-
-static int
-ncp_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
-{
-
- switch (cmd) {
- case NCPIOC_CONNECT:
- return (sncp_connect(td, (struct ncpioc_connect *)data));
- case NCPIOC_CONNSCAN:
- return (sncp_conn_scan(td, (struct ncpioc_connscan *)data));
- case NCPIOC_REQUEST:
- return (sncp_request(td, (struct ncpioc_request *)data));
- }
- return (EINVAL);
-}
-
-/*
- * Attach to NCP server
- */
-
-static int
-sncp_connect(struct thread *td, struct ncpioc_connect *args)
-{
- int connHandle = 0, error;
- struct ncp_conn *conn;
- struct ncp_handle *handle;
- struct ncp_conn_args li;
-
- checkbad(copyin(args->ioc_li,&li,sizeof(li)));
- /* XXX Should be useracc() */
- checkbad(copyout(&connHandle,args->ioc_connhandle,
- sizeof(connHandle)));
- li.password = li.user = NULL;
- error = ncp_conn_getattached(&li, td, td->td_ucred, NCPM_WRITE | NCPM_EXECUTE, &conn);
- if (error) {
- error = ncp_conn_alloc(&li, td, td->td_ucred, &conn);
- if (error)
- goto bad;
- error = ncp_conn_reconnect(conn);
- if (error)
- ncp_conn_free(conn);
- }
- if (!error) {
- error = ncp_conn_gethandle(conn, td, &handle);
- copyout(&handle->nh_id, args->ioc_connhandle,
- sizeof(args->ioc_connhandle));
- ncp_conn_unlock(conn,td);
- }
-bad:
- return error;
-}
-
-static int
-sncp_request(struct thread *td, struct ncpioc_request *args)
-{
- struct ncp_rq *rqp;
- struct ncp_conn *conn;
- struct ncp_handle *handle;
- int error = 0, rqsize;
-
- error = ncp_conn_findhandle(args->ioc_connhandle, td, &handle);
- if (error)
- return error;
- conn = handle->nh_conn;
- if (args->ioc_fn == NCP_CONN)
- return ncp_conn_handler(td, args, conn, handle);
- error = copyin(&args->ioc_ncpbuf->rqsize, &rqsize, sizeof(int));
- if (error)
- return(error);
- error = ncp_rq_alloc(args->ioc_fn, conn, td, td->td_ucred, &rqp);
- if (error)
- return error;
- if (rqsize) {
- error = mb_put_mem(&rqp->rq, (caddr_t)args->ioc_ncpbuf->packet,
- rqsize, MB_MUSER);
- if (error)
- goto bad;
- }
- rqp->nr_flags |= NCPR_DONTFREEONERR;
- error = ncp_request(rqp);
- if (error == 0 && rqp->nr_rpsize)
- error = md_get_mem(&rqp->rp, (caddr_t)args->ioc_ncpbuf->packet,
- rqp->nr_rpsize, MB_MUSER);
- copyout(&rqp->nr_cs, &args->ioc_ncpbuf->cs, sizeof(rqp->nr_cs));
- copyout(&rqp->nr_cc, &args->ioc_ncpbuf->cc, sizeof(rqp->nr_cc));
- copyout(&rqp->nr_rpsize, &args->ioc_ncpbuf->rpsize, sizeof(rqp->nr_rpsize));
-bad:
- ncp_rq_done(rqp);
- return error;
-}
-
-static int
-ncp_mod_login(struct ncp_conn *conn, char *user, int objtype, char *password,
- struct thread *td, struct ucred *cred)
-{
- int error;
-
- if (ncp_suser(cred) != 0 && cred->cr_uid != conn->nc_owner->cr_uid)
- return EACCES;
- conn->li.user = ncp_str_dup(user);
- if (conn->li.user == NULL)
- return ENOMEM;
- conn->li.password = ncp_str_dup(password);
- if (conn->li.password == NULL) {
- error = ENOMEM;
- goto bad;
- }
- ncp_str_upper(conn->li.user);
- if ((conn->li.opt & NCP_OPT_NOUPCASEPASS) == 0)
- ncp_str_upper(conn->li.password);
- conn->li.objtype = objtype;
- error = ncp_conn_login(conn, td, cred);
- return error;
-bad:
- if (conn->li.user) {
- free(conn->li.user, M_NCPDATA);
- conn->li.user = NULL;
- }
- if (conn->li.password) {
- free(conn->li.password, M_NCPDATA);
- conn->li.password = NULL;
- }
- return error;
-}
-
-static int
-ncp_conn_handler(struct thread *td, struct ncpioc_request *args,
- struct ncp_conn *conn, struct ncp_handle *hp)
-{
- int error = 0, rqsize, subfn;
- struct ucred *cred;
-
- char *pdata;
-
- cred = td->td_ucred;
- error = copyin(&args->ioc_ncpbuf->rqsize, &rqsize, sizeof(int));
- if (error)
- return(error);
- error = 0;
- pdata = args->ioc_ncpbuf->packet;
- subfn = *(pdata++) & 0xff;
- rqsize--;
- switch (subfn) {
- case NCP_CONN_READ: case NCP_CONN_WRITE: {
- struct ncp_rw rwrq;
- struct uio auio;
- struct iovec iov;
-
- if (rqsize != sizeof(rwrq))
- return (EBADRPC);
- error = copyin(pdata,&rwrq,rqsize);
- if (error)
- return (error);
- iov.iov_base = rwrq.nrw_base;
- iov.iov_len = rwrq.nrw_cnt;
- auio.uio_iov = &iov;
- auio.uio_iovcnt = 1;
- auio.uio_offset = rwrq.nrw_offset;
- auio.uio_resid = rwrq.nrw_cnt;
- auio.uio_segflg = UIO_USERSPACE;
- auio.uio_rw = (subfn == NCP_CONN_READ) ? UIO_READ : UIO_WRITE;
- auio.uio_td = td;
- if (subfn == NCP_CONN_READ)
- error = ncp_read(conn, &rwrq.nrw_fh, &auio, cred);
- else
- error = ncp_write(conn, &rwrq.nrw_fh, &auio, cred);
- rwrq.nrw_cnt -= auio.uio_resid;
- /*td->td_retval[0] = rwrq.nrw_cnt;*/
- break;
- } /* case int_read/write */
- case NCP_CONN_SETFLAGS: {
- u_int16_t mask, flags;
-
- error = copyin(pdata,&mask, sizeof(mask));
- if (error)
- return error;
- pdata += sizeof(mask);
- error = copyin(pdata,&flags,sizeof(flags));
- if (error)
- return error;
- error = ncp_conn_lock(conn, td, cred, NCPM_WRITE);
- if (error)
- return error;
- if (mask & NCPFL_PERMANENT) {
- conn->flags &= ~NCPFL_PERMANENT;
- conn->flags |= (flags & NCPFL_PERMANENT);
- }
- if (mask & NCPFL_PRIMARY) {
- error = ncp_conn_setprimary(conn, flags & NCPFL_PRIMARY);
- if (error) {
- ncp_conn_unlock(conn, td);
- break;
- }
- }
- ncp_conn_unlock(conn, td);
- break;
- }
- case NCP_CONN_LOGIN: {
- struct ncp_conn_login la;
-
- if (rqsize != sizeof(la))
- return EBADRPC;
- if (conn->flags & NCPFL_LOGGED)
- return EALREADY;
- if ((error = copyin(pdata,&la,rqsize)) != 0)
- break;
- error = ncp_conn_lock(conn, td, cred, NCPM_EXECUTE | NCPM_WRITE);
- if (error)
- return error;
- error = ncp_mod_login(conn, la.username, la.objtype,
- la.password, td, td->td_ucred);
- ncp_conn_unlock(conn, td);
- break;
- }
- case NCP_CONN_GETINFO: {
- struct ncp_conn_stat ncs;
- int len = sizeof(ncs);
-
- error = ncp_conn_lock(conn, td, td->td_ucred, NCPM_READ);
- if (error)
- return error;
- ncp_conn_getinfo(conn, &ncs);
- copyout(&len, &args->ioc_ncpbuf->rpsize, sizeof(int));
- error = copyout(&ncs, &args->ioc_ncpbuf->packet, len);
- ncp_conn_unlock(conn, td);
- break;
- }
- case NCP_CONN_GETUSER: {
- int len;
-
- error = ncp_conn_lock(conn, td, td->td_ucred, NCPM_READ);
- if (error)
- return error;
- len = (conn->li.user) ? strlen(conn->li.user) + 1 : 0;
- copyout(&len, &args->ioc_ncpbuf->rpsize, sizeof(int));
- if (len) {
- error = copyout(conn->li.user,
- &args->ioc_ncpbuf->packet, len);
- }
- ncp_conn_unlock(conn, td);
- break;
- }
- case NCP_CONN_CONN2REF: {
- int len = sizeof(int);
-
- error = ncp_conn_lock(conn, td, td->td_ucred, NCPM_READ);
- if (error)
- return error;
- copyout(&len, &args->ioc_ncpbuf->rpsize, sizeof(int));
- if (len) {
- error = copyout(&conn->nc_id,
- &args->ioc_ncpbuf->packet, len);
- }
- ncp_conn_unlock(conn, td);
- break;
- }
- case NCP_CONN_FRAG: {
- struct ncp_conn_frag nf;
-
- if (rqsize != sizeof(nf))
- return (EBADRPC);
- if ((error = copyin(pdata, &nf, rqsize)) != 0) break;
- error = ncp_conn_lock(conn, td, cred, NCPM_EXECUTE);
- if (error)
- return error;
- error = ncp_conn_frag_rq(conn, td, &nf);
- ncp_conn_unlock(conn, td);
- copyout(&nf, &pdata, sizeof(nf));
- td->td_retval[0] = error;
- break;
- }
- case NCP_CONN_DUP: {
- struct ncp_handle *newhp;
- int len = sizeof(NWCONN_HANDLE);
-
- error = ncp_conn_lock(conn, td, cred, NCPM_READ);
- if (error) break;
- copyout(&len, &args->ioc_ncpbuf->rpsize, len);
- error = ncp_conn_gethandle(conn, td, &newhp);
- if (!error)
- error = copyout(&newhp->nh_id,
- args->ioc_ncpbuf->packet, len);
- ncp_conn_unlock(conn, td);
- break;
- }
- case NCP_CONN_CONNCLOSE: {
- error = ncp_conn_lock(conn, td, cred, NCPM_EXECUTE);
- if (error) break;
- ncp_conn_puthandle(hp, td, 0);
- error = ncp_conn_free(conn);
- if (error)
- ncp_conn_unlock(conn, td);
- break;
- }
- default:
- error = EOPNOTSUPP;
- }
- return error;
-}
-
-static int
-sncp_conn_scan(struct thread *td, struct ncpioc_connscan *args)
-{
- int connHandle = 0, error;
- struct ncp_conn_args li, *lip;
- struct ncp_conn *conn;
- struct ncp_handle *hp;
- char *user = NULL, *password = NULL;
-
- if (args->ioc_li) {
- if (copyin(args->ioc_li, &li, sizeof(li)))
- return EFAULT;
- lip = &li;
- } else {
- lip = NULL;
- }
-
- if (lip != NULL) {
- lip->server[sizeof(lip->server)-1]=0; /* just to make sure */
- ncp_str_upper(lip->server);
- if (lip->user) {
- user = ncp_str_dup(lip->user);
- if (user == NULL)
- return EINVAL;
- ncp_str_upper(user);
- }
- if (lip->password) {
- password = ncp_str_dup(lip->password);
- if (password == NULL) {
- if (user)
- free(user, M_NCPDATA);
- return EINVAL;
- }
- ncp_str_upper(password);
- }
- lip->user = user;
- lip->password = password;
- }
- error = ncp_conn_getbyli(lip, td, td->td_ucred, NCPM_EXECUTE, &conn);
- if (!error) { /* already have this login */
- ncp_conn_gethandle(conn, td, &hp);
- connHandle = hp->nh_id;
- ncp_conn_unlock(conn, td);
- copyout(&connHandle, args->ioc_connhandle, sizeof(connHandle));
- }
- if (user)
- free(user, M_NCPDATA);
- if (password)
- free(password, M_NCPDATA);
- return error;
-
-}
-
-int
-ncp_conn_frag_rq(struct ncp_conn *conn, struct thread *td,
- struct ncp_conn_frag *nfp)
-{
- NW_FRAGMENT *fp;
- struct ncp_rq *rqp;
- u_int32_t fsize;
- int error, i, rpsize;
-
- error = ncp_rq_alloc(nfp->fn, conn, td, td->td_ucred, &rqp);
- if (error)
- return error;
- for(fp = nfp->rqf, i = 0; i < nfp->rqfcnt; i++, fp++) {
- error = mb_put_mem(&rqp->rq, (caddr_t)fp->fragAddress, fp->fragSize, MB_MUSER);
- if (error)
- goto bad;
- }
- rqp->nr_flags |= NCPR_DONTFREEONERR;
- error = ncp_request(rqp);
- if (error)
- goto bad;
- rpsize = rqp->nr_rpsize;
- if (rpsize && nfp->rpfcnt) {
- for(fp = nfp->rpf, i = 0; i < nfp->rpfcnt; i++, fp++) {
- error = copyin(&fp->fragSize, &fsize, sizeof (fsize));
- if (error)
- break;
- fsize = min(fsize, rpsize);
- error = md_get_mem(&rqp->rp, (caddr_t)fp->fragAddress, fsize, MB_MUSER);
- if (error)
- break;
- rpsize -= fsize;
- error = copyout(&fsize, &fp->fragSize, sizeof (fsize));
- if (error)
- break;
- }
- }
- nfp->cs = rqp->nr_cs;
- nfp->cc = rqp->nr_cc;
-bad:
- ncp_rq_done(rqp);
- return error;
-}
-
-static int
-ncp_load(void)
-{
- int error;
-
- if ((error = ncp_init()) != 0)
- return (error);
- ncp_dev = make_dev(&ncp_cdevsw, 0, 0, 0, 0666, "ncp");
- printf("ncp_load: loaded\n");
- return (0);
-}
-
-static int
-ncp_unload(void)
-{
- int error;
-
- error = ncp_done();
- if (error)
- return (error);
- destroy_dev(ncp_dev);
- printf("ncp_unload: unloaded\n");
- return (0);
-}
-
-static int
-ncp_mod_handler(module_t mod, int type, void *data)
-{
- int error;
-
- switch (type) {
- case MOD_LOAD:
- error = ncp_load();
- break;
- case MOD_UNLOAD:
- error = ncp_unload();
- break;
- default:
- error = EINVAL;
- }
- return error;
-}
-
-static moduledata_t ncp_mod = {
- "ncp",
- ncp_mod_handler,
- NULL
-};
-DECLARE_MODULE(ncp, ncp_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY);
diff --git a/sys/netncp/ncp_ncp.c b/sys/netncp/ncp_ncp.c
deleted file mode 100644
index 943639e..0000000
--- a/sys/netncp/ncp_ncp.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Core of NCP protocol
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/signalvar.h>
-#include <sys/sysctl.h>
-#include <sys/mbuf.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
-#include <sys/uio.h>
-
-#include <netipx/ipx.h>
-#include <netipx/ipx_var.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_sock.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_ncp.h>
-#include <netncp/ncp_rq.h>
-#include <netncp/nwerror.h>
-
-#ifdef NCP_DATA_DEBUG
-static
-void m_dumpm(struct mbuf *m) {
- char *p;
- int len;
- printf("d=");
- while(m) {
- p=mtod(m,char *);
- len=m->m_len;
- printf("(%d)",len);
- while(len--){
- printf("%02x ",((int)*(p++)) & 0xff);
- }
- m=m->m_next;
- };
- printf("\n");
-}
-#endif /* NCP_DATA_DEBUG */
-
-int
-ncp_chkintr(struct ncp_conn *conn, struct thread *td)
-{
- struct proc *p;
- sigset_t tmpset;
-
- if (td == NULL)
- return 0;
- p = td->td_proc;
- PROC_LOCK(p);
- tmpset = p->p_siglist;
- SIGSETOR(tmpset, td->td_siglist);
- SIGSETNAND(tmpset, td->td_sigmask);
- mtx_lock(&p->p_sigacts->ps_mtx);
- SIGSETNAND(tmpset, p->p_sigacts->ps_sigignore);
- mtx_unlock(&p->p_sigacts->ps_mtx);
- if (SIGNOTEMPTY(td->td_siglist) && NCP_SIGMASK(tmpset)) {
- PROC_UNLOCK(p);
- return EINTR;
- }
- PROC_UNLOCK(p);
- return 0;
-}
-
-/*
- * Process initial NCP handshake (attach)
- * NOTE: Since all functions below may change conn attributes, they
- * should be called with LOCKED connection, also they use procp & ucred
- */
-int
-ncp_ncp_connect(struct ncp_conn *conn)
-{
- struct ncp_rq *rqp;
- struct ncp_rphdr *rp;
- int error;
-
- error = ncp_rq_alloc_any(NCP_ALLOC_SLOT, 0, conn, conn->td, conn->ucred, &rqp);
- if (error)
- return error;
-
- conn->flags &= ~(NCPFL_SIGNACTIVE | NCPFL_SIGNWANTED |
- NCPFL_ATTACHED | NCPFL_LOGGED | NCPFL_INVALID);
- conn->seq = 0;
- error = ncp_request_int(rqp);
- if (!error) {
- rp = mtod(rqp->rp.md_top, struct ncp_rphdr*);
- conn->connid = rp->conn_low + (rp->conn_high << 8);
- }
- ncp_rq_done(rqp);
- if (error)
- return error;
- conn->flags |= NCPFL_ATTACHED | NCPFL_WASATTACHED;
- return 0;
-}
-
-int
-ncp_ncp_disconnect(struct ncp_conn *conn)
-{
- struct ncp_rq *rqp;
- int error;
-
- NCPSDEBUG("for connid=%d\n",conn->nc_id);
-#ifdef NCPBURST
- ncp_burst_disconnect(conn);
-#endif
- if (conn->flags & NCPFL_ATTACHED) {
- error = ncp_rq_alloc_any(NCP_FREE_SLOT, 0, conn, conn->td, conn->ucred, &rqp);
- if (!error) {
- ncp_request_int(rqp);
- ncp_rq_done(rqp);
- }
- }
- ncp_conn_invalidate(conn);
- ncp_sock_disconnect(conn);
- return 0;
-}
-
-/*
- * All negotiation functions expect a locked connection
- */
-
-int
-ncp_negotiate_buffersize(struct ncp_conn *conn, int size, int *target)
-{
- struct ncp_rq *rqp;
- u_int16_t bsize;
- int error;
-
- error = ncp_rq_alloc(0x21, conn, conn->td, conn->ucred, &rqp);
- if (error)
- return error;
- mb_put_uint16be(&rqp->rq, size);
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_uint16be(&rqp->rp, &bsize);
- *target = min(bsize, size);
- ncp_rq_done(rqp);
- return error;
-}
-
-static int
-ncp_negotiate_size_and_options(struct ncp_conn *conn, int size, int options,
- int *ret_size, u_int8_t *ret_options)
-{
- struct ncp_rq *rqp;
- u_int16_t rs;
- int error;
-
- error = ncp_rq_alloc(0x61, conn, conn->td, conn->ucred, &rqp);
- if (error)
- return error;
- mb_put_uint16be(&rqp->rq, size);
- mb_put_uint8(&rqp->rq, options);
- rqp->nr_minrplen = 2 + 2 + 1;
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_uint16be(&rqp->rp, &rs);
- *ret_size = (rs == 0) ? size : min(rs, size);
- md_get_uint16be(&rqp->rp, &rs); /* skip echo socket */
- md_get_uint8(&rqp->rp, ret_options);
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_renegotiate_connparam(struct ncp_conn *conn, int buffsize, u_int8_t in_options)
-{
- u_int8_t options;
- int neg_buffsize, error, sl, ckslevel;
- size_t ilen;
-
- sl = conn->li.sig_level;
- if (sl >= 2)
- in_options |= NCP_SECURITY_LEVEL_SIGN_HEADERS;
- if (conn->li.saddr.sa_family == AF_IPX) {
- ilen = sizeof(ckslevel);
- error = kernel_sysctlbyname(curthread, "net.ipx.ipx.checksum",
- &ckslevel, &ilen, NULL, 0, NULL, 0);
- if (error)
- return error;
- if (ckslevel == 2)
- in_options |= NCP_IPX_CHECKSUM;
- }
- error = ncp_negotiate_size_and_options(conn, buffsize, in_options,
- &neg_buffsize, &options);
- if (!error) {
- if (conn->li.saddr.sa_family == AF_IPX &&
- ((options ^ in_options) & NCP_IPX_CHECKSUM)) {
- if (ckslevel == 2) {
- printf("Server refuses to support IPX checksums\n");
- return NWE_REQUESTER_FAILURE;
- }
- in_options |= NCP_IPX_CHECKSUM;
- error = 1;
- }
- if ((options ^ in_options) & 2) {
- if (sl == 0 || sl == 3)
- return NWE_SIGNATURE_LEVEL_CONFLICT;
- if (sl == 1) {
- in_options |= NCP_SECURITY_LEVEL_SIGN_HEADERS;
- error = 1;
- }
- }
- if (error) {
- error = ncp_negotiate_size_and_options(conn,
- buffsize, in_options, &neg_buffsize, &options);
- if ((options ^ in_options) & 3) {
- return NWE_SIGNATURE_LEVEL_CONFLICT;
- }
- }
- } else {
- in_options &= ~NCP_SECURITY_LEVEL_SIGN_HEADERS;
- error = ncp_negotiate_buffersize(conn, NCP_DEFAULT_BUFSIZE,
- &neg_buffsize);
- }
- if (error) return error;
- if ((neg_buffsize < 512) || (neg_buffsize > NCP_MAX_BUFSIZE))
- return EINVAL;
- conn->buffer_size = neg_buffsize;
- if (in_options & NCP_SECURITY_LEVEL_SIGN_HEADERS)
- conn->flags |= NCPFL_SIGNWANTED;
- if (conn->li.saddr.sa_family == AF_IPX)
- ncp_sock_checksum(conn, in_options & NCP_IPX_CHECKSUM);
- return 0;
-}
-
-void
-ncp_check_rq(struct ncp_conn *conn)
-{
- return;
- if (conn->flags & NCPFL_INTR)
- return;
- /* first, check for signals */
- if (ncp_chkintr(conn, conn->td))
- conn->flags |= NCPFL_INTR;
- return;
-}
-
-int
-ncp_get_bindery_object_id(struct ncp_conn *conn,
- u_int16_t object_type, char *object_name,
- struct ncp_bindery_object *target,
- struct thread *td, struct ucred *cred)
-{
- struct ncp_rq *rqp;
- int error;
-
- error = ncp_rq_alloc_subfn(23, 53, conn, conn->td, conn->ucred, &rqp);
- mb_put_uint16be(&rqp->rq, object_type);
- ncp_rq_pstring(rqp, object_name);
- rqp->nr_minrplen = 54;
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_uint32be(&rqp->rp, &target->object_id);
- md_get_uint16be(&rqp->rp, &target->object_type);
- md_get_mem(&rqp->rp, (caddr_t)target->object_name, 48, MB_MSYSTEM);
- ncp_rq_done(rqp);
- return 0;
-}
-
-/*
- * target is a 8-byte buffer
- */
-int
-ncp_get_encryption_key(struct ncp_conn *conn, char *target)
-{
- struct ncp_rq *rqp;
- int error;
-
- error = ncp_rq_alloc_subfn(23, 23, conn, conn->td, conn->ucred, &rqp);
- if (error)
- return error;
- rqp->nr_minrplen = 8;
- error = ncp_request(rqp);
- if (error)
- return error;
- md_get_mem(&rqp->rp, target, 8, MB_MSYSTEM);
- ncp_rq_done(rqp);
- return error;
-}
-
-/*
- * Initialize packet signatures. They a slightly modified MD4.
- * The first 16 bytes of logindata are the shuffled password,
- * the last 8 bytes the encryption key as received from the server.
- */
-static int
-ncp_sign_start(struct ncp_conn *conn, char *logindata)
-{
- char msg[64];
- u_int32_t state[4];
-
- memcpy(msg, logindata, 24);
- memcpy(msg + 24, "Authorized NetWare Client", 25);
- bzero(msg + 24 + 25, sizeof(msg) - 24 - 25);
-
- conn->sign_state[0] = 0x67452301;
- conn->sign_state[1] = 0xefcdab89;
- conn->sign_state[2] = 0x98badcfe;
- conn->sign_state[3] = 0x10325476;
- ncp_sign(conn->sign_state, msg, state);
- conn->sign_root[0] = state[0];
- conn->sign_root[1] = state[1];
- conn->flags |= NCPFL_SIGNACTIVE;
- return 0;
-}
-
-
-int
-ncp_login_encrypted(struct ncp_conn *conn, struct ncp_bindery_object *object,
- const u_char *key, const u_char *passwd,
- struct thread *td, struct ucred *cred)
-{
- struct ncp_rq *rqp;
- struct mbchain *mbp;
- u_int32_t tmpID = htonl(object->object_id);
- u_char buf[16 + 8];
- u_char encrypted[8];
- int error;
-
- nw_keyhash((u_char*)&tmpID, passwd, strlen(passwd), buf);
- nw_encrypt(key, buf, encrypted);
-
- error = ncp_rq_alloc_subfn(23, 24, conn, td, cred, &rqp);
- if (error)
- return error;
- mbp = &rqp->rq;
- mb_put_mem(mbp, encrypted, 8, MB_MSYSTEM);
- mb_put_uint16be(mbp, object->object_type);
- ncp_rq_pstring(rqp, object->object_name);
- error = ncp_request(rqp);
- if (!error)
- ncp_rq_done(rqp);
- if ((conn->flags & NCPFL_SIGNWANTED) &&
- (error == 0 || error == NWE_PASSWORD_EXPIRED)) {
- bcopy(key, buf + 16, 8);
- error = ncp_sign_start(conn, buf);
- }
- return error;
-}
-
-int
-ncp_login_unencrypted(struct ncp_conn *conn, u_int16_t object_type,
- const char *object_name, const u_char *passwd,
- struct thread *td, struct ucred *cred)
-{
- struct ncp_rq *rqp;
- int error;
-
- error = ncp_rq_alloc_subfn(23, 20, conn, td, cred, &rqp);
- if (error)
- return error;
- mb_put_uint16be(&rqp->rq, object_type);
- ncp_rq_pstring(rqp, object_name);
- ncp_rq_pstring(rqp, passwd);
- error = ncp_request(rqp);
- if (!error)
- ncp_rq_done(rqp);
- return error;
-}
-
-int
-ncp_read(struct ncp_conn *conn, ncp_fh *file, struct uio *uiop, struct ucred *cred)
-{
- struct ncp_rq *rqp;
- struct mbchain *mbp;
- u_int16_t retlen = 0 ;
- int error = 0, len = 0, tsiz, burstio;
-
- tsiz = uiop->uio_resid;
-#ifdef NCPBURST
- burstio = (ncp_burst_enabled && tsiz > conn->buffer_size);
-#else
- burstio = 0;
-#endif
-
- while (tsiz > 0) {
- if (!burstio) {
- len = min(4096 - (uiop->uio_offset % 4096), tsiz);
- len = min(len, conn->buffer_size);
- error = ncp_rq_alloc(72, conn, uiop->uio_td, cred, &rqp);
- if (error)
- break;
- mbp = &rqp->rq;
- mb_put_uint8(mbp, 0);
- mb_put_mem(mbp, (caddr_t)file, 6, MB_MSYSTEM);
- mb_put_uint32be(mbp, uiop->uio_offset);
- mb_put_uint16be(mbp, len);
- rqp->nr_minrplen = 2;
- error = ncp_request(rqp);
- if (error)
- break;
- md_get_uint16be(&rqp->rp, &retlen);
- if (uiop->uio_offset & 1)
- md_get_mem(&rqp->rp, NULL, 1, MB_MSYSTEM);
- error = md_get_uio(&rqp->rp, uiop, retlen);
- ncp_rq_done(rqp);
- } else {
-#ifdef NCPBURST
- error = ncp_burst_read(conn, file, tsiz, &len, &retlen, uiop, cred);
-#endif
- }
- if (error)
- break;
- tsiz -= retlen;
- if (retlen < len)
- break;
- }
- return (error);
-}
-
-int
-ncp_write(struct ncp_conn *conn, ncp_fh *file, struct uio *uiop, struct ucred *cred)
-{
- struct ncp_rq *rqp;
- struct mbchain *mbp;
- int error = 0, len, tsiz, backup;
-
- if (uiop->uio_iovcnt != 1) {
- printf("%s: can't handle iovcnt>1 !!!\n", __func__);
- return EIO;
- }
- tsiz = uiop->uio_resid;
- while (tsiz > 0) {
- len = min(4096 - (uiop->uio_offset % 4096), tsiz);
- len = min(len, conn->buffer_size);
- if (len == 0) {
- printf("gotcha!\n");
- }
- /* rq head */
- error = ncp_rq_alloc(73, conn, uiop->uio_td, cred, &rqp);
- if (error)
- break;
- mbp = &rqp->rq;
- mb_put_uint8(mbp, 0);
- mb_put_mem(mbp, (caddr_t)file, 6, MB_MSYSTEM);
- mb_put_uint32be(mbp, uiop->uio_offset);
- mb_put_uint16be(mbp, len);
- error = mb_put_uio(mbp, uiop, len);
- if (error) {
- ncp_rq_done(rqp);
- break;
- }
- error = ncp_request(rqp);
- if (!error)
- ncp_rq_done(rqp);
- if (len == 0)
- break;
- if (error) {
- backup = len;
- uiop->uio_iov->iov_base =
- (char *)uiop->uio_iov->iov_base - backup;
- uiop->uio_iov->iov_len += backup;
- uiop->uio_offset -= backup;
- uiop->uio_resid += backup;
- break;
- }
- tsiz -= len;
- }
- if (error)
- uiop->uio_resid = tsiz;
- switch (error) {
- case NWE_INSUFFICIENT_SPACE:
- error = ENOSPC;
- break;
- }
- return (error);
-}
diff --git a/sys/netncp/ncp_ncp.h b/sys/netncp/ncp_ncp.h
deleted file mode 100644
index e62eda2..0000000
--- a/sys/netncp/ncp_ncp.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NETNCP_NCP_NCP_H_
-#define _NETNCP_NCP_NCP_H_
-
-#define NCP_ALLOC_SLOT 0x1111
-#define NCP_REQUEST 0x2222
-#define NCP_REPLY 0x3333
-#define NCP_FREE_SLOT 0x5555
-#define NCP_PACKET_BURST 0x7777
-#define NCP_POSITIVE_ACK 0x9999
-
-/*
- * Bits for connection state field in ncp_rphdr
- */
-#define NCP_CS_BAD_CONN 0x01 /* no such connection */
-#define NCP_CS_NO_SLOTS 0x04 /* no connection slots available */
-#define NCP_CS_SERVER_DOWN 0x10 /* server in down state */
-#define NCP_CS_HAVE_BROADCAST 0x40 /* server holds broadcast for us */
-
-#define NCP_RETRY_COUNT 5
-#define NCP_RETRY_TIMEOUT 10
-#define NCP_RESTORE_COUNT 2 /* how many times try to restore per
- * single request, should be an _even_ */
-
-struct ncp_rqhdr {
- u_int16_t type;
- u_int8_t seq;
- u_int8_t conn_low;
- u_int8_t task;
- u_int8_t conn_high;
- u_int8_t fn;
- u_int8_t data[0];
-} __packed;
-
-
-struct ncp_rphdr {
- u_int16_t type;
- u_int8_t seq;
- u_int8_t conn_low;
- u_int8_t task;
- u_int8_t conn_high;
- u_int8_t completion_code;
- u_int8_t connection_state;
- u_int8_t data[0];
-}__packed;
-
-#define BFL_ABT 0x04
-#define BFL_EOB 0x10
-#define BFL_SYS 0x80
-
-#define BOP_READ 1L
-#define BOP_WRITE 2L
-
-#define BERR_NONE 0
-#define BERR_INIT 1
-#define BERR_IO 2
-#define BERR_NODATA 3
-#define BERR_WRITE 4
-
-struct ncp_bursthdr {
- u_short bh_type;
- u_char bh_flags;
- u_char bh_streamtype;
- u_long bh_srcid;
- u_long bh_dstid;
- u_long bh_seq; /* HL */
- u_long bh_send_delay; /* HL */
- u_short bh_bseq; /* HL */
- u_short bh_aseq; /* HL */
- u_long bh_blen; /* HL */
- u_long bh_dofs; /* HL */
- u_short bh_dlen; /* HL */
- u_short bh_misfrags; /* HL */
-} __packed;
-
-struct ncp_conn;
-struct ncp_conn_args;
-struct ncp_rq;
-struct ucred;
-
-int ncp_ncp_connect(struct ncp_conn *conn);
-int ncp_ncp_disconnect(struct ncp_conn *conn);
-int ncp_negotiate_buffersize(struct ncp_conn *conn, int size, int *target);
-int ncp_renegotiate_connparam(struct ncp_conn *conn, int buffsize,
- u_int8_t in_options);
-int ncp_get_bindery_object_id(struct ncp_conn *conn,
- u_int16_t object_type, char *object_name,
- struct ncp_bindery_object *target,
- struct thread *td,struct ucred *cred);
-int ncp_get_encryption_key(struct ncp_conn *conn, char *target);
-int ncp_login_encrypted(struct ncp_conn *conn,
- struct ncp_bindery_object *object,
- const u_char *key, const u_char *passwd,
- struct thread *td, struct ucred *cred);
-int ncp_login_unencrypted(struct ncp_conn *conn, u_int16_t object_type,
- const char *object_name, const u_char *passwd,
- struct thread *td, struct ucred *cred);
-int ncp_read(struct ncp_conn *conn, ncp_fh *file, struct uio *uiop, struct ucred *cred);
-int ncp_write(struct ncp_conn *conn, ncp_fh *file, struct uio *uiop, struct ucred *cred);
-
-#endif /* _NCP_NCP_H_ */
diff --git a/sys/netncp/ncp_nls.c b/sys/netncp/ncp_nls.c
deleted file mode 100644
index b582626..0000000
--- a/sys/netncp/ncp_nls.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Character conversion routines
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/systm.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_nls.h>
-
-/*
- * 0 - character disallowed in NetWare file name.
- */
-static u_char ncp_u2n[256] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x20, 0x21, 0x00, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x00, 0x00, 0x00, 0x2d, 0x2e, 0x00,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x00, 0x00, 0x00, 0x5e, 0x5f,
- 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x00, 0x7d, 0x7e, 0x00,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80 */
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90 */
- 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0 */
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xbf, 0xbf, 0xbf, 0xbf, 0xb1, 0xb2, 0xb7, /* 0xb0 */
- 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0 */
- 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0 */
- 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0 */
- 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0 */
- 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
-};
-
-static u_char ncp_n2u[256] = {
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x00 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, /* 0x10 */
- 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f, 0x5f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x5f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 0x40 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 0x50 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80 */
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90 */
- 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0 */
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xbf, 0xbf, 0xbf, 0xbf, 0xb1, 0xb2, 0xb7, /* 0xb0 */
- 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0 */
- 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0 */
- 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0 */
- 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0 */
- 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
-};
-
-static u_char ncp_u2l[256] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 */
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 */
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 0x30 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x40 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x50 */
- 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, /* 0x60 */
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, /* 0x70 */
- 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80 */
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90 */
- 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0 */
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0 */
- 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0 */
- 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0 */
- 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0 */
- 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0 */
- 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
-};
-
-static u_char ncp_l2u[256] = {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 */
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 10-17 */
- 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 20-27 */
- 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, /* 30-37 */
- 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 40-47 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 50-57 */
- 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, /* 60-67 */
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, /* 70-77 */
- 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x80 */
- 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x90 */
- 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0xa0 */
- 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, /* 0xb0 */
- 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0 */
- 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, /* 0xd0 */
- 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0 */
- 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, /* 0xf0 */
- 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
-};
-
-struct ncp_nlstables ncp_defnls = {
- ncp_u2l, ncp_l2u, ncp_n2u, ncp_u2n, 0
-};
-
-void ncp_str_upper(char *name) {
- while (*name) {
- *name = ncp_defnls.to_upper[(u_char)*name];
- name++;
- }
-}
-
-void ncp_str_lower(char *name) {
- while (*name) {
- *name = ncp_defnls.to_lower[(u_char)*name];
- name++;
- }
-}
-
-/*
- * Check if pathname is valid under given conditions.
- */
-int
-ncp_pathcheck(char *s, int len, struct ncp_nlstables *nt, int strict) {
- u_char *tbl = NULL, sc;
- int opt = nt->opt;
-
- if (opt & (NWHP_UPPER | NWHP_LOWER))
- tbl = (opt & NWHP_UPPER) ? nt->to_upper : nt->to_lower;
- if ((opt & NWHP_DOS) == 0) {
- while (len--) {
- sc = (u_char)*(s++);
- if (nt->u2n[sc] == 0) /* illegal char */
- return EINVAL;
- if (tbl && strict && tbl[sc] != sc)
- return EINVAL;
- }
- return 0;
- }
- while (len--) {
- sc = (u_char)*(s++);
- if (nt->u2n[sc] == 0) /* illegal char */
- return EINVAL;
- if (sc == ' ') return EINVAL;
- if (tbl && strict && tbl[sc] != sc) {
- return EINVAL;
- }
- }
- return 0;
-}
-/*
- * Convert name from Unix to NetWare representation.
- * XXX: it should be complementary with path2unix, but for now
- * leave it as is.
- */
-void
-ncp_pathcopy(const char *src, char *dst, int len, struct ncp_nlstables *nt)
-{
- int donls;
- u_char c;
-/* char *d = dst, *s = src;*/
-
- if (nt == NULL) {
- ovbcopy(src, dst, len);
- return;
- }
- donls = (nt->opt & NWHP_NLS);
- if ((nt->opt & (NWHP_UPPER | NWHP_LOWER)) == 0) {
- while (len--) {
- *dst = donls ? nt->u2n[(u_char)*src] : *src;
- dst++;
- src++;
- }
- } else if (nt->opt & NWHP_DOS) {
- while (len--) {
- c = nt->to_upper[(u_char)*src];
- *dst = donls ? nt->u2n[c] : c;
- dst++;
- src++;
- }
- return;
- } else { /* probably incorrect... */
- while (len--) {
- *dst = donls ? nt->u2n[(u_char)*src] : *src;
- dst++;
- src++;
- }
- }
-/* printf("fromux: %s:%s\n", s, d);*/
-}
-
-/*
- * Convert NetWare filename to Unix with optional conversions
- */
-void
-ncp_path2unix(char *src, char *dst, int len, struct ncp_nlstables *nt) {
- int donls;
- u_char c, *tbl;
-/* char *d = dst, *s = src;*/
-
-/* printf("toux(%02x): %s:",nt->opt, s);*/
- if (nt == NULL) {
- ovbcopy(src, dst, len);
- return;
- }
- donls = (nt->opt & NWHP_NLS);
- if ((nt->opt & (NWHP_UPPER | NWHP_LOWER)) == 0) {
- while (len--) {
- c = *src;
- *dst = donls ? nt->n2u[c] : c;
- dst++;
- src++;
- }
- return;
- }
- tbl = (nt->opt & NWHP_LOWER) ? nt->to_lower : nt->to_upper;
- while (len--) {
- c = *src;
- *dst = tbl[donls ? nt->n2u[c] : c];
- dst++;
- src++;
- }
-/* printf("%s\n", d);*/
-}
diff --git a/sys/netncp/ncp_nls.h b/sys/netncp/ncp_nls.h
deleted file mode 100644
index 628190d..0000000
--- a/sys/netncp/ncp_nls.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NETNCP_NCP_NLS_H_
-#define _NETNCP_NCP_NLS_H_
-
-/* options for handle path & caseopt in mount struct */
-#define NWHP_HDB 0x01 /* have dir base */
-#define NWHP_UPPER 0x02 /* local names has upper case */
-#define NWHP_LOWER 0x04 /* --"-- lower case */
-#define NWHP_DOS 0x08 /* using dos name space */
-#define NWHP_NLS 0x10 /* do name translation via tables, any nmspc */
-#define NWHP_NOSTRICT 0x20 /* pretend to be a case insensitive */
-
-struct ncp_nlstables {
- u_char *to_lower; /* local charset to lower case */
- u_char *to_upper; /* local charset to upper case */
- u_char *n2u; /* NetWare to Unix */
- u_char *u2n;
- int opt; /* may depend on context */
-};
-
-#ifndef _KERNEL
-/*
- * NLS, supported character conversion schemes.
- * NCP_NLS_UNIXCHARSET_NETWARECHARSET
- */
-#define NCP_NLS_AS_IS 1
-#define NCP_NLS_AS_IS_NAME "asis"
-#define NCP_NLS_KOI_866 2
-#define NCP_NLS_KOI_866_NAME "koi2cp866"
-#define NCP_NLS_SE 3
-#define NCP_NLS_SE_NAME "se"
-#define NCP_NLS_DE 4
-#define NCP_NLS_DE_NAME "de"
-
-extern struct ncp_nlstables ncp_nls; /* active nls */
-
-__BEGIN_DECLS
-
-int ncp_nls_setrecode(int scheme);
-int ncp_nls_setrecodebyname(char *name);
-int ncp_nls_setlocale(char *name);
-char* ncp_nls_str_n2u(char *dst, const char *src);
-char* ncp_nls_str_u2n(char *dst, const char *src);
-char* ncp_nls_mem_n2u(char *dst, const char *src, int size);
-char* ncp_nls_mem_u2n(char *dst, const char *src, int size);
-
-__END_DECLS
-
-#else /* !_KERNEL */
-
-
-extern struct ncp_nlstables ncp_defnls;
-
-void ncp_str_upper(char *name);
-void ncp_str_lower(char *name);
-void ncp_pathcopy(const char *src, char *dst, int len, struct ncp_nlstables *nt);
-int ncp_pathcheck(char *s, int len, struct ncp_nlstables *nt, int strict);
-void ncp_path2unix(char *src, char *dst, int len, struct ncp_nlstables *nt);
-
-#endif /* !_KERNEL */
-
-#endif /* _NCP_NCP_NLS_H_ */
diff --git a/sys/netncp/ncp_rq.c b/sys/netncp/ncp_rq.c
deleted file mode 100644
index e011c10..0000000
--- a/sys/netncp/ncp_rq.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/*-
- * Copyright (c) 1999-2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Routines to prepare request and fetch reply
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/errno.h>
-#include <sys/kernel.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/poll.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/uio.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_rq.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_ncp.h>
-#include <netncp/ncp_sock.h>
-#include <netncp/ncp_nls.h>
-
-static MALLOC_DEFINE(M_NCPRQ, "NCPRQ", "NCP request");
-
-static int ncp_sign_packet(struct ncp_conn *conn, struct ncp_rq *rqp, int *size);
-
-int
-ncp_rq_alloc_any(u_int32_t ptype, u_int8_t fn, struct ncp_conn *ncp,
- struct thread *td, struct ucred *cred,
- struct ncp_rq **rqpp)
-{
- struct ncp_rq *rqp;
- int error;
-
- rqp = malloc(sizeof(*rqp), M_NCPRQ, M_WAITOK);
- error = ncp_rq_init_any(rqp, ptype, fn, ncp, td, cred);
- rqp->nr_flags |= NCPR_ALLOCED;
- if (error) {
- ncp_rq_done(rqp);
- return error;
- }
- *rqpp = rqp;
- return 0;
-}
-
-int
-ncp_rq_alloc(u_int8_t fn, struct ncp_conn *ncp,
- struct thread *td, struct ucred *cred, struct ncp_rq **rqpp)
-{
- return ncp_rq_alloc_any(NCP_REQUEST, fn, ncp, td, cred, rqpp);
-}
-
-int
-ncp_rq_alloc_subfn(u_int8_t fn, u_int8_t subfn, struct ncp_conn *ncp,
- struct thread *td, struct ucred *cred, struct ncp_rq **rqpp)
-{
- struct ncp_rq *rqp;
- int error;
-
- error = ncp_rq_alloc_any(NCP_REQUEST, fn, ncp, td, cred, &rqp);
- if (error)
- return error;
- mb_reserve(&rqp->rq, 2);
- mb_put_uint8(&rqp->rq, subfn);
- *rqpp = rqp;
- return 0;
-}
-
-int
-ncp_rq_init_any(struct ncp_rq *rqp, u_int32_t ptype, u_int8_t fn,
- struct ncp_conn *ncp,
- struct thread *td, struct ucred *cred)
-{
- struct ncp_rqhdr *rq;
- struct ncp_bursthdr *brq;
- struct mbchain *mbp;
- int error;
-
- bzero(rqp, sizeof(*rqp));
- error = ncp_conn_access(ncp, cred, NCPM_EXECUTE);
- if (error)
- return error;
- rqp->nr_td = td;
- rqp->nr_cred = cred;
- rqp->nr_conn = ncp;
- mbp = &rqp->rq;
- if (mb_init(mbp) != 0)
- return ENOBUFS;
- switch(ptype) {
- case NCP_PACKET_BURST:
- brq = (struct ncp_bursthdr*)mb_reserve(mbp, sizeof(*brq));
- brq->bh_type = ptype;
- brq->bh_streamtype = 0x2;
- break;
- default:
- rq = (struct ncp_rqhdr*)mb_reserve(mbp, sizeof(*rq));
- rq->type = ptype;
- rq->seq = 0; /* filled later */
- rq->fn = fn;
- break;
- }
- rqp->nr_minrplen = -1;
- return 0;
-}
-
-void
-ncp_rq_done(struct ncp_rq *rqp)
-{
- mb_done(&rqp->rq);
- md_done(&rqp->rp);
- if (rqp->nr_flags & NCPR_ALLOCED)
- free(rqp, M_NCPRQ);
- return;
-}
-
-/*
- * Routines to fill the request
- */
-
-static int
-ncp_rq_pathstrhelp(struct mbchain *mbp, c_caddr_t src, caddr_t dst,
- size_t *srclen, size_t *dstlen)
-{
- int len;
-
- if (*srclen < *dstlen) {
- *dstlen = *srclen;
- len = (int)*srclen;
- } else {
- *srclen = *dstlen;
- len = (int)*dstlen;
- }
- ncp_pathcopy(src, dst, len, mbp->mb_udata);
- return 0;
-}
-
-int
-ncp_rq_pathstring(struct ncp_rq *rqp, int size, const char *name,
- struct ncp_nlstables *nt)
-{
- struct mbchain *mbp = &rqp->rq;
-
- mb_put_uint8(mbp, size);
- mbp->mb_copy = ncp_rq_pathstrhelp;
- mbp->mb_udata = nt;
- return mb_put_mem(mbp, (c_caddr_t)name, size, MB_MCUSTOM);
-}
-
-int
-ncp_rq_pstring(struct ncp_rq *rqp, const char *s)
-{
- u_int len = strlen(s);
- int error;
-
- if (len > 255)
- return EINVAL;
- error = mb_put_uint8(&rqp->rq, len);
- if (error)
- return error;
- return mb_put_mem(&rqp->rq, s, len, MB_MSYSTEM);
-}
-
-int
-ncp_rq_dbase_path(struct ncp_rq *rqp, u_int8_t vol_num, u_int32_t dir_base,
- int namelen, u_char *path, struct ncp_nlstables *nt)
-{
- struct mbchain *mbp = &rqp->rq;
- int complen;
-
- mb_put_uint8(mbp, vol_num);
- mb_put_mem(mbp, (c_caddr_t)&dir_base, sizeof(dir_base), MB_MSYSTEM);
- mb_put_uint8(mbp, 1); /* with dirbase */
- if (path != NULL && path[0]) {
- if (namelen < 0) {
- namelen = *path++;
- mb_put_uint8(mbp, namelen);
- for(; namelen; namelen--) {
- complen = *path++;
- mb_put_uint8(mbp, complen);
- mb_put_mem(mbp, path, complen, MB_MSYSTEM);
- path += complen;
- }
- } else {
- mb_put_uint8(mbp, 1); /* 1 component */
- ncp_rq_pathstring(rqp, namelen, path, nt);
- }
- } else {
- mb_put_uint8(mbp, 0);
- mb_put_uint8(mbp, 0);
- }
- return 0;
-}
-
-/*
- * Make a signature for the current packet and add it at the end of the
- * packet.
- */
-static int
-ncp_sign_packet(struct ncp_conn *conn, struct ncp_rq *rqp, int *size)
-{
- u_char data[64];
- int error;
-
- bzero(data, sizeof(data));
- bcopy(conn->sign_root, data, 8);
- setdle(data, 8, *size);
- m_copydata(rqp->rq.mb_top, sizeof(struct ncp_rqhdr) - 1,
- min((*size) - sizeof(struct ncp_rqhdr)+1, 52), data + 12);
- ncp_sign(conn->sign_state, data, conn->sign_state);
- error = mb_put_mem(&rqp->rq, (caddr_t)conn->sign_state, 8, MB_MSYSTEM);
- if (error)
- return error;
- (*size) += 8;
- return 0;
-}
-
-/*
- * Low level send rpc, here we do not attempt to restore any connection,
- * Connection expected to be locked
- */
-int
-ncp_request_int(struct ncp_rq *rqp)
-{
- struct ncp_conn *conn = rqp->nr_conn;
- struct thread *td = conn->td;
- struct socket *so = conn->ncp_so;
- struct ncp_rqhdr *rq;
- struct ncp_rphdr *rp=NULL;
- struct timeval tv;
- struct mbuf *m, *mreply = NULL;
- struct mbchain *mbp;
- int error, len, dosend, plen = 0, gotpacket;
-
- if (so == NULL) {
- printf("%s: ncp_so is NULL !\n",__func__);
- ncp_conn_invalidate(conn);
- return ENOTCONN;
- }
- if (td == NULL)
- td = curthread; /* XXX maybe procpage ? */
- /*
- * Flush out replies on previous reqs
- */
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- while (selsocket(so, POLLIN, &tv, td) == 0) {
- if (ncp_sock_recv(so, &m, &len) != 0)
- break;
- m_freem(m);
- }
- mbp = &rqp->rq;
- len = mb_fixhdr(mbp);
- rq = mtod(mbp->mb_top, struct ncp_rqhdr *);
- rq->seq = conn->seq;
- m = rqp->rq.mb_top;
-
- switch (rq->fn) {
- case 0x15: case 0x16: case 0x17: case 0x23:
- *(u_int16_t*)(rq + 1) = htons(len - 2 - sizeof(*rq));
- break;
- }
- if (conn->flags & NCPFL_SIGNACTIVE) {
- error = ncp_sign_packet(conn, rqp, &len);
- if (error)
- return error;
- mbp->mb_top->m_pkthdr.len = len;
- }
- rq->conn_low = conn->connid & 0xff;
- /* rq->task = p->p_pgrp->pg_id & 0xff; */ /*p->p_pid*/
- /* XXX: this is temporary fix till I find a better solution */
- rq->task = rq->conn_low;
- rq->conn_high = conn->connid >> 8;
- rqp->rexmit = conn->li.retry_count;
- error = 0;
- for(dosend = 1;;) {
- if (rqp->rexmit-- == 0) {
- error = ETIMEDOUT;
- break;
- }
- error = 0;
- if (dosend) {
- NCPSDEBUG("send:%04x f=%02x c=%d l=%d s=%d t=%d\n",rq->type, rq->fn, (rq->conn_high << 8) + rq->conn_low,
- mbp->mb_top->m_pkthdr.len, rq->seq, rq->task
- );
- error = ncp_sock_send(so, mbp->mb_top, rqp);
- if (error)
- break;
- }
- tv.tv_sec = conn->li.timeout;
- tv.tv_usec = 0;
- error = selsocket(so, POLLIN, &tv, td);
- if (error == EWOULDBLOCK ) /* timeout expired */
- continue;
- error = ncp_chkintr(conn, td);
- if (error)
- break;
- /*
- * At this point it is possible to get more than one
- * reply from server. In general, last reply should be for
- * current request, but not always. So, we loop through
- * all replies to find the right answer and flush others.
- */
- gotpacket = 0; /* nothing good found */
- dosend = 1; /* resend rq if error */
- for (;;) {
- error = 0;
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- if (selsocket(so, POLLIN, &tv, td) != 0)
- break;
-/* if (so->so_rcv.sb_cc == 0) {
- break;
- }*/
- error = ncp_sock_recv(so, &m, &len);
- if (error)
- break; /* must be more checks !!! */
- if (m->m_len < sizeof(*rp)) {
- m = m_pullup(m, sizeof(*rp));
- if (m == NULL) {
- printf("%s: reply too short\n",__func__);
- continue;
- }
- }
- rp = mtod(m, struct ncp_rphdr*);
- if (len == sizeof(*rp) && rp->type == NCP_POSITIVE_ACK) {
- NCPSDEBUG("got positive acknowledge\n");
- m_freem(m);
- rqp->rexmit = conn->li.retry_count;
- dosend = 0; /* server just busy and will reply ASAP */
- continue;
- }
- NCPSDEBUG("recv:%04x c=%d l=%d s=%d t=%d cc=%02x cs=%02x\n",rp->type,
- (rp->conn_high << 8) + rp->conn_low, len, rp->seq, rp->task,
- rp->completion_code, rp->connection_state);
- NCPDDEBUG(m);
- if ( (rp->type == NCP_REPLY) &&
- ((rq->type == NCP_ALLOC_SLOT) ||
- ((rp->conn_low == rq->conn_low) &&
- (rp->conn_high == rq->conn_high)
- ))) {
- if (rq->seq > rp->seq || (rq->seq == 0 && rp->seq == 0xff)) {
- dosend = 1;
- }
- if (rp->seq == rq->seq) {
- if (gotpacket) {
- m_freem(m);
- } else {
- gotpacket = 1;
- mreply = m;
- plen = len;
- }
- continue; /* look up other for other packets */
- }
- }
- m_freem(m);
- NCPSDEBUG("reply mismatch\n");
- } /* for receive */
- if (error || gotpacket)
- break;
- /* try to resend, or just wait */
- }
- conn->seq++;
- if (error) {
- NCPSDEBUG("error=%d\n", error);
- /*
- * Any error except interruped call means that we have
- * to reconnect. So, eliminate future timeouts by invalidating
- * connection now.
- */
- if (error != EINTR)
- ncp_conn_invalidate(conn);
- return (error);
- }
- if (conn->flags & NCPFL_SIGNACTIVE) {
- /* XXX: check reply signature */
- m_adj(mreply, -8);
- plen -= 8;
- }
- rp = mtod(mreply, struct ncp_rphdr*);
- md_initm(&rqp->rp, mreply);
- rqp->nr_rpsize = plen - sizeof(*rp);
- rqp->nr_cc = error = rp->completion_code;
- if (error)
- error |= 0x8900; /* server error */
- rqp->nr_cs = rp->connection_state;
- if (rqp->nr_cs & (NCP_CS_BAD_CONN | NCP_CS_SERVER_DOWN)) {
- NCPSDEBUG("server drop us\n");
- ncp_conn_invalidate(conn);
- error = ECONNRESET;
- }
- md_get_mem(&rqp->rp, NULL, sizeof(*rp), MB_MSYSTEM);
- return error;
-}
-
-/*
- * Here we will try to restore any loggedin & dropped connection,
- * connection should be locked on entry
- */
-static __inline int
-ncp_restore_login(struct ncp_conn *conn)
-{
- int error;
-
- printf("ncprq: Restoring connection, flags = %x\n", conn->flags);
- conn->flags |= NCPFL_RESTORING;
- error = ncp_conn_reconnect(conn);
- if (!error && (conn->flags & NCPFL_WASLOGGED))
- error = ncp_conn_login(conn, conn->td, conn->ucred);
- if (error)
- ncp_ncp_disconnect(conn);
- conn->flags &= ~NCPFL_RESTORING;
- return error;
-}
-
-int
-ncp_request(struct ncp_rq *rqp)
-{
- struct ncp_conn *ncp = rqp->nr_conn;
- int error, rcnt;
-
- error = ncp_conn_lock(ncp, rqp->nr_td, rqp->nr_cred, NCPM_EXECUTE);
- if (error)
- goto out;
- rcnt = NCP_RESTORE_COUNT;
- for(;;) {
- if (ncp->flags & NCPFL_ATTACHED) {
- error = ncp_request_int(rqp);
- if (ncp->flags & NCPFL_ATTACHED)
- break;
- }
- if (rcnt-- == 0) {
- error = ECONNRESET;
- break;
- }
- /*
- * Do not attempt to restore connection recursively
- */
- if (ncp->flags & NCPFL_RESTORING) {
- error = ENOTCONN;
- break;
- }
- error = ncp_restore_login(ncp);
- if (error)
- continue;
- }
- ncp_conn_unlock(ncp, rqp->nr_td);
-out:
- if (error && (rqp->nr_flags & NCPR_DONTFREEONERR) == 0)
- ncp_rq_done(rqp);
- return error;
-}
diff --git a/sys/netncp/ncp_rq.h b/sys/netncp/ncp_rq.h
deleted file mode 100644
index 8d20d3f..0000000
--- a/sys/netncp/ncp_rq.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NETNCP_NCP_RQ_H_
-#define _NETNCP_NCP_RQ_H_
-
-#include <sys/endian.h>
-
-#define getb(buf,ofs) (((const u_int8_t *)(buf))[ofs])
-#define setb(buf,ofs,val) (((u_int8_t*)(buf))[ofs])=val
-#define getbw(buf,ofs) ((u_int16_t)(getb(buf,ofs)))
-
-#define getwle(buf,ofs) (le16toh(*((u_int16_t*)(&((u_int8_t*)(buf))[ofs]))))
-#define getdle(buf,ofs) (le32toh(*((u_int32_t*)(&((u_int8_t*)(buf))[ofs]))))
-#define getwbe(buf,ofs) (be16toh(*((u_int16_t*)(&((u_int8_t*)(buf))[ofs]))))
-#define getdbe(buf,ofs) (be32toh(*((u_int32_t*)(&((u_int8_t*)(buf))[ofs]))))
-
-#define setwle(buf,ofs,val) \
- (*((u_int16_t*)(&((u_int8_t*)(buf))[ofs])))=htole16(val)
-#define setdle(buf,ofs,val) \
- (*((u_int32_t*)(&((u_int8_t*)(buf))[ofs])))=htole32(val)
-#define setwbe(buf,ofs,val) \
- (*((u_int16_t*)(&((u_int8_t*)(buf))[ofs])))=htobe16(val)
-#define setdbe(buf,ofs,val) \
- (*((u_int32_t*)(&((u_int8_t*)(buf))[ofs])))=htobe32(val)
-
-#ifdef _KERNEL
-
-#include <sys/mchain.h>
-
-#define NCPR_ALLOCED 0x0001 /* request structure was allocated */
-#define NCPR_DONTFREEONERR 0x0002 /* do not free structure on error */
-
-/*
- * Structure to prepare ncp request and receive reply
- */
-struct ncp_rq {
- int nr_flags;
- struct mbchain rq;
- struct mdchain rp;
- int nr_minrplen; /* minimal rp size (-1 if not known) */
- int nr_rpsize; /* reply size minus ncp header */
- int nr_cc; /* completion code */
- int nr_cs; /* connection state */
- struct thread * nr_td; /* thread that did rq */
- struct ucred * nr_cred; /* user that did rq */
- int rexmit;
- struct ncp_conn*nr_conn; /* back link */
-};
-
-int ncp_rq_alloc(u_int8_t fn, struct ncp_conn *ncp, struct thread *td,
- struct ucred *cred, struct ncp_rq **rqpp);
-int ncp_rq_alloc_any(u_int32_t ptype, u_int8_t fn, struct ncp_conn *ncp,
- struct thread *td, struct ucred *cred, struct ncp_rq **rqpp);
-int ncp_rq_alloc_subfn(u_int8_t fn, u_int8_t subfn, struct ncp_conn *ncp,
- struct thread *td, struct ucred *cred, struct ncp_rq **rqpp);
-int ncp_rq_init_any(struct ncp_rq *rqp, u_int32_t ptype, u_int8_t fn,
- struct ncp_conn *ncp,
- struct thread *td, struct ucred *cred);
-void ncp_rq_done(struct ncp_rq *rqp);
-int ncp_request(struct ncp_rq *rqp);
-int ncp_request_int(struct ncp_rq *rqp);
-
-struct ncp_nlstables;
-
-int ncp_rq_pathstring(struct ncp_rq *rqp, int size, const char *name, struct ncp_nlstables*);
-int ncp_rq_dbase_path(struct ncp_rq *, u_int8_t vol_num,
- u_int32_t dir_base, int namelen, u_char *name, struct ncp_nlstables *nt);
-int ncp_rq_pstring(struct ncp_rq *rqp, const char *s);
-
-void ncp_sign_init(const char *logindata, char *sign_root);
-
-#else /* ifdef _KERNEL */
-
-#define DECLARE_RQ struct ncp_buf conn1, *conn=&conn1
-
-#define ncp_add_byte(conn,x) (conn)->packet[(conn)->rqsize++]=x
-
-struct ncp_buf;
-
-__BEGIN_DECLS
-
-void ncp_init_request(struct ncp_buf *);
-void ncp_init_request_s(struct ncp_buf *, int);
-void ncp_add_word_lh(struct ncp_buf *, u_int16_t);
-void ncp_add_dword_lh(struct ncp_buf *, u_int32_t);
-void ncp_add_word_hl(struct ncp_buf *, u_int16_t);
-void ncp_add_dword_hl(struct ncp_buf *, u_int32_t);
-void ncp_add_mem(struct ncp_buf *, const void *, int);
-void ncp_add_mem_nls(struct ncp_buf *, const void *, int);
-void ncp_add_pstring(struct ncp_buf *, const char *);
-void ncp_add_handle_path(struct ncp_buf *, nuint32, nuint32, int, const char *);
-
-#define ncp_reply_data(conn,offset) ((conn)->packet+offset)
-#define ncp_reply_byte(conn,offset) (*(u_int8_t*)(ncp_reply_data(conn, offset)))
-
-u_int16_t ncp_reply_word_hl(struct ncp_buf *, int);
-u_int16_t ncp_reply_word_lh(struct ncp_buf *, int);
-u_int32_t ncp_reply_dword_hl(struct ncp_buf *, int);
-u_int32_t ncp_reply_dword_lh(struct ncp_buf *, int);
-
-static __inline void
-ConvertToNWfromDWORD(u_int32_t sfd, ncp_fh *fh) {
- fh->val1 = (fh->val.val32 = sfd);
- return;
-}
-
-__END_DECLS
-
-#endif /* ifdef _KERNEL */
-
-#endif /* !_NETNCP_NCP_RQ_H_ */
diff --git a/sys/netncp/ncp_sock.c b/sys/netncp/ncp_sock.c
deleted file mode 100644
index 24557be..0000000
--- a/sys/netncp/ncp_sock.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*-
- * Copyright (c) 1999, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Low level socket routines
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <sys/lock.h>
-#include <sys/malloc.h>
-#include <sys/mutex.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/protosw.h>
-#include <sys/kernel.h>
-#include <sys/uio.h>
-#include <sys/syslog.h>
-#include <sys/mbuf.h>
-#include <sys/condvar.h>
-#include <net/route.h>
-
-#include <netipx/ipx.h>
-#include <netipx/ipx_pcb.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_sock.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_rq.h>
-
-#define ipx_setnullnet(x) ((x).x_net.s_net[0]=0); ((x).x_net.s_net[1]=0);
-#define ipx_setnullhost(x) ((x).x_host.s_host[0] = 0); \
- ((x).x_host.s_host[1] = 0); ((x).x_host.s_host[2] = 0);
-
-/*static int ncp_getsockname(struct socket *so, caddr_t asa, int *alen);*/
-static int ncp_soconnect(struct socket *so, struct sockaddr *target,
- struct thread *td);
-
-
-/* This will need only if native IP used, or (unlikely) NCP will be
- * implemented on the socket level
- */
-static int
-ncp_soconnect(struct socket *so, struct sockaddr *target, struct thread *td)
-{
- int error, s;
-
- error = soconnect(so, (struct sockaddr*)target, td);
- if (error)
- return error;
- /*
- * Wait for the connection to complete. Cribbed from the
- * connect system call but with the wait timing out so
- * that interruptible mounts don't hang here for a long time.
- */
- error = EIO;
- s = splnet();
- while ((so->so_state & SS_ISCONNECTING) && so->so_error == 0) {
- (void) tsleep((caddr_t)&so->so_timeo, PSOCK, "ncpcon", 2 * hz);
- if ((so->so_state & SS_ISCONNECTING) &&
- so->so_error == 0 /*&& rep &&*/) {
- so->so_state &= ~SS_ISCONNECTING;
- splx(s);
- goto bad;
- }
- }
- if (so->so_error) {
- error = so->so_error;
- so->so_error = 0;
- splx(s);
- goto bad;
- }
- splx(s);
- error=0;
-bad:
- return error;
-}
-#ifdef notyet
-static int
-ncp_getsockname(struct socket *so, caddr_t asa, int *alen) {
- struct sockaddr *sa;
- int len=0, error;
-
- sa = 0;
- error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, &sa);
- if (error==0) {
- if (sa) {
- len = min(len, sa->sa_len);
- bcopy(sa, (caddr_t)asa, (u_int)len);
- }
- *alen=len;
- }
- if (sa)
- free(sa, M_SONAME);
- return (error);
-}
-#endif
-int ncp_sock_recv(struct socket *so, struct mbuf **mp, int *rlen)
-{
- struct uio auio;
- struct thread *td = curthread; /* XXX */
- int error,flags,len;
-
- auio.uio_resid = len = 1000000;
- auio.uio_td = td;
- flags = MSG_DONTWAIT;
-
-/* error = soreceive(so, 0, &auio, (struct mbuf **)0, (struct mbuf **)0,
- &flags);*/
- error = soreceive(so, 0, &auio, mp, (struct mbuf **)0, &flags);
- *rlen = len - auio.uio_resid;
-/* if (!error) {
- *rlen=iov.iov_len;
- } else
- *rlen=0;*/
-#ifdef NCP_SOCKET_DEBUG
- if (error)
- printf("ncp_recv: err=%d\n", error);
-#endif
- return (error);
-}
-
-int
-ncp_sock_send(struct socket *so, struct mbuf *top, struct ncp_rq *rqp)
-{
- struct thread *td = curthread; /* XXX */
- struct sockaddr *to = 0;
- struct ncp_conn *conn = rqp->nr_conn;
- struct mbuf *m;
- int error, flags=0;
-
- for (;;) {
- m = m_copym(top, 0, M_COPYALL, M_WAITOK);
-/* NCPDDEBUG(m);*/
- error = sosend(so, to, 0, m, 0, flags, td);
- if (error == 0 || error == EINTR || error == ENETDOWN)
- break;
- if (rqp->rexmit == 0) break;
- rqp->rexmit--;
- pause("ncprsn", conn->li.timeout * hz);
- error = ncp_chkintr(conn, td);
- if (error == EINTR) break;
- }
- if (error) {
- log(LOG_INFO, "ncp_send: error %d for server %s", error, conn->li.server);
- }
- return error;
-}
-
-/*
- * Connect to specified server via IPX
- */
-static int
-ncp_sock_connect_ipx(struct ncp_conn *conn)
-{
- struct sockaddr_ipx sipx;
- struct ipxpcb *npcb;
- struct thread *td = conn->td;
- int addrlen, error, count;
-
- sipx.sipx_port = htons(0);
-
- for (count = 0;;count++) {
- if (count > (IPXPORT_WELLKNOWN-IPXPORT_RESERVED)*2) {
- error = EADDRINUSE;
- goto bad;
- }
- conn->ncp_so = conn->wdg_so = NULL;
- checkbad(socreate(AF_IPX, &conn->ncp_so, SOCK_DGRAM, 0, td->td_ucred, td));
- if (conn->li.opt & NCP_OPT_WDOG)
- checkbad(socreate(AF_IPX, &conn->wdg_so, SOCK_DGRAM, 0, td->td_ucred, td));
- addrlen = sizeof(sipx);
- sipx.sipx_family = AF_IPX;
- ipx_setnullnet(sipx.sipx_addr);
- ipx_setnullhost(sipx.sipx_addr);
- sipx.sipx_len = addrlen;
- error = sobind(conn->ncp_so, (struct sockaddr *)&sipx, td);
- if (error == 0) {
- if ((conn->li.opt & NCP_OPT_WDOG) == 0)
- break;
- sipx.sipx_addr = sotoipxpcb(conn->ncp_so)->ipxp_laddr;
- sipx.sipx_port = htons(ntohs(sipx.sipx_port) + 1);
- ipx_setnullnet(sipx.sipx_addr);
- ipx_setnullhost(sipx.sipx_addr);
- error = sobind(conn->wdg_so, (struct sockaddr *)&sipx, td);
- }
- if (!error) break;
- if (error != EADDRINUSE) goto bad;
- sipx.sipx_port = htons((ntohs(sipx.sipx_port)+4) & 0xfff8);
- soclose(conn->ncp_so);
- if (conn->wdg_so)
- soclose(conn->wdg_so);
- }
- npcb = sotoipxpcb(conn->ncp_so);
- npcb->ipxp_dpt = IPXPROTO_NCP;
- /* IPXrouted must be running, i.e. route must be presented */
- conn->li.ipxaddr.sipx_len = sizeof(struct sockaddr_ipx);
- checkbad(ncp_soconnect(conn->ncp_so, &conn->li.saddr, td));
- if (conn->wdg_so) {
- sotoipxpcb(conn->wdg_so)->ipxp_laddr.x_net = npcb->ipxp_laddr.x_net;
- sotoipxpcb(conn->wdg_so)->ipxp_laddr.x_host= npcb->ipxp_laddr.x_host;
- }
- if (!error) {
- conn->flags |= NCPFL_SOCONN;
- }
-#ifdef NCPBURST
- if (ncp_burst_enabled) {
- checkbad(socreate(AF_IPX, &conn->bc_so, SOCK_DGRAM, 0, td));
- bzero(&sipx, sizeof(sipx));
- sipx.sipx_len = sizeof(sipx);
- checkbad(sobind(conn->bc_so, (struct sockaddr *)&sipx, td));
- checkbad(ncp_soconnect(conn->bc_so, &conn->li.saddr, td));
- }
-#endif
- if (!error) {
- conn->flags |= NCPFL_SOCONN;
- ncp_sock_checksum(conn, 0);
- }
- return error;
-bad:
- ncp_sock_disconnect(conn);
- return (error);
-}
-
-int
-ncp_sock_checksum(struct ncp_conn *conn, int enable)
-{
-
- if (enable) {
- sotoipxpcb(conn->ncp_so)->ipxp_flags |= IPXP_CHECKSUM;
- } else {
- sotoipxpcb(conn->ncp_so)->ipxp_flags &= ~IPXP_CHECKSUM;
- }
- return 0;
-}
-
-/*
- * Connect to specified server via IP
- */
-static int
-ncp_sock_connect_in(struct ncp_conn *conn)
-{
- struct sockaddr_in sin;
- struct thread *td = conn->td;
- int addrlen = sizeof(sin), error;
-
- conn->flags = 0;
- bzero(&sin,addrlen);
- conn->ncp_so = conn->wdg_so = NULL;
- checkbad(socreate(AF_INET, &conn->ncp_so, SOCK_DGRAM, IPPROTO_UDP, td->td_ucred, td));
- sin.sin_family = AF_INET;
- sin.sin_len = addrlen;
- checkbad(sobind(conn->ncp_so, (struct sockaddr *)&sin, td));
- checkbad(ncp_soconnect(conn->ncp_so,(struct sockaddr*)&conn->li.addr, td));
- if (!error)
- conn->flags |= NCPFL_SOCONN;
- return error;
-bad:
- ncp_sock_disconnect(conn);
- return (error);
-}
-
-int
-ncp_sock_connect(struct ncp_conn *ncp)
-{
- int error;
-
- switch (ncp->li.saddr.sa_family) {
- case AF_IPX:
- error = ncp_sock_connect_ipx(ncp);
- break;
- case AF_INET:
- error = ncp_sock_connect_in(ncp);
- break;
- default:
- return EPROTONOSUPPORT;
- }
- return error;
-}
-
-/*
- * Connection expected to be locked
- */
-int
-ncp_sock_disconnect(struct ncp_conn *conn) {
- register struct socket *so;
- conn->flags &= ~(NCPFL_SOCONN | NCPFL_ATTACHED | NCPFL_LOGGED);
- if (conn->ncp_so) {
- so = conn->ncp_so;
- conn->ncp_so = (struct socket *)0;
- soshutdown(so, 2);
- soclose(so);
- }
- if (conn->wdg_so) {
- so = conn->wdg_so;
- conn->wdg_so = (struct socket *)0;
- soshutdown(so, 2);
- soclose(so);
- }
-#ifdef NCPBURST
- if (conn->bc_so) {
- so = conn->bc_so;
- conn->bc_so = (struct socket *)NULL;
- soshutdown(so, 2);
- soclose(so);
- }
-#endif
- return 0;
-}
-
-static void
-ncp_watchdog(struct ncp_conn *conn) {
- char *buf;
- struct mbuf *m;
- int error, len, flags;
- struct socket *so;
- struct sockaddr *sa;
- struct uio auio;
-
- sa = NULL;
- while (conn->wdg_so) { /* not a loop */
- so = conn->wdg_so;
- auio.uio_resid = len = 1000000;
- auio.uio_td = curthread;
- flags = MSG_DONTWAIT;
- error = soreceive(so, (struct sockaddr**)&sa, &auio, &m,
- (struct mbuf**)0, &flags);
- if (error) break;
- len -= auio.uio_resid;
- NCPSDEBUG("got watch dog %d\n",len);
- if (len != 2) break;
- buf = mtod(m, char*);
- if (buf[1] != '?') break;
- buf[1] = 'Y';
- error = sosend(so, (struct sockaddr*)sa, 0, m, 0, 0, curthread);
- NCPSDEBUG("send watch dog %d\n",error);
- break;
- }
- if (sa) free(sa, M_SONAME);
- return;
-}
-
-void
-ncp_check_conn(struct ncp_conn *conn) {
- int s;
-
- if (conn == NULL || !(conn->flags & NCPFL_ATTACHED))
- return;
- s = splnet();
- ncp_check_rq(conn);
- splx(s);
- if (conn->li.saddr.sa_family == AF_IPX)
- ncp_watchdog(conn);
-}
diff --git a/sys/netncp/ncp_subr.c b/sys/netncp/ncp_subr.c
deleted file mode 100644
index 6664dbd..0000000
--- a/sys/netncp/ncp_subr.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000, 2001 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/errno.h>
-#include <sys/eventhandler.h>
-#include <sys/kernel.h>
-#include <sys/lock.h>
-#include <sys/malloc.h>
-#include <sys/proc.h>
-#include <sys/sysctl.h>
-#include <sys/time.h>
-
-#include <netncp/ncp.h>
-#include <netncp/ncp_conn.h>
-#include <netncp/ncp_sock.h>
-#include <netncp/ncp_subr.h>
-#include <netncp/ncp_rq.h>
-#include <netncp/ncp_ncp.h>
-#include <netncp/nwerror.h>
-
-int ncp_debuglevel = 0;
-
-struct callout_handle ncp_timer_handle;
-static eventhandler_tag ncp_exit_tag;
-
-static void ncp_at_exit(void *arg, struct proc *p);
-static void ncp_timer(void *arg);
-
-/*
- * duplicate string from user space. It should be very-very slow.
- */
-char *
-ncp_str_dup(char *s) {
- char *p, bt;
- int len = 0;
-
- for (p = s;;p++) {
- if (copyin(p, &bt, 1)) return NULL;
- len++;
- if (bt == 0) break;
- }
- p = malloc(len, M_NCPDATA, M_WAITOK);
- copyin(s, p, len);
- return p;
-}
-
-
-void
-ncp_at_exit(void *arg, struct proc *p)
-{
- struct ncp_conn *ncp, *nncp;
- struct thread *td;
-
- mtx_lock(&Giant);
- FOREACH_THREAD_IN_PROC(p, td) {
- if (ncp_conn_putprochandles(td) == 0)
- continue;
-
- ncp_conn_locklist(LK_EXCLUSIVE, td);
- for (ncp = SLIST_FIRST(&conn_list); ncp; ncp = nncp) {
- nncp = SLIST_NEXT(ncp, nc_next);
- if (ncp_conn_lock(ncp, td, td->td_ucred,
- NCPM_READ | NCPM_EXECUTE | NCPM_WRITE))
- continue;
- if (ncp_conn_free(ncp) != 0)
- ncp_conn_unlock(ncp, td);
- }
- ncp_conn_unlocklist(td);
- }
- mtx_unlock(&Giant);
-}
-
-int
-ncp_init(void)
-{
- ncp_conn_init();
- ncp_exit_tag = EVENTHANDLER_REGISTER(process_exit, ncp_at_exit, NULL,
- EVENTHANDLER_PRI_ANY);
- ncp_timer_handle = timeout(ncp_timer, NULL, NCP_TIMER_TICK);
- return 0;
-}
-
-int
-ncp_done(void)
-{
- int error;
-
- error = ncp_conn_destroy();
- if (error)
- return error;
- untimeout(ncp_timer, NULL, ncp_timer_handle);
- EVENTHANDLER_DEREGISTER(process_exit, ncp_exit_tag);
- return 0;
-}
-
-
-/* tick every second and check for watch dog packets and lost connections */
-static void
-ncp_timer(void *arg)
-{
- struct ncp_conn *conn;
-
- if(ncp_conn_locklist(LK_SHARED | LK_NOWAIT, NULL) == 0) {
- SLIST_FOREACH(conn, &conn_list, nc_next)
- ncp_check_conn(conn);
- ncp_conn_unlocklist(NULL);
- }
- ncp_timer_handle = timeout(ncp_timer, NULL, NCP_TIMER_TICK);
-}
diff --git a/sys/netncp/ncp_subr.h b/sys/netncp/ncp_subr.h
deleted file mode 100644
index a0d3ce9..0000000
--- a/sys/netncp/ncp_subr.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NETNCP_NCP_SUBR_H_
-#define _NETNCP_NCP_SUBR_H_
-
-#define NCP_TIMER_TICK 2*hz /* 1sec */
-#define NCP_SIGMASK(set) \
- (SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \
- SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) || \
- SIGISMEMBER(set, SIGQUIT))
-
-
-#define NCP_PRINT(format, args...) printf("FATAL: %s: "format, __func__ ,## args)
-#define nwfs_printf NCP_PRINT
-/* Maybe this should panic, but I dont like that */
-#define NCPFATAL NCP_PRINT
-#define NCPERROR NCP_PRINT
-
-/* socket debugging */
-#ifdef NCP_SOCKET_DEBUG
-#define NCPSDEBUG(format, args...) printf("%s: "format, __func__ ,## args)
-#else
-#define NCPSDEBUG(format, args...)
-#endif
-
-/* NCP calls debug */
-#ifdef NCP_NCP_DEBUG
-#define NCPNDEBUG(format, args...) printf("%s: "format, __func__ ,## args)
-#else
-#define NCPNDEBUG(format, args...)
-#endif
-
-/* NCP data dump */
-#ifdef NCP_DATA_DEBUG
-#define NCPDDEBUG(m) m_dumpm(m)
-#else
-#define NCPDDEBUG(m)
-#endif
-
-/* FS VOPS debug */
-#ifdef NWFS_VOPS_DEBUG
-#define NCPVODEBUG(format, args...) printf("%s: "format, __func__ ,## args)
-#else
-#define NCPVODEBUG(format, args...)
-#endif
-
-/* FS VNOPS debug */
-#ifdef NWFS_VNOPS_DEBUG
-#define NCPVNDEBUG(format, args...) printf("%s: "format, __func__ ,## args)
-#else
-#define NCPVNDEBUG(format, args...)
-#endif
-
-#define checkbad(fn) {error=(fn);if(error) goto bad;}
-
-#define ncp_suser(cred) priv_check_cred(cred, PRIV_NETNCP, 0)
-
-#define ncp_isowner(conn,cred) ((cred)->cr_uid == (conn)->nc_owner->cr_uid)
-
-struct ncp_conn;
-
-struct nwmount;
-struct vnode;
-struct nwnode;
-struct vattr;
-struct uio;
-struct ncp_nlstables;
-
-struct ncp_open_info {
- u_int32_t origfh;
- ncp_fh fh;
- u_int8_t action;
- struct nw_entry_info fattr;
-};
-
-extern int ncp_debuglevel;
-
-struct proc;
-struct ucred;
-
-int ncp_init(void);
-int ncp_done(void);
-int ncp_chkintr(struct ncp_conn *conn, struct thread *td);
-char*ncp_str_dup(char *s);
-
-/* ncp_crypt.c */
-void nw_keyhash(const u_char *key, const u_char *buf, int buflen, u_char *target);
-void nw_encrypt(const u_char *fra, const u_char *buf, u_char *target);
-void ncp_sign(const u_int32_t *state, const char *x, u_int32_t *ostate);
-
-#endif /* _NCP_SUBR_H_ */
diff --git a/sys/netncp/ncp_user.h b/sys/netncp/ncp_user.h
deleted file mode 100644
index 832715e..0000000
--- a/sys/netncp/ncp_user.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * Copyright (c) 1999 Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#ifndef _NETNCP_NCP_USER_H_
-#define _NETNCP_NCP_USER_H_
-
-/*
- * "ncp" interface to kernel, this can be done via syscalls but may eat
- * a lot of them, so we select internal code, define req's and replays
- * as necessary. Structure for call is simple:
- * byte=NCP_CONN
- * byte=NCP_CONN_SUBFN
- * ....=data
- */
-#define NCP_CONN 0xF5 /* change if that will occupied */
-#define NCP_CONN_READ 0x01 /* read from file handle */
-#define NCP_CONN_WRITE 0x02 /* write to file handle */
-#define NCP_CONN_SETFLAGS 0x03 /* word mask, word flags */
-#define NCP_CONN_LOGIN 0x04 /* bind login on handle */
-#define NCP_CONN_GETINFO 0x05 /* get information about connection */
-#define NCP_CONN_GETUSER 0x06 /* get user name for connection */
-#define NCP_CONN_CONN2REF 0x07 /* convert handle to reference */
-#define NCP_CONN_CONNCLOSE 0x08 /* release connection handle */
-#define NCP_CONN_FRAG 0x09 /* ncp fragmented request */
-#define NCP_CONN_DUP 0x0A /* get an additional handle */
-#define NCP_CONN_GETDATA 0x0B /* retrieve NCP_CD_* vals */
-#define NCP_CONN_SETDATA 0x0C /* store NCP_CD_* vals */
-
-/*
- * Internal connection data can be set by owner or superuser and retrieved
- * only by superuser
- */
-#define NCP_CD_NDSLOGINKEY 0x01
-#define NCP_CD_NDSPRIVATEKEY 0x02
-#define NCP_CD_NDSUFLAGS 0x03
-
-/* user side structures to issue fragmented ncp calls */
-typedef struct {
- char *fragAddress;
- u_int32_t fragSize;
-} NW_FRAGMENT;
-
-
-struct ncp_rw {
- ncp_fh nrw_fh;
- char *nrw_base;
- off_t nrw_offset;
- int nrw_cnt;
-};
-
-struct ncp_conn_login {
- char *username;
- int objtype;
- char *password;
-};
-
-struct ncp_conn_frag {
- int cc; /* completion code */
- int cs; /* connection state */
- int fn;
- int rqfcnt;
- NW_FRAGMENT *rqf;
- int rpfcnt;
- NW_FRAGMENT *rpf;
-};
-
-#endif
diff --git a/sys/netncp/nwerror.h b/sys/netncp/nwerror.h
deleted file mode 100644
index 8dc7a93..0000000
--- a/sys/netncp/nwerror.h
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
- * NetWare requestor error codes, they taken from NDK
- *
- * $FreeBSD$
- */
-#ifndef _NETNCP_NWERROR_H_
-#define _NETNCP_NWERROR_H_
-
-#ifndef SUCCESS
-#define SUCCESS 0
-#endif
-
-#define SHELL_ERROR 0x8800
-#define VLM_ERROR 0x8800
-#define ALREADY_ATTACHED 0x8800 /* 0 - Attach attempted to server with valid, existing connection */
-#define INVALID_CONNECTION 0x8801 /* 1 - Request attempted with invalid or non-attached connection handle */
-#define DRIVE_IN_USE 0x8802 /* 2 - OS/2 only (NOT USED) */
-#define CANT_ADD_CDS 0x8803 /* 3 - Map drive attempted but unable to add new current directory structure */
-#define DRIVE_CANNOT_MAP 0x8803
-#define BAD_DRIVE_BASE 0x8804 /* 4 - Map drive attempted with invalid path specification */
-#define NET_READ_ERROR 0x8805 /* 5 - Attempt to receive from the selected transport failed */
-#define NET_RECV_ERROR 0x8805 /* 5 */
-#define UNKNOWN_NET_ERROR 0x8806 /* 6 - Network send attempted with an un-specific network error */
-#define SERVER_INVALID_SLOT 0x8807 /* 7 - Server request attempted with invalid server connection slot */
-#define BAD_SERVER_SLOT 0x8807 /* 7 */
-#define NO_SERVER_SLOTS 0x8808 /* 8 - Attach attempted to server with no connection slots available */
-#define NET_WRITE_ERROR 0x8809 /* 9 - Attempt to send on the selected transport failed */
-#define CONNECTION_IN_ERROR_STATE 0x8809 /* Client-32 */
-#define NET_SEND_ERROR 0x8809 /* 9 */
-#define SERVER_NO_ROUTE 0x880A /* 10 - Attempted to find route to server where no route exists */
-#define BAD_LOCAL_TARGET 0x880B /* 11 - OS/2 only */
-#define TOO_MANY_REQ_FRAGS 0x880C /* 12 - Attempted request with too many request fragments specified */
-#define CONNECT_LIST_OVERFLOW 0x880D /* 13 */
-#define BUFFER_OVERFLOW 0x880E /* 14 - Attempt to receive more data than the reply buffer had room for */
-#define MORE_DATA_ERROR 0x880E /* Client-32 */
-#define NO_CONN_TO_SERVER 0x880F /* 15 */
-#define NO_CONNECTION_TO_SERVER 0x880F /* 15 - Attempt to get connection for a server not connected */
-#define NO_ROUTER_FOUND 0x8810 /* 16 - OS/2 only */
-#define BAD_FUNC_ERROR 0x8811 /* 17 */
-#define INVALID_SHELL_CALL 0x8811 /* 17 - Attempted function call to non- existent or illegal function */
-#define SCAN_COMPLETE 0x8812
-#define LIP_RESIZE_ERROR 0x8812 /* Client-32 */
-#define UNSUPPORTED_NAME_FORMAT_TYPE 0x8813
-#define INVALID_DIR_HANDLE 0x8813 /* Client-32 */
-#define HANDLE_ALREADY_LICENSED 0x8814
-#define OUT_OF_CLIENT_MEMORY 0x8814 /* Client-32 */
-#define HANDLE_ALREADY_UNLICENSED 0x8815
-#define PATH_NOT_OURS 0x8815 /* Client-32 */
-#define INVALID_NCP_PACKET_LENGTH 0x8816
-#define PATH_IS_PRINT_DEVICE 0x8816 /* Client-32 */
-#define SETTING_UP_TIMEOUT 0x8817
-#define PATH_IS_EXCLUDED_DEVICE 0x8817 /* Client-32 */
-#define SETTING_SIGNALS 0x8818
-#define PATH_IS_INVALID 0x8818 /* Client-32 */
-#define SERVER_CONNECTION_LOST 0x8819
-#define NOT_SAME_DEVICE 0x8819 /* Client-32 */
-#define OUT_OF_HEAP_SPACE 0x881A
-#define INVALID_SERVICE_REQUEST 0x881B
-#define INVALID_SEARCH_HANDLE 0x881B /* Client-32 */
-#define INVALID_TASK_NUMBER 0x881C
-#define INVALID_DEVICE_HANDLE 0x881C /* Client-32 */
-#define INVALID_MESSAGE_LENGTH 0x881D
-#define INVALID_SEM_HANDLE 0x881D /* Client-32 */
-#define EA_SCAN_DONE 0x881E
-#define INVALID_CFG_HANDLE 0x881E /* Client-32 */
-#define BAD_CONNECTION_NUMBER 0x881F
-#define INVALID_MOD_HANDLE 0x881F /* Client-32 */
-#define ASYN_FIRST_PASS 0x8820
-#define INVALID_DEVICE_INDEX 0x8821
-#define INVALID_CONN_HANDLE 0x8822
-#define INVALID_QUEUE_ID 0x8823
-#define INVALID_PDEVICE_HANDLE 0x8824
-#define INVALID_JOB_HANDLE 0x8825
-#define INVALID_ELEMENT_ID 0x8826
-#define ALIAS_NOT_FOUND 0x8827
-#define RESOURCE_SUSPENDED 0x8828
-#define INVALID_QUEUE_SPECIFIED 0x8829
-#define DEVICE_ALREADY_OPEN 0x882A
-#define JOB_ALREADY_OPEN 0x882B
-#define QUEUE_NAME_ID_MISMATCH 0x882C
-#define JOB_ALREADY_STARTED 0x882D
-#define SPECT_DAA_TYPE_NOT_SUPPORTED 0x882E
-#define INVALID_ENVIR_HANDLE 0x882F
-#define NOT_SAME_CONNECTION 0x8830 /* 48 - Internal server request attempted accross different server connections */
-#define PRIMARY_CONNECTION_NOT_SET 0x8831 /* 49 - Attempt to retrieve default connection with no primary connection set */
-#define NO_PRIMARY_SET 0x8831 /* 49 */
-#define KEYWORD_NOT_FOUND 0x8832 /* Client-32 */
-#define PRINT_CAPTURE_NOT_IN_PROGRESS 0x8832 /* Client-32 */
-#define NO_CAPTURE_SET 0x8832 /* 50 */
-#define NO_CAPTURE_IN_PROGRESS 0x8832 /* 50 - Capture information requested on port with no capture in progress */
-#define BAD_BUFFER_LENGTH 0x8833 /* 51 */
-#define INVALID_BUFFER_LENGTH 0x8833 /* 51 - Used to indicate length which caller requested on a GetDNC or SetDNC was too large */
-#define NO_USER_NAME 0x8834 /* 52 */
-#define NO_NETWARE_PRINT_SPOOLER 0x8835 /* 53 - Capture requested without having the local print spooler installed */
-#define INVALID_PARAMETER 0x8836 /* 54 - Attempted function with an invalid function parameter specified */
-#define CONFIG_FILE_OPEN_FAILED 0x8837 /* 55 - OS/2 only */
-#define NO_CONFIG_FILE 0x8838 /* 56 - OS/2 only */
-#define CONFIG_FILE_READ_FAILED 0x8839 /* 57 - OS/2 only */
-#define CONFIG_LINE_TOO_LONG 0x883A /* 58 - OS/2 only */
-#define CONFIG_LINES_IGNORED 0x883B /* 59 - OS/2 only */
-#define NOT_MY_RESOURCE 0x883C /* 60 - Attempted request made with a parameter using foriegn resource */
-#define DAEMON_INSTALLED 0x883D /* 61 - OS/2 only */
-#define SPOOLER_INSTALLED 0x883E /* 62 - Attempted load of print spooler with print spooler already installed */
-#define CONN_TABLE_FULL 0x883F /* 63 */
-#define CONNECTION_TABLE_FULL 0x883F /* 63 - Attempted to allocate a connection handle with no more local connection table entries */
-#define CONFIG_SECTION_NOT_FOUND 0x8840 /* 64 - OS/2 only */
-#define BAD_TRAN_TYPE 0x8841 /* 65 */
-#define INVALID_TRANSPORT_TYPE 0x8841 /* 65 - Attempted function on a connection with an invalid transport selected */
-#define TDS_TAG_IN_USE 0x8842 /* 66 - OS/2 only */
-#define TDS_OUT_OF_MEMORY 0x8843 /* 67 - OS/2 only */
-#define TDS_INVALID_TAG 0x8844 /* 68 - Attempted TDS function with invalid tag */
-#define TDS_WRITE_TRUNCATED 0x8845 /* 69 - Attempted TDS write with buffer that exceeded buffer */
-#define NO_CONNECTION_TO_DS 0x8846 /* Client-32 */
-#define NO_DIRECTORY_SERVICE_CONNECTION 0x8846 /* 70 */
-#define SERVICE_BUSY 0x8846 /* 70 - Attempted request made to partially asynchronous function in busy state */
-#define NO_SERVER_ERROR 0x8847 /* 71 - Attempted connect failed to find any servers responding */
-#define BAD_VLM_ERROR 0x8848 /* 72 - Attempted function call to non-existant or not-loaded overlay */
-#define NETWORK_DRIVE_IN_USE 0x8849 /* 73 - Attempted map to network drive that was already mapped */
-#define LOCAL_DRIVE_IN_USE 0x884A /* 74 - Attempted map to local drive that was in use */
-#define NO_DRIVES_AVAILABLE 0x884B /* 75 - Attempted map to next available drive when none were available */
-#define DEVICE_NOT_REDIRECTED 0x884C /* 76 - The device is not redirected */
-#define NO_MORE_SFT_ENTRIES 0x884D /* 77 - Maximum number of files was reached */
-#define UNLOAD_ERROR 0x884E /* 78 - Attempted unload failed */
-#define IN_USE_ERROR 0x884F /* 79 - Attempted re-use of already in use connection entry */
-#define TOO_MANY_REP_FRAGS 0x8850 /* 80 - Attempted request with too many reply fragments specified */
-#define TABLE_FULL 0x8851 /* 81 - Attempted to add a name into the name table after it was full */
-#ifndef SOCKET_NOT_OPEN
-#define SOCKET_NOT_OPEN 0x8852 /* 82 - Listen was posted on unopened socket */
-#endif
-#define MEM_MGR_ERROR 0x8853 /* 83 - Attempted enhanced memory operation failed */
-#define SFT3_ERROR 0x8854 /* 84 - An SFT3 switch occured mid-transfer */
-#define PREFERRED_NOT_FOUND 0x8855 /* 85 - the preferred directory server was not established but another directory server was returned */
-#define DEVICE_NOT_RECOGNIZED 0x8856 /* 86 - used to determine if the device is not used by VISE so pass it on to the next redirector, if any. */
-#define BAD_NET_TYPE 0x8857 /* 87 - the network type (Bind/NDS) does not match the server version */
-#define ERROR_OPENING_FILE 0x8858 /* 88 - generic open failure error, invalid path, access denied, etc.. */
-#define NO_PREFERRED_SPECIFIED 0x8859 /* 89 - no preferred name specified */
-#define ERROR_OPENING_SOCKET 0x885A /* 90 - error opening a socket */
-#define REQUESTER_FAILURE 0x885A /* Client-32 */
-#define RESOURCE_ACCESS_DENIED 0x885B /* Client-32 */
-#define SIGNATURE_LEVEL_CONFLICT 0x8861
-#define NO_LOCK_FOUND 0x8862 /* OS/2 - process lock on conn handle failed, process ID not recognized */
-#define LOCK_TABLE_FULL 0x8863 /* OS/2 - process lock on conn handle failed, process lock table full */
-#define INVALID_MATCH_DATA 0x8864
-#define MATCH_FAILED 0x8865
-#define NO_MORE_ENTRIES 0x8866
-#define INSUFFICIENT_RESOURCES 0x8867
-#define STRING_TRANSLATION 0x8868
-#define STRING_TRANSLATION_NEEDED 0x8868 /* Client-32 */
-#define ACCESS_VIOLATION 0x8869
-#define NOT_AUTHENTICATED 0x886A
-#define INVALID_LEVEL 0x886B
-#define RESOURCE_LOCK_ERROR 0x886C
-#define INVALID_NAME_FORMAT 0x886D
-#define OBJECT_EXISTS 0x886E
-#define OBJECT_NOT_FOUND 0x886F
-#define UNSUPPORTED_TRAN_TYPE 0x8870
-#define INVALID_STRING_TYPE 0x8871
-#define INVALID_OWNER 0x8872
-#define UNSUPPORTED_AUTHENTICATOR 0x8873
-#define IO_PENDING 0x8874
-#define INVALID_DRIVE_NUM 0x8875
-#define SHELL_FAILURE 0x88FF
-#define VLM_FAILURE 0x88FF
-
-#define SVC_ALREADY_REGISTERED 0x8880 /* Client-32 */
-#define SVC_REGISTRY_FULL 0x8881 /* Client-32 */
-#define SVC_NOT_REGISTERED 0x8882 /* Client-32 */
-#define OUT_OF_RESOURCES 0x8883 /* Client-32 */
-#define RESOLVE_SVC_FAILED 0x8884 /* Client-32 */
-#define CONNECT_FAILED 0x8885 /* Client-32 */
-#define PROTOCOL_NOT_BOUND 0x8886 /* Client-32 */
-#define AUTHENTICATION_FAILED 0x8887 /* Client-32 */
-#define INVALID_AUTHEN_HANDLE 0x8888 /* Client-32 */
-#define AUTHEN_HANDLE_ALREADY_EXISTS 0x8889 /* Client-32 */
-
-#define DIFF_OBJECT_ALREADY_AUTHEN 0x8890 /* Client-32 */
-#define REQUEST_NOT_SERVICEABLE 0x8891 /* Client-32 */
-#define AUTO_RECONNECT_SO_REBUILD 0x8892 /* Client-32 */
-#define AUTO_RECONNECT_RETRY_REQUEST 0x8893 /* Client-32 */
-#define ASYNC_REQUEST_IN_USE 0x8894 /* Client-32 */
-#define ASYNC_REQUEST_CANCELED 0x8895 /* Client-32 */
-#define SESS_SVC_ALREADY_REGISTERED 0x8896 /* Client-32 */
-#define SESS_SVC_NOT_REGISTERED 0x8897 /* Client-32 */
-#define PREVIOUSLY_AUTHENTICATED 0x8899 /* Client-32 */
-#define RESOLVE_SVC_PARTIAL 0x889A /* Client-32 */
-#define NO_DEFAULT_SPECIFIED 0x889B /* Client-32 */
-#define HOOK_REQUEST_NOT_HANDLED 0x889C /* Client-32 */
-#define HOOK_REQUEST_BUSY 0x889D /* Client-32 */
-#define HOOK_REQUEST_QUEUED 0x889D /* Client-32 */
-#define AUTO_RECONNECT_SO_IGNORE 0x889E /* Client-32 */
-#define ASYNC_REQUEST_NOT_IN_USE 0x889F /* Client-32 */
-#define AUTO_RECONNECT_FAILURE 0x88A0 /* Client-32 */
-#define NET_ERROR_ABORT_APPLICATION 0x88A1 /* Client-32 */
-#define NET_ERROR_SUSPEND_APPLICATION 0x88A2 /* Client-32 */
-#define NET_ERROR_ABORTED_PROCESS_GROUP 0x88A3 /* Client-32 */
-#define NET_ERROR_PASSWORD_HAS_EXPIRED 0x88A5 /* Client-32 */
-#define NET_ERROR_NETWORK_INACTIVE 0x88A6 /* Client-32 */
-#define REPLY_TRUNCATED 0x88e6 /* 230 NLM */
-
-
-/* Server Errors */
-
-#define ERR_INSUFFICIENT_SPACE 0x8901 /* 001 */
-#define ERR_NO_MORE_ENTRY 0x8914 /* 020 */
-#define NLM_INVALID_CONNECTION 0x890a /* 010 */
-#define ERR_BUFFER_TOO_SMALL 0x8977 /* 119 */
-#define ERR_VOLUME_FLAG_NOT_SET 0x8978 /* 120 the service requested, not avail. on the selected vol. */
-#define ERR_NO_ITEMS_FOUND 0x8979 /* 121 */
-#define ERR_CONN_ALREADY_TEMP 0x897a /* 122 */
-#define ERR_CONN_ALREADY_LOGGED_IN 0x897b /* 123 */
-#define ERR_CONN_NOT_AUTHENTICATED 0x897c /* 124 */
-#define ERR_CONN_NOT_LOGGED_IN 0x897d /* 125 */
-#define NCP_BOUNDARY_CHECK_FAILED 0x897e /* 126 */
-#define ERR_LOCK_WAITING 0x897f /* 127 */
-#define ERR_LOCK_FAIL 0x8980 /* 128 */
-#define FILE_IN_USE_ERROR 0x8980 /* 128 */
-#define NO_MORE_FILE_HANDLES 0x8981 /* 129 */
-#define NO_OPEN_PRIVILEGES 0x8982 /* 130 */
-#define IO_ERROR_NETWORK_DISK 0x8983 /* 131 */
-#define ERR_AUDITING_HARD_IO_ERROR 0x8983 /* 131 */
-#define NO_CREATE_PRIVILEGES 0x8984 /* 132 */
-#define ERR_AUDITING_NOT_SUPV 0x8984 /* 132 */
-#define NO_CREATE_DELETE_PRIVILEGES 0x8985 /* 133 */
-#define CREATE_FILE_EXISTS_READ_ONLY 0x8986 /* 134 */
-#define WILD_CARDS_IN_CREATE_FILE_NAME 0x8987 /* 135 */
-#define CREATE_FILENAME_ERROR 0x8987 /* 135 */
-#define INVALID_FILE_HANDLE 0x8988 /* 136 */
-#define NO_SEARCH_PRIVILEGES 0x8989 /* 137 */
-#define NO_DELETE_PRIVILEGES 0x898A /* 138 */
-#define NO_RENAME_PRIVILEGES 0x898B /* 139 */
-#define NO_MODIFY_PRIVILEGES 0x898C /* 140 */
-#define SOME_FILES_AFFECTED_IN_USE 0x898D /* 141 */
-#define NO_FILES_AFFECTED_IN_USE 0x898E /* 142 */
-#define SOME_FILES_AFFECTED_READ_ONLY 0x898F /* 143 */
-#define NO_FILES_AFFECTED_READ_ONLY 0x8990 /* 144 */
-#define SOME_FILES_RENAMED_NAME_EXISTS 0x8991 /* 145 */
-#define NO_FILES_RENAMED_NAME_EXISTS 0x8992 /* 146 */
-#define NO_READ_PRIVILEGES 0x8993 /* 147 */
-#define NO_WRITE_PRIVILEGES_OR_READONLY 0x8994 /* 148 */
-#define FILE_DETACHED 0x8995 /* 149 */
-#define SERVER_OUT_OF_MEMORY 0x8996 /* 150 */
-#define ERR_TARGET_NOT_A_SUBDIRECTORY 0x8996 /* 150 can be changed later (note written by server people). */
-#define NO_DISK_SPACE_FOR_SPOOL_FILE 0x8997 /* 151 */
-#define ERR_AUDITING_NOT_ENABLED 0x8997 /* 151 */
-#define VOLUME_DOES_NOT_EXIST 0x8998 /* 152 */
-#define DIRECTORY_FULL 0x8999 /* 153 */
-#define RENAMING_ACROSS_VOLUMES 0x899A /* 154 */
-#define BAD_DIRECTORY_HANDLE 0x899B /* 155 */
-#define INVALID_PATH 0x899C /* 156 */
-#define NO_MORE_TRUSTEES 0x899C /* 156 */
-#define NO_MORE_DIRECTORY_HANDLES 0x899D /* 157 */
-#define INVALID_FILENAME 0x899E /* 158 */
-#define DIRECTORY_ACTIVE 0x899F /* 159 */
-#define DIRECTORY_NOT_EMPTY 0x89A0 /* 160 */
-#define DIRECTORY_IO_ERROR 0x89A1 /* 161 */
-#define READ_FILE_WITH_RECORD_LOCKED 0x89A2 /* 162 */
-#define ERR_TRANSACTION_RESTARTED 0x89A3 /* 163 */
-#define ERR_RENAME_DIR_INVALID 0x89A4 /* 164 */
-#define ERR_INVALID_OPENCREATE_MODE 0x89A5 /* 165 */
-#define ERR_ALREADY_IN_USE 0x89A6 /* 166 */
-#define ERR_AUDITING_ACTIVE 0x89A6 /* 166 */
-#define ERR_INVALID_RESOURCE_TAG 0x89A7 /* 167 */
-#define ERR_ACCESS_DENIED 0x89A8 /* 168 */
-#define ERR_AUDITING_NO_RIGHTS 0x89A8 /* 168 */
-#define INVALID_DATA_STREAM 0x89BE /* 190 */
-#define INVALID_NAME_SPACE 0x89BF /* 191 */
-#define NO_ACCOUNTING_PRIVILEGES 0x89C0 /* 192 */
-#define LOGIN_DENIED_NO_ACCOUNT_BALANCE 0x89C1 /* 193 */
-#define LOGIN_DENIED_NO_CREDIT 0x89C2 /* 194 */
-#define ERR_AUDITING_RECORD_SIZE 0x89C2 /* 194 */
-#define ERR_TOO_MANY_HOLDS 0x89C3 /* 195 */
-#define ACCOUNTING_DISABLED 0x89C4 /* 196 */
-#define INTRUDER_DETECTION_LOCK 0x89C5 /* 197 */
-#define NO_CONSOLE_OPERATOR 0x89C6 /* 198 */
-#define NO_CONSOLE_PRIVILEGES 0x89C6 /* 198 */
-#define ERR_Q_IO_FAILURE 0x89D0 /* 208 */
-#define ERR_NO_QUEUE 0x89D1 /* 209 */
-#define ERR_NO_Q_SERVER 0x89D2 /* 210 */
-#define ERR_NO_Q_RIGHTS 0x89D3 /* 211 */
-#define ERR_Q_FULL 0x89D4 /* 212 */
-#define ERR_NO_Q_JOB 0x89D5 /* 213 */
-#define ERR_NO_Q_JOB_RIGHTS 0x89D6 /* 214 */
-#define ERR_Q_IN_SERVICE 0x89D7 /* 215 */
-#define PASSWORD_NOT_UNIQUE 0x89D7 /* 215 */
-#define ERR_Q_NOT_ACTIVE 0x89D8 /* 216 */
-#define PASSWORD_TOO_SHORT 0x89D8 /* 216 */
-#define ERR_Q_STN_NOT_SERVER 0x89D9 /* 217 */
-#define LOGIN_DENIED_NO_CONNECTION 0x89D9 /* 217 */
-#define ERR_MAXIMUM_LOGINS_EXCEEDED 0x89D9 /* 217 */
-#define ERR_Q_HALTED 0x89DA /* 218 */
-#define UNAUTHORIZED_LOGIN_TIME 0x89DA /* 218 */
-#define UNAUTHORIZED_LOGIN_STATION 0x89DB /* 219 */
-#define ERR_Q_MAX_SERVERS 0x89DB /* 219 */
-#define ACCOUNT_DISABLED 0x89DC /* 220 */
-#define PASSWORD_HAS_EXPIRED_NO_GRACE 0x89DE /* 222 */
-#define PASSWORD_HAS_EXPIRED 0x89DF /* 223 */
-#define E_NO_MORE_USERS 0x89E7 /* 231 */
-#define NOT_ITEM_PROPERTY 0x89E8 /* 232 */
-#define WRITE_PROPERTY_TO_GROUP 0x89E8 /* 232 */
-#define MEMBER_ALREADY_EXISTS 0x89E9 /* 233 */
-#define NO_SUCH_MEMBER 0x89EA /* 234 */
-#define NOT_GROUP_PROPERTY 0x89EB /* 235 */
-#define NO_SUCH_SEGMENT 0x89EC /* 236 */
-#define PROPERTY_ALREADY_EXISTS 0x89ED /* 237 */
-#define OBJECT_ALREADY_EXISTS 0x89EE /* 238 */
-#define INVALID_NAME 0x89EF /* 239 */
-#define WILD_CARD_NOT_ALLOWED 0x89F0 /* 240 */
-#define INVALID_BINDERY_SECURITY 0x89F1 /* 241 */
-#define NO_OBJECT_READ_PRIVILEGE 0x89F2 /* 242 */
-#define NO_OBJECT_RENAME_PRIVILEGE 0x89F3 /* 243 */
-#define NO_OBJECT_DELETE_PRIVILEGE 0x89F4 /* 244 */
-#define NO_OBJECT_CREATE_PRIVILEGE 0x89F5 /* 245 */
-#define NO_PROPERTY_DELETE_PRIVILEGE 0x89F6 /* 246 */
-#define NO_PROPERTY_CREATE_PRIVILEGE 0x89F7 /* 247 */
-#define NO_PROPERTY_WRITE_PRIVILEGE 0x89F8 /* 248 */
-#define NO_FREE_CONNECTION_SLOTS 0x89F9 /* 249 */
-#define NO_PROPERTY_READ_PRIVILEGE 0x89F9 /* 249 */
-#define NO_MORE_SERVER_SLOTS 0x89FA /* 250 */
-#define TEMP_REMAP_ERROR 0x89FA /* 250 */
-#define INVALID_PARAMETERS 0x89FB /* 251 */
-#define NO_SUCH_PROPERTY 0x89FB /* 251 */
-#define ERR_NCP_NOT_SUPPORTED 0x89FB /* 251 */
-#define INTERNET_PACKET_REQT_CANCELED 0x89FC /* 252 */
-#define UNKNOWN_FILE_SERVER 0x89FC /* 252 */
-#define MESSAGE_QUEUE_FULL 0x89FC /* 252 */
-#define NO_SUCH_OBJECT 0x89FC /* 252 */
-#define LOCK_COLLISION 0x89FD /* 253 */
-#define BAD_STATION_NUMBER 0x89FD /* 253 */
-#define INVALID_PACKET_LENGTH 0x89FD /* 253 */
-#define UNKNOWN_REQUEST 0x89FD /* 253 */
-#define BINDERY_LOCKED 0x89FE /* 254 */
-#define TRUSTEE_NOT_FOUND 0x89FE /* 254 */
-#define DIRECTORY_LOCKED 0x89FE /* 254 */
-#define INVALID_SEMAPHORE_NAME_LENGTH 0x89FE /* 254 */
-#define PACKET_NOT_DELIVERABLE 0x89FE /* 254 */
-#define SERVER_BINDERY_LOCKED 0x89FE /* 254 */
-#define SOCKET_TABLE_FULL 0x89FE /* 254 */
-#define SPOOL_DIRECTORY_ERROR 0x89FE /* 254 */
-#define SUPERVISOR_HAS_DISABLED_LOGIN 0x89FE /* 254 */
-#define TIMEOUT_FAILURE 0x89FE /* 254 */
-#define BAD_PRINTER_ERROR 0x89FF /* 255 */
-#define BAD_RECORD_OFFSET 0x89FF /* 255 */
-#define CLOSE_FCB_ERROR 0x89FF /* 255 */
-#define FILE_EXTENSION_ERROR 0x89FF /* 255 */
-#define FILE_NAME_ERROR 0x89FF /* 255 */
-#define HARDWARE_FAILURE 0x89FF /* 255 */
-#define INVALID_DRIVE_NUMBER 0x89FF /* 255 */
-#define DOS_INVALID_DRIVE 0x000F /* 255 */
-#define INVALID_INITIAL_SEMAPHORE_VALUE 0x89FF /* 255 */
-#define INVALID_SEMAPHORE_HANDLE 0x89FF /* 255 */
-#define IO_BOUND_ERROR 0x89FF /* 255 */
-#define NO_FILES_FOUND_ERROR 0x89FF /* 255 */
-#define NO_RESPONSE_FROM_SERVER 0x89FF /* 255 */
-#define NO_SUCH_OBJECT_OR_BAD_PASSWORD 0x89FF /* 255 */
-#define PATH_NOT_LOCATABLE 0x89FF /* 255 */
-#define QUEUE_FULL_ERROR 0x89FF /* 255 */
-#define REQUEST_NOT_OUTSTANDING 0x89FF /* 255 */
-#ifndef SOCKET_ALREADY_OPEN
-#define SOCKET_ALREADY_OPEN 0x89FF /* 255 */
-#endif
-#define LOCK_ERROR 0x89FF /* 255 */
-#ifndef FAILURE
-#define FAILURE 0x89FF /* 255 Generic Failure */
-#endif
-
-/* #define NOT_SAME_LOCAL_DRIVE 0x89F6 */
-/* #define TARGET_DRIVE_NOT_LOCAL 0x89F7 */
-/* #define ALREADY_ATTACHED_TO_SERVER 0x89F8 */ /* 248 */
-/* #define NOT_ATTACHED_TO_SERVER 0x89F8 */
-
-/**** Network errors ****/
-/* Decimal values at end of line are 32768 lower than actual */
-
-#define NWE_ALREADY_ATTACHED 0x8800 /* 0 - Attach attempted to server with valid, existing connection */
-#define NWE_CONN_INVALID 0x8801 /* 1 - Request attempted with invalid or non-attached connection handle */
-#define NWE_DRIVE_IN_USE 0x8802 /* 2 - OS/2 only (NOT USED) */
-#define NWE_DRIVE_CANNOT_MAP 0x8803 /* 3 - Map drive attempted but unable to add new current directory structure */
-#define NWE_DRIVE_BAD_PATH 0x8804 /* 4 - Map drive attempted with invalid path specification */
-#define NWE_NET_RECEIVE 0x8805 /* 5 - Attempt to receive from the selected transport failed */
-#define NWE_NET_UNKNOWN 0x8806 /* 6 - Network send attempted with an un-specific network error */
-#define NWE_SERVER_BAD_SLOT 0x8807 /* 7 - Server request attempted with invalid server connection slot */
-#define NWE_SERVER_NO_SLOTS 0x8808 /* 8 - Attach attempted to server with no connection slots available */
-#define NWE_NET_SEND 0x8809 /* 9 - Attempt to send on the selected transport failed */
-#define NWE_SERVER_NO_ROUTE 0x880A /* 10 - Attempted to find route to server where no route exists */
-#define NWE_BAD_LOCAL_TARGET 0x880B /* 11 - OS/2 only */
-#define NWE_REQ_TOO_MANY_REQ_FRAGS 0x880C /* 12 - Attempted request with too many request fragments specified */
-#define NWE_CONN_LIST_OVERFLOW 0x880D /* 13 */
-#define NWE_BUFFER_OVERFLOW 0x880E /* 14 - Attempt to receive more data than the reply buffer had room for */
-#define NWE_SERVER_NO_CONN 0x880F /* 15 - Attempt to get connection for a server not connected */
-#define NWE_NO_ROUTER_FOUND 0x8810 /* 16 - OS/2 only */
-#define NWE_FUNCTION_INVALID 0x8811 /* 17 - Attempted function call to non- existent or illegal function */
-#define NWE_SCAN_COMPLETE 0x8812
-#define NWE_UNSUPPORTED_NAME_FORMAT_TYP 0x8813
-#define NWE_HANDLE_ALREADY_LICENSED 0x8814
-#define NWE_HANDLE_ALREADY_UNLICENSED 0x8815
-#define NWE_INVALID_NCP_PACKET_LENGTH 0x8816
-#define NWE_SETTING_UP_TIMEOUT 0x8817
-#define NWE_SETTING_SIGNALS 0x8818
-#define NWE_SERVER_CONNECTION_LOST 0x8819
-#define NWE_OUT_OF_HEAP_SPACE 0x881A
-#define NWE_INVALID_SERVICE_REQUEST 0x881B
-#define NWE_INVALID_TASK_NUMBER 0x881C
-#define NWE_INVALID_MESSAGE_LENGTH 0x881D
-#define NWE_EA_SCAN_DONE 0x881E
-#define NWE_BAD_CONNECTION_NUMBER 0x881F
-#define NWE_MULT_TREES_NOT_SUPPORTED 0x8820 /* 32 - Attempt to open a connection to a DS tree other than the default tree */
-#define NWE_CONN_NOT_SAME 0x8830 /* 48 - Internal server request attempted across different server connections */
-#define NWE_CONN_PRIMARY_NOT_SET 0x8831 /* 49 - Attempt to retrieve default connection with no primary connection set */
-#define NWE_PRN_CAPTURE_NOT_IN_PROGRESS 0x8832 /* 50 - Capture information requested on port with no capture in progress */
-#define NWE_BUFFER_INVALID_LEN 0x8833 /* 51 - Used to indicate length which caller requested on a GetDNC or SetDNC was too large */
-#define NWE_USER_NO_NAME 0x8834 /* 52 */
-#define NWE_PRN_NO_LOCAL_SPOOLER 0x8835 /* 53 - Capture requested without having the local print spooler installed */
-#define NWE_PARAM_INVALID 0x8836 /* 54 - Attempted function with an invalid function parameter specified */
-#define NWE_CFG_OPEN_FAILED 0x8837 /* 55 - OS/2 only */
-#define NWE_CFG_NO_FILE 0x8838 /* 56 - OS/2 only */
-#define NWE_CFG_READ_FAILED 0x8839 /* 57 - OS/2 only */
-#define NWE_CFG_LINE_TOO_LONG 0x883A /* 58 - OS/2 only */
-#define NWE_CFG_LINES_IGNORED 0x883B /* 59 - OS/2 only */
-#define NWE_RESOURCE_NOT_OWNED 0x883C /* 60 - Attempted request made with a parameter using foriegn resource */
-#define NWE_DAEMON_INSTALLED 0x883D /* 61 - OS/2 only */
-#define NWE_PRN_SPOOLER_INSTALLED 0x883E /* 62 - Attempted load of print spooler with print spooler already installed */
-#define NWE_CONN_TABLE_FULL 0x883F /* 63 - Attempted to allocate a connection handle with no more local connection table entries */
-#define NWE_CFG_SECTION_NOT_FOUND 0x8840 /* 64 - OS/2 only */
-#define NWE_TRAN_INVALID_TYPE 0x8841 /* 65 - Attempted function on a connection with an invalid transport selected */
-#define NWE_TDS_TAG_IN_USE 0x8842 /* 66 - OS/2 only */
-#define NWE_TDS_OUT_OF_MEMORY 0x8843 /* 67 - OS/2 only */
-#define NWE_TDS_INVALID_TAG 0x8844 /* 68 - Attempted TDS function with invalid tag */
-#define NWE_TDS_WRITE_TRUNCATED 0x8845 /* 69 - Attempted TDS write with buffer that exceeded buffer */
-#define NWE_DS_NO_CONN 0x8846 /* 70 */
-#define NWE_SERVICE_BUSY 0x8846 /* 70 - Attempted request made to partially asynchronous function in busy state */
-#define NWE_SERVER_NOT_FOUND 0x8847 /* 71 - Attempted connect failed to find any servers responding */
-#define NWE_VLM_INVALID 0x8848 /* 72 - Attempted function call to non-existant or not-loaded overlay */
-#define NWE_DRIVE_ALREADY_MAPPED 0x8849 /* 73 - Attempted map to network drive that was already mapped */
-#define NWE_DRIVE_LOCAL_IN_USE 0x884A /* 74 - Attempted map to local drive that was in use */
-#define NWE_DRIVE_NONE_AVAILABLE 0x884B /* 75 - Attempted map to next available drive when none were available */
-#define NWE_DEVICE_NOT_REDIRECTED 0x884C /* 76 - The device is not redirected */
-#define NWE_FILE_MAX_REACHED 0x884D /* 77 - Maximum number of files was reached */
-#define NWE_UNLOAD_FAILED 0x884E /* 78 - Attempted unload failed */
-#define NWE_CONN_IN_USE 0x884F /* 79 - Attempted re-use of already in use connection entry */
-#define NWE_REQ_TOO_MANY_REP_FRAGS 0x8850 /* 80 - Attempted request with too many reply fragments specified */
-#define NWE_NAME_TABLE_FULL 0x8851 /* 81 - Attempted to add a name into the name table after it was full */
-#define NWE_SOCKET_NOT_OPEN 0x8852 /* 82 - Listen was posted on unopened socket */
-#define NWE_MEMORY_MGR_ERROR 0x8853 /* 83 - Attempted enhanced memory operation failed */
-#define NWE_SFT3_ERROR 0x8854 /* 84 - An SFT3 switch occured mid-transfer */
-#define NWE_DS_PREFERRED_NOT_FOUND 0x8855 /* 85 - the preferred directory server was not established but another directory server was returned */
-#define NWE_DEVICE_NOT_RECOGNIZED 0x8856 /* 86 - used to determine if the device is not used by VISE so pass it on to the next redirector, if any. */
-#define NWE_NET_INVALID_TYPE 0x8857 /* 87 - the network type (Bind/NDS) does not match the server version */
-#define NWE_FILE_OPEN_FAILED 0x8858 /* 88 - generic open failure error, invalid path, access denied, etc.. */
-#define NWE_DS_PREFERRED_NOT_SPECIFIED 0x8859 /* 89 - no preferred name specified */
-#define NWE_SOCKET_OPEN_FAILED 0x885A /* 90 - error opening a socket */
-#define NWE_SIGNATURE_LEVEL_CONFLICT 0x8861
-#define NWE_NO_LOCK_FOUND 0x8862 /* OS/2 - process lock on conn handle failed, process ID not recognized */
-#define NWE_LOCK_TABLE_FULL 0x8863 /* OS/2 - process lock on conn handle failed, process lock table full */
-#define NWE_INVALID_MATCH_DATA 0x8864
-#define NWE_MATCH_FAILED 0x8865
-#define NWE_NO_MORE_ENTRIES 0x8866
-#define NWE_INSUFFICIENT_RESOURCES 0x8867
-#define NWE_STRING_TRANSLATION 0x8868
-#define NWE_ACCESS_VIOLATION 0x8869
-#define NWE_NOT_AUTHENTICATED 0x886A
-#define NWE_INVALID_LEVEL 0x886B
-#define NWE_RESOURCE_LOCK 0x886C
-#define NWE_INVALID_NAME_FORMAT 0x886D
-#define NWE_OBJECT_EXISTS 0x886E
-#define NWE_OBJECT_NOT_FOUND 0x886F
-#define NWE_UNSUPPORTED_TRAN_TYPE 0x8870
-#define NWE_INVALID_STRING_TYPE 0x8871
-#define NWE_INVALID_OWNER 0x8872
-#define NWE_UNSUPPORTED_AUTHENTICATOR 0x8873
-#define NWE_IO_PENDING 0x8874
-#define NWE_INVALID_DRIVE_NUMBER 0x8875
-#define NWE_REPLY_TRUNCATED 0x88e6 /* 230 NLM */
-#define NWE_REQUESTER_FAILURE 0x88FF
-
-/* Server Errors */
-
-#define NWE_INSUFFICIENT_SPACE 0x8901 /* 001 */
-#define NWE_BUFFER_TOO_SMALL 0x8977 /* 119 */
-#define NWE_VOL_FLAG_NOT_SET 0x8978 /* 120 the service requested, not avail. on the selected vol. */
-#define NWE_NO_ITEMS_FOUND 0x8979 /* 121 */
-#define NWE_CONN_ALREADY_TEMP 0x897a /* 122 */
-#define NWE_CONN_ALREADY_LOGGED_IN 0x897b /* 123 */
-#define NWE_CONN_NOT_AUTHENTICATED 0x897c /* 124 */
-#define NWE_CONN_NOT_LOGGED_IN 0x897d /* 125 */
-#define NWE_NCP_BOUNDARY_CHECK_FAILED 0x897e /* 126 */
-#define NWE_LOCK_WAITING 0x897f /* 127 */
-#define NWE_LOCK_FAIL 0x8980 /* 128 */
-#define NWE_FILE_IN_USE 0x8980 /* 128 */
-#define NWE_FILE_NO_HANDLES 0x8981 /* 129 */
-#define NWE_FILE_NO_OPEN_PRIV 0x8982 /* 130 */
-#define NWE_DISK_IO_ERROR 0x8983 /* 131 */
-#define NWE_AUDITING_HARD_IO_ERROR 0x8983 /* 131 */
-#define NWE_FILE_NO_CREATE_PRIV 0x8984 /* 132 */
-#define NWE_AUDITING_NOT_SUPV 0x8984 /* 132 */
-#define NWE_FILE_NO_CREATE_DEL_PRIV 0x8985 /* 133 */
-#define NWE_FILE_EXISTS_READ_ONLY 0x8986 /* 134 */
-#define NWE_FILE_WILD_CARDS_IN_NAME 0x8987 /* 135 */
-#define NWE_FILE_INVALID_HANDLE 0x8988 /* 136 */
-#define NWE_FILE_NO_SRCH_PRIV 0x8989 /* 137 */
-#define NWE_FILE_NO_DEL_PRIV 0x898A /* 138 */
-#define NWE_FILE_NO_RENAME_PRIV 0x898B /* 139 */
-#define NWE_FILE_NO_MOD_PRIV 0x898C /* 140 */
-#define NWE_FILE_SOME_IN_USE 0x898D /* 141 */
-#define NWE_FILE_NONE_IN_USE 0x898E /* 142 */
-#define NWE_FILE_SOME_READ_ONLY 0x898F /* 143 */
-#define NWE_FILE_NONE_READ_ONLY 0x8990 /* 144 */
-#define NWE_FILE_SOME_RENAMED_EXIST 0x8991 /* 145 */
-#define NWE_FILE_NONE_RENAMED_EXIST 0x8992 /* 146 */
-#define NWE_FILE_NO_READ_PRIV 0x8993 /* 147 */
-#define NWE_FILE_NO_WRITE_PRIV 0x8994 /* 148 */
-#define NWE_FILE_READ_ONLY 0x8994 /* 148 */
-#define NWE_FILE_DETACHED 0x8995 /* 149 */
-#define NWE_SERVER_OUT_OF_MEMORY 0x8996 /* 150 */
-#define NWE_DIR_TARGET_INVALID 0x8996 /* 150 */
-#define NWE_DISK_NO_SPOOL_SPACE 0x8997 /* 151 */
-#define NWE_AUDITING_NOT_ENABLED 0x8997 /* 151 */
-#define NWE_VOL_INVALID 0x8998 /* 152 */
-#define NWE_DIR_FULL 0x8999 /* 153 */
-#define NWE_VOL_RENAMING_ACROSS 0x899A /* 154 */
-#define NWE_DIRHANDLE_INVALID 0x899B /* 155 */
-#define NWE_PATH_INVALID 0x899C /* 156 */
-#define NWE_TRUSTEES_NO_MORE 0x899C /* 156 */
-#define NWE_DIRHANDLE_NO_MORE 0x899D /* 157 */
-#define NWE_FILE_NAME_INVALID 0x899E /* 158 */
-#define NWE_DIR_ACTIVE 0x899F /* 159 */
-#define NWE_DIR_NOT_EMPTY 0x89A0 /* 160 */
-#define NWE_DIR_IO_ERROR 0x89A1 /* 161 */
-#define NWE_FILE_IO_LOCKED 0x89A2 /* 162 */
-#define NWE_TTS_RANSACTION_RESTARTED 0x89A3 /* 163 */
-#define NWE_TTS_TRANSACTION_RESTARTED 0x89A3 /* 163 */
-#define NWE_DIR_RENAME_INVALID 0x89A4 /* 164 */
-#define NWE_FILE_OPENCREAT_MODE_INVALID 0x89A5 /* 165 */
-#define NWE_ALREADY_IN_USE 0x89A6 /* 166 */
-#define NWE_AUDITING_ACTIVE 0x89A6 /* 166 */
-#define NWE_RESOURCE_TAG_INVALID 0x89A7 /* 167 */
-#define NWE_ACCESS_DENIED 0x89A8 /* 168 */
-#define NWE_AUDITING_NO_RIGHTS 0x89A8 /* 168 */
-#define NWE_DATA_STREAM_INVALID 0x89BE /* 190 */
-#define NWE_NAME_SPACE_INVALID 0x89BF /* 191 */
-#define NWE_ACCTING_NO_PRIV 0x89C0 /* 192 */
-#define NWE_ACCTING_NO_BALANCE 0x89C1 /* 193 */
-#define NWE_ACCTING_NO_CREDIT 0x89C2 /* 194 */
-#define NWE_AUDITING_RECORD_SIZE 0x89C2 /* 194 */
-#define NWE_ACCTING_TOO_MANY_HOLDS 0x89C3 /* 195 */
-#define NWE_ACCTING_DISABLED 0x89C4 /* 196 */
-#define NWE_LOGIN_LOCKOUT 0x89C5 /* 197 */
-#define NWE_CONSOLE_NO_PRIV 0x89C6 /* 198 */
-#define NWE_Q_IO_FAILURE 0x89D0 /* 208 */
-#define NWE_Q_NONE 0x89D1 /* 209 */
-#define NWE_Q_NO_SERVER 0x89D2 /* 210 */
-#define NWE_Q_NO_RIGHTS 0x89D3 /* 211 */
-#define NWE_Q_FULL 0x89D4 /* 212 */
-#define NWE_Q_NO_JOB 0x89D5 /* 213 */
-#define NWE_Q_NO_JOB_RIGHTS 0x89D6 /* 214 */
-#define NWE_PASSWORD_UNENCRYPTED 0x89D6 /* 214 */
-#define NWE_Q_IN_SERVICE 0x89D7 /* 215 */
-#define NWE_PASSWORD_NOT_UNIQUE 0x89D7 /* 215 */
-#define NWE_Q_NOT_ACTIVE 0x89D8 /* 216 */
-#define NWE_PASSWORD_TOO_SHORT 0x89D8 /* 216 */
-#define NWE_Q_STN_NOT_SERVER 0x89D9 /* 217 */
-#define NWE_LOGIN_NO_CONN 0x89D9 /* 217 */
-#define NWE_LOGIN_MAX_EXCEEDED 0x89D9 /* 217 */
-#define NWE_Q_HALTED 0x89DA /* 218 */
-#define NWE_LOGIN_UNAUTHORIZED_TIME 0x89DA /* 218 */
-#define NWE_LOGIN_UNAUTHORIZED_STATION 0x89DB /* 219 */
-#define NWE_Q_MAX_SERVERS 0x89DB /* 219 */
-#define NWE_ACCT_DISABLED 0x89DC /* 220 */
-#define NWE_PASSWORD_INVALID 0x89DE /* 222 */
-#define NWE_PASSWORD_EXPIRED 0x89DF /* 223 */
-#define NWE_LOGIN_NO_CONN_AVAIL 0x89E0 /* 224 */
-#define NWE_E_NO_MORE_USERS 0x89E7 /* 231 */
-#define NWE_BIND_NOT_ITEM_PROP 0x89E8 /* 232 */
-#define NWE_BIND_WRITE_TO_GROUP_PROP 0x89E8 /* 232 */
-#define NWE_BIND_MEMBER_ALREADY_EXISTS 0x89E9 /* 233 */
-#define NWE_BIND_NO_SUCH_MEMBER 0x89EA /* 234 */
-#define NWE_BIND_NOT_GROUP_PROP 0x89EB /* 235 */
-#define NWE_BIND_NO_SUCH_SEGMENT 0x89EC /* 236 */
-#define NWE_BIND_PROP_ALREADY_EXISTS 0x89ED /* 237 */
-#define NWE_BIND_OBJ_ALREADY_EXISTS 0x89EE /* 238 */
-#define NWE_BIND_NAME_INVALID 0x89EF /* 239 */
-#define NWE_BIND_WILDCARD_INVALID 0x89F0 /* 240 */
-#define NWE_BIND_SECURITY_INVALID 0x89F1 /* 241 */
-#define NWE_BIND_OBJ_NO_READ_PRIV 0x89F2 /* 242 */
-#define NWE_BIND_OBJ_NO_RENAME_PRIV 0x89F3 /* 243 */
-#define NWE_BIND_OBJ_NO_DELETE_PRIV 0x89F4 /* 244 */
-#define NWE_BIND_OBJ_NO_CREATE_PRIV 0x89F5 /* 245 */
-#define NWE_BIND_PROP_NO_DELETE_PRIV 0x89F6 /* 246 */
-#define NWE_BIND_PROP_NO_CREATE_PRIV 0x89F7 /* 247 */
-#define NWE_BIND_PROP_NO_WRITE_PRIV 0x89F8 /* 248 */
-#define NWE_BIND_PROP_NO_READ_PRIV 0x89F9 /* 249 */
-#define NWE_NO_FREE_CONN_SLOTS 0x89F9 /* 249 */
-#define NWE_NO_MORE_SERVER_SLOTS 0x89FA /* 250 */
-#define NWE_TEMP_REMAP_ERROR 0x89FA /* 250 */
-#define NWE_PARAMETERS_INVALID 0x89FB /* 251 */
-#define NWE_BIND_NO_SUCH_PROP 0x89FB /* 251 */
-#define NWE_NCP_NOT_SUPPORTED 0x89FB /* 251 */
-#define NWE_INET_PACKET_REQ_CANCELED 0x89FC /* 252 */
-#define NWE_SERVER_UNKNOWN 0x89FC /* 252 */
-#define NWE_MSG_Q_FULL 0x89FC /* 252 */
-#define NWE_BIND_NO_SUCH_OBJ 0x89FC /* 252 */
-#define NWE_LOCK_COLLISION 0x89FD /* 253 */
-#define NWE_CONN_NUM_INVALID 0x89FD /* 253 */
-#define NWE_PACKET_LEN_INVALID 0x89FD /* 253 */
-#define NWE_UNKNOWN_REQ 0x89FD /* 253 */
-#define NWE_BIND_LOCKED 0x89FE /* 254 */
-#define NWE_TRUSTEE_NOT_FOUND 0x89FE /* 254 */
-#define NWE_DIR_LOCKED 0x89FE /* 254 */
-#define NWE_SEM_INVALID_NAME_LEN 0x89FE /* 254 */
-#define NWE_PACKET_NOT_DELIVERABLE 0x89FE /* 254 */
-#define NWE_SOCKET_TABLE_FULL 0x89FE /* 254 */
-#define NWE_SPOOL_DIR_ERROR 0x89FE /* 254 */
-#define NWE_LOGIN_DISABLED_BY_SUPER 0x89FE /* 254 */
-#define NWE_TIMEOUT_FAILURE 0x89FE /* 254 */
-#define NWE_FILE_EXT 0x89FF /* 255 */
-#define NWE_FILE_NAME 0x89FF /* 255 */
-#define NWE_HARD_FAILURE 0x89FF /* 255 */
-#define NWE_FCB_CLOSE 0x89FF /* 255 */
-#define NWE_IO_BOUND 0x89FF /* 255 */
-#define NWE_BAD_SPOOL_PRINTER 0x89FF /* 255 */
-#define NWE_BAD_RECORD_OFFSET 0x89FF /* 255 */
-#define NWE_DRIVE_INVALID_NUM 0x89FF /* 255 */
-#define NWE_SEM_INVALID_INIT_VAL 0x89FF /* 255 */
-#define NWE_SEM_INVALID_HANDLE 0x89FF /* 255 */
-#define NWE_NO_FILES_FOUND_ERROR 0x89FF /* 255 */
-#define NWE_NO_RESPONSE_FROM_SERVER 0x89FF /* 255 */
-#define NWE_NO_OBJ_OR_BAD_PASSWORD 0x89FF /* 255 */
-#define NWE_PATH_NOT_LOCATABLE 0x89FF /* 255 */
-#define NWE_Q_FULL_ERROR 0x89FF /* 255 */
-#define NWE_REQ_NOT_OUTSTANDING 0x89FF /* 255 */
-#define NWE_SOCKET_ALREADY_OPEN 0x89FF /* 255 */
-#define NWE_LOCK_ERROR 0x89FF /* 255 */
-#define NWE_FAILURE 0x89FF /* 255 Generic Failure */
-
-#endif /* !_NWERROR_H_ */
diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index 93f0729..1ee9976 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -1505,7 +1505,7 @@ pfsync_sendout(int schedswi)
return;
}
- m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + sc->sc_len);
+ m = m_get2(max_linkhdr + sc->sc_len, M_NOWAIT, MT_DATA, M_PKTHDR);
if (m == NULL) {
sc->sc_ifp->if_oerrors++;
V_pfsyncstats.pfsyncs_onomem++;
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 6667d7a..168ad5c 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -2168,7 +2168,7 @@ pf_send_tcp(struct mbuf *replyto, const struct pf_rule *r, sa_family_t af,
pfse = malloc(sizeof(*pfse), M_PFTEMP, M_NOWAIT);
if (pfse == NULL)
return;
- m = m_gethdr(M_NOWAIT, MT_HEADER);
+ m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
free(pfse, M_PFTEMP);
return;
diff --git a/sys/netsmb/smb_dev.c b/sys/netsmb/smb_dev.c
index a09d74d..5315f3f7 100644
--- a/sys/netsmb/smb_dev.c
+++ b/sys/netsmb/smb_dev.c
@@ -107,14 +107,9 @@ nsmb_dev_clone(void *arg, struct ucred *cred, char *name, int namelen,
else if (dev_stdclone(name, NULL, NSMB_NAME, &u) != 1)
return;
i = clone_create(&nsmb_clones, &nsmb_cdevsw, &u, dev, 0);
- if (i) {
- *dev = make_dev(&nsmb_cdevsw, u, UID_ROOT, GID_WHEEL, 0600,
- "%s%d", NSMB_NAME, u);
- if (*dev != NULL) {
- dev_ref(*dev);
- (*dev)->si_flags |= SI_CHEAPCLONE;
- }
- }
+ if (i)
+ *dev = make_dev_credf(MAKEDEV_REF, &nsmb_cdevsw, u, cred,
+ UID_ROOT, GID_WHEEL, 0600, "%s%d", NSMB_NAME, u);
}
static int
diff --git a/sys/nfs/krpc_subr.c b/sys/nfs/krpc_subr.c
index 6caafcf..ae51ace 100644
--- a/sys/nfs/krpc_subr.c
+++ b/sys/nfs/krpc_subr.c
@@ -459,9 +459,7 @@ xdr_string_encode(char *str, int len)
if (mlen > MCLBYTES) /* If too big, we just can't do it. */
return (NULL);
- m = m_get(M_WAITOK, MT_DATA);
- if (mlen > MLEN)
- MCLGET(m, M_WAITOK);
+ m = m_get2(mlen, M_WAITOK, MT_DATA, 0);
xs = mtod(m, struct xdr_string *);
m->m_len = mlen;
xs->len = txdr_unsigned(len);
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index 83e7125..ad9e7a1 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -192,7 +192,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *dposp, int siz, int left, int how)
} else if (siz > MHLEN) {
panic("nfs S too big");
} else {
- MGET(mp2, how, MT_DATA);
+ mp2 = m_get(how, MT_DATA);
if (mp2 == NULL)
return (NULL);
mp2->m_len = siz;
@@ -266,7 +266,7 @@ nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos)
void *ret;
if (s > M_TRAILINGSPACE(*mb)) {
- MGET(mb2, M_WAITOK, MT_DATA);
+ mb2 = m_get(M_WAITOK, MT_DATA);
if (s > MLEN)
panic("build > MLEN");
(*mb)->m_next = mb2;
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 31a86d1..a90afea 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -1242,7 +1242,7 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td)
sigset_t oldset;
nfs_set_sigmask(td, &oldset);
- bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0);
+ bp = getblk(vp, bn, size, PCATCH, 0, 0);
nfs_restore_sigmask(td, &oldset);
while (bp == NULL) {
if (nfs_sigintr(nmp, td))
@@ -1275,7 +1275,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg)
if ((nmp->nm_flag & NFSMNT_INT) == 0)
intrflg = 0;
if (intrflg) {
- slpflag = NFS_PCATCH;
+ slpflag = PCATCH;
slptimeo = 2 * hz;
} else {
slpflag = 0;
@@ -1354,7 +1354,7 @@ nfs_asyncio(struct nfsmount *nmp, struct buf *bp, struct ucred *cred, struct thr
}
again:
if (nmp->nm_flag & NFSMNT_INT)
- slpflag = NFS_PCATCH;
+ slpflag = PCATCH;
gotiod = FALSE;
/*
@@ -1419,7 +1419,7 @@ again:
mtx_unlock(&nfs_iod_mtx);
return (error2);
}
- if (slpflag == NFS_PCATCH) {
+ if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
}
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index 3723223..7cc41af 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -172,23 +172,6 @@ nfs_xid_gen(void)
}
/*
- * Create the header for an rpc request packet
- * The hsiz is the size of the rest of the nfs request header.
- * (just used to decide if a cluster is a good idea)
- */
-struct mbuf *
-nfsm_reqhead(struct vnode *vp, u_long procid, int hsiz)
-{
- struct mbuf *mb;
-
- MGET(mb, M_WAITOK, MT_DATA);
- if (hsiz >= MINCLSIZE)
- MCLGET(mb, M_WAITOK);
- mb->m_len = 0;
- return (mb);
-}
-
-/*
* copies a uio scatter/gather list to an mbuf chain.
* NOTE: can ony handle iovcnt == 1
*/
@@ -218,10 +201,10 @@ nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, caddr_t *bpos)
while (left > 0) {
mlen = M_TRAILINGSPACE(mp);
if (mlen == 0) {
- MGET(mp, M_WAITOK, MT_DATA);
if (clflg)
- MCLGET(mp, M_WAITOK);
- mp->m_len = 0;
+ mp = m_getcl(M_WAITOK, MT_DATA, 0);
+ else
+ mp = m_get(M_WAITOK, MT_DATA);
mp2->m_next = mp;
mp2 = mp;
mlen = M_TRAILINGSPACE(mp);
@@ -251,8 +234,7 @@ nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, caddr_t *bpos)
}
if (rem > 0) {
if (rem > M_TRAILINGSPACE(mp)) {
- MGET(mp, M_WAITOK, MT_DATA);
- mp->m_len = 0;
+ mp = m_get(M_WAITOK, MT_DATA);
mp2->m_next = mp;
}
cp = mtod(mp, caddr_t)+mp->m_len;
@@ -296,10 +278,13 @@ nfsm_strtmbuf(struct mbuf **mb, char **bpos, const char *cp, long siz)
}
/* Loop around adding mbufs */
while (siz > 0) {
- MGET(m1, M_WAITOK, MT_DATA);
- if (siz > MLEN)
- MCLGET(m1, M_WAITOK);
- m1->m_len = NFSMSIZ(m1);
+ if (siz > MLEN) {
+ m1 = m_getcl(M_WAITOK, MT_DATA, 0);
+ m1->m_len = MCLBYTES;
+ } else {
+ m1 = m_get(M_WAITOK, MT_DATA);
+ m1->m_len = MLEN;
+ }
m2->m_next = m1;
m2 = m1;
tl = mtod(m1, u_int32_t *);
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 9cec307..6f00cf9 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -298,7 +298,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp)
} else
mtx_unlock(&nmp->nm_mtx);
nfsstats.rpccnt[NFSPROC_FSSTAT]++;
- mreq = nfsm_reqhead(vp, NFSPROC_FSSTAT, NFSX_FH(v3));
+ mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -356,7 +356,7 @@ nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, struct ucred *cred,
u_int64_t maxfsize;
nfsstats.rpccnt[NFSPROC_FSINFO]++;
- mreq = nfsm_reqhead(vp, NFSPROC_FSINFO, NFSX_FH(1));
+ mreq = m_get2(NFSX_FH(1), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, 1);
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index f5017eb..c5d2e18 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -294,7 +294,7 @@ nfs3_access_otw(struct vnode *vp, int wmode, struct thread *td,
struct nfsnode *np = VTONFS(vp);
nfsstats.rpccnt[NFSPROC_ACCESS]++;
- mreq = nfsm_reqhead(vp, NFSPROC_ACCESS, NFSX_FH(v3) + NFSX_UNSIGNED);
+ mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED, M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -714,7 +714,7 @@ nfs_getattr(struct vop_getattr_args *ap)
goto nfsmout;
}
nfsstats.rpccnt[NFSPROC_GETATTR]++;
- mreq = nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3));
+ mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -873,7 +873,7 @@ nfs_setattrrpc(struct vnode *vp, struct vattr *vap, struct ucred *cred)
int v3 = NFS_ISV3(vp);
nfsstats.rpccnt[NFSPROC_SETATTR]++;
- mreq = nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH(v3) + NFSX_SATTR(v3));
+ mreq = m_get2(NFSX_FH(v3) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -1037,8 +1037,8 @@ nfs_lookup(struct vop_lookup_args *ap)
nfsstats.lookupcache_misses++;
nfsstats.rpccnt[NFSPROC_LOOKUP]++;
len = cnp->cn_namelen;
- mreq = nfsm_reqhead(dvp, NFSPROC_LOOKUP,
- NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len));
+ mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len), M_WAITOK,
+ MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -1251,7 +1251,7 @@ nfs_readlinkrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
int v3 = NFS_ISV3(vp);
nfsstats.rpccnt[NFSPROC_READLINK]++;
- mreq = nfsm_reqhead(vp, NFSPROC_READLINK, NFSX_FH(v3));
+ mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -1306,7 +1306,8 @@ nfs_readrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
while (tsiz > 0) {
nfsstats.rpccnt[NFSPROC_READ]++;
len = (tsiz > rsize) ? rsize : tsiz;
- mreq = nfsm_reqhead(vp, NFSPROC_READ, NFSX_FH(v3) + NFSX_UNSIGNED * 3);
+ mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED * 3, M_WAITOK,
+ MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -1378,8 +1379,8 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
while (tsiz > 0) {
nfsstats.rpccnt[NFSPROC_WRITE]++;
len = (tsiz > wsize) ? wsize : tsiz;
- mreq = nfsm_reqhead(vp, NFSPROC_WRITE,
- NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len));
+ mreq = m_get2(NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len),
+ M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -1501,8 +1502,8 @@ nfs_mknodrpc(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0)
return (error);
nfsstats.rpccnt[NFSPROC_MKNOD]++;
- mreq = nfsm_reqhead(dvp, NFSPROC_MKNOD, NFSX_FH(v3) + 4 * NFSX_UNSIGNED +
- + nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3));
+ mreq = m_get2(NFSX_FH(v3) + 4 * NFSX_UNSIGNED +
+ nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -1605,8 +1606,8 @@ nfs_create(struct vop_create_args *ap)
fmode |= O_EXCL;
again:
nfsstats.rpccnt[NFSPROC_CREATE]++;
- mreq = nfsm_reqhead(dvp, NFSPROC_CREATE, NFSX_FH(v3) + 2 * NFSX_UNSIGNED +
- nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3));
+ mreq = m_get2(NFSX_FH(v3) + 2 * NFSX_UNSIGNED +
+ nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -1787,8 +1788,8 @@ nfs_removerpc(struct vnode *dvp, const char *name, int namelen,
int v3 = NFS_ISV3(dvp);
nfsstats.rpccnt[NFSPROC_REMOVE]++;
- mreq = nfsm_reqhead(dvp, NFSPROC_REMOVE,
- NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(namelen));
+ mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(namelen),
+ M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -1923,9 +1924,8 @@ nfs_renamerpc(struct vnode *fdvp, const char *fnameptr, int fnamelen,
int v3 = NFS_ISV3(fdvp);
nfsstats.rpccnt[NFSPROC_RENAME]++;
- mreq = nfsm_reqhead(fdvp, NFSPROC_RENAME,
- (NFSX_FH(v3) + NFSX_UNSIGNED)*2 + nfsm_rndup(fnamelen) +
- nfsm_rndup(tnamelen));
+ mreq = m_get2((NFSX_FH(v3) + NFSX_UNSIGNED)*2 + nfsm_rndup(fnamelen) +
+ nfsm_rndup(tnamelen), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(fdvp, v3);
@@ -1983,8 +1983,8 @@ nfs_link(struct vop_link_args *ap)
v3 = NFS_ISV3(vp);
nfsstats.rpccnt[NFSPROC_LINK]++;
- mreq = nfsm_reqhead(vp, NFSPROC_LINK,
- NFSX_FH(v3)*2 + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen));
+ mreq = m_get2(NFSX_FH(v3)*2 + NFSX_UNSIGNED +
+ nfsm_rndup(cnp->cn_namelen), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -2029,8 +2029,9 @@ nfs_symlink(struct vop_symlink_args *ap)
nfsstats.rpccnt[NFSPROC_SYMLINK]++;
slen = strlen(ap->a_target);
- mreq = nfsm_reqhead(dvp, NFSPROC_SYMLINK, NFSX_FH(v3) + 2*NFSX_UNSIGNED +
- nfsm_rndup(cnp->cn_namelen) + nfsm_rndup(slen) + NFSX_SATTR(v3));
+ mreq = m_get2(NFSX_FH(v3) + 2*NFSX_UNSIGNED +
+ nfsm_rndup(cnp->cn_namelen) + nfsm_rndup(slen) + NFSX_SATTR(v3),
+ M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -2123,8 +2124,8 @@ nfs_mkdir(struct vop_mkdir_args *ap)
return (error);
len = cnp->cn_namelen;
nfsstats.rpccnt[NFSPROC_MKDIR]++;
- mreq = nfsm_reqhead(dvp, NFSPROC_MKDIR,
- NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len) + NFSX_SATTR(v3));
+ mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len) +
+ NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -2188,8 +2189,8 @@ nfs_rmdir(struct vop_rmdir_args *ap)
if (dvp == vp)
return (EINVAL);
nfsstats.rpccnt[NFSPROC_RMDIR]++;
- mreq = nfsm_reqhead(dvp, NFSPROC_RMDIR,
- NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen));
+ mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED +
+ nfsm_rndup(cnp->cn_namelen), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -2307,8 +2308,8 @@ nfs_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
*/
while (more_dirs && bigenough) {
nfsstats.rpccnt[NFSPROC_READDIR]++;
- mreq = nfsm_reqhead(vp, NFSPROC_READDIR, NFSX_FH(v3) +
- NFSX_READDIR(v3));
+ mreq = m_get2(NFSX_FH(v3) + NFSX_READDIR(v3), M_WAITOK,
+ MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
@@ -2513,8 +2514,8 @@ nfs_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred)
*/
while (more_dirs && bigenough) {
nfsstats.rpccnt[NFSPROC_READDIRPLUS]++;
- mreq = nfsm_reqhead(vp, NFSPROC_READDIRPLUS,
- NFSX_FH(1) + 6 * NFSX_UNSIGNED);
+ mreq = m_get2(NFSX_FH(1) + 6 * NFSX_UNSIGNED, M_WAITOK,
+ MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, 1);
@@ -2818,8 +2819,8 @@ nfs_lookitup(struct vnode *dvp, const char *name, int len, struct ucred *cred,
int v3 = NFS_ISV3(dvp);
nfsstats.rpccnt[NFSPROC_LOOKUP]++;
- mreq = nfsm_reqhead(dvp, NFSPROC_LOOKUP,
- NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len));
+ mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len),
+ M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(dvp, v3);
@@ -2897,7 +2898,7 @@ nfs_commit(struct vnode *vp, u_quad_t offset, int cnt, struct ucred *cred,
}
mtx_unlock(&nmp->nm_mtx);
nfsstats.rpccnt[NFSPROC_COMMIT]++;
- mreq = nfsm_reqhead(vp, NFSPROC_COMMIT, NFSX_FH(1));
+ mreq = m_get2(NFSX_FH(1), M_WAITOK, MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, 1);
@@ -2991,7 +2992,7 @@ nfs_flush(struct vnode *vp, int waitfor, int commit)
int bvecsize = 0, bveccount;
if (nmp->nm_flag & NFSMNT_INT)
- slpflag = NFS_PCATCH;
+ slpflag = PCATCH;
if (!commit)
passone = 0;
bo = &vp->v_bufobj;
@@ -3189,7 +3190,7 @@ loop:
error = EINTR;
goto done;
}
- if (slpflag & PCATCH) {
+ if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
}
@@ -3227,7 +3228,7 @@ loop:
error = nfs_sigintr(nmp, td);
if (error)
goto done;
- if (slpflag & PCATCH) {
+ if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
}
diff --git a/sys/nfsclient/nfsm_subs.h b/sys/nfsclient/nfsm_subs.h
index c12badd..25467cc 100644
--- a/sys/nfsclient/nfsm_subs.h
+++ b/sys/nfsclient/nfsm_subs.h
@@ -53,34 +53,6 @@ struct vnode;
* First define what the actual subs. return
*/
u_int32_t nfs_xid_gen(void);
-struct mbuf *nfsm_reqhead(struct vnode *vp, u_long procid, int hsiz);
-
-#define M_HASCL(m) ((m)->m_flags & M_EXT)
-#define NFSMINOFF(m) \
- do { \
- if (M_HASCL(m)) \
- (m)->m_data = (m)->m_ext.ext_buf; \
- else if ((m)->m_flags & M_PKTHDR) \
- (m)->m_data = (m)->m_pktdat; \
- else \
- (m)->m_data = (m)->m_dat; \
- } while (0)
-#define NFSMSIZ(m) ((M_HASCL(m))?MCLBYTES: \
- (((m)->m_flags & M_PKTHDR)?MHLEN:MLEN))
-
-/*
- * Now for the macros that do the simple stuff and call the functions
- * for the hard stuff.
- * These macros use several vars. declared in nfsm_reqhead and these
- * vars. must not be used elsewhere unless you are careful not to corrupt
- * them. The vars. starting with pN and tN (N=1,2,3,..) are temporaries
- * that may be used so long as the value is not expected to retained
- * after a macro.
- * I know, this is kind of dorkey, but it makes the actual op functions
- * fairly clean and deals with the mess caused by the xdr discriminating
- * unions.
- */
-
/* *********************************** */
/* Request generation phase macros */
diff --git a/sys/nfsclient/nfsmount.h b/sys/nfsclient/nfsmount.h
index 77171a1..09ea5cf 100644
--- a/sys/nfsclient/nfsmount.h
+++ b/sys/nfsclient/nfsmount.h
@@ -125,8 +125,6 @@ struct nfsmount {
#define NFS_DEFAULT_NEGNAMETIMEO 60
#endif
-#define NFS_PCATCH (PCATCH | PBDRY)
-
#endif
#endif
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c
index 6a339ca..ddd22ae 100644
--- a/sys/powerpc/aim/mmu_oea.c
+++ b/sys/powerpc/aim/mmu_oea.c
@@ -275,6 +275,8 @@ void moea_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t);
void moea_clear_modify(mmu_t, vm_page_t);
void moea_clear_reference(mmu_t, vm_page_t);
void moea_copy_page(mmu_t, vm_page_t, vm_page_t);
+void moea_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset,
+ vm_page_t *mb, vm_offset_t b_offset, int xfersize);
void moea_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t);
void moea_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t,
vm_prot_t);
@@ -320,6 +322,7 @@ static mmu_method_t moea_methods[] = {
MMUMETHOD(mmu_clear_modify, moea_clear_modify),
MMUMETHOD(mmu_clear_reference, moea_clear_reference),
MMUMETHOD(mmu_copy_page, moea_copy_page),
+ MMUMETHOD(mmu_copy_pages, moea_copy_pages),
MMUMETHOD(mmu_enter, moea_enter),
MMUMETHOD(mmu_enter_object, moea_enter_object),
MMUMETHOD(mmu_enter_quick, moea_enter_quick),
@@ -1043,6 +1046,30 @@ moea_copy_page(mmu_t mmu, vm_page_t msrc, vm_page_t mdst)
bcopy((void *)src, (void *)dst, PAGE_SIZE);
}
+void
+moea_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset,
+ vm_page_t *mb, vm_offset_t b_offset, int xfersize)
+{
+ void *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ while (xfersize > 0) {
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ a_cp = (char *)VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT]) +
+ a_pg_offset;
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ b_cp = (char *)VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT]) +
+ b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+}
+
/*
* Zero a page of physical memory by temporarily mapping it into the tlb.
*/
diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c
index 14b88f0..90466e8a 100644
--- a/sys/powerpc/aim/mmu_oea64.c
+++ b/sys/powerpc/aim/mmu_oea64.c
@@ -290,6 +290,8 @@ void moea64_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t);
void moea64_clear_modify(mmu_t, vm_page_t);
void moea64_clear_reference(mmu_t, vm_page_t);
void moea64_copy_page(mmu_t, vm_page_t, vm_page_t);
+void moea64_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset,
+ vm_page_t *mb, vm_offset_t b_offset, int xfersize);
void moea64_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t);
void moea64_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t,
vm_prot_t);
@@ -334,6 +336,7 @@ static mmu_method_t moea64_methods[] = {
MMUMETHOD(mmu_clear_modify, moea64_clear_modify),
MMUMETHOD(mmu_clear_reference, moea64_clear_reference),
MMUMETHOD(mmu_copy_page, moea64_copy_page),
+ MMUMETHOD(mmu_copy_pages, moea64_copy_pages),
MMUMETHOD(mmu_enter, moea64_enter),
MMUMETHOD(mmu_enter_object, moea64_enter_object),
MMUMETHOD(mmu_enter_quick, moea64_enter_quick),
@@ -1104,6 +1107,72 @@ moea64_copy_page(mmu_t mmu, vm_page_t msrc, vm_page_t mdst)
}
}
+static inline void
+moea64_copy_pages_dmap(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset,
+ vm_page_t *mb, vm_offset_t b_offset, int xfersize)
+{
+ void *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ while (xfersize > 0) {
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ a_cp = (char *)VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT]) +
+ a_pg_offset;
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ b_cp = (char *)VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT]) +
+ b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+}
+
+static inline void
+moea64_copy_pages_nodmap(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset,
+ vm_page_t *mb, vm_offset_t b_offset, int xfersize)
+{
+ void *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ mtx_lock(&moea64_scratchpage_mtx);
+ while (xfersize > 0) {
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ moea64_set_scratchpage_pa(mmu, 0,
+ VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT]));
+ a_cp = (char *)moea64_scratchpage_va[0] + a_pg_offset;
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ moea64_set_scratchpage_pa(mmu, 1,
+ VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT]));
+ b_cp = (char *)moea64_scratchpage_va[1] + b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+ mtx_unlock(&moea64_scratchpage_mtx);
+}
+
+void
+moea64_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset,
+ vm_page_t *mb, vm_offset_t b_offset, int xfersize)
+{
+
+ if (hw_direct_map) {
+ moea64_copy_pages_dmap(mmu, ma, a_offset, mb, b_offset,
+ xfersize);
+ } else {
+ moea64_copy_pages_nodmap(mmu, ma, a_offset, mb, b_offset,
+ xfersize);
+ }
+}
+
void
moea64_zero_page_area(mmu_t mmu, vm_page_t m, int off, int size)
{
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c
index d30aded..9a496fe 100644
--- a/sys/powerpc/aim/trap.c
+++ b/sys/powerpc/aim/trap.c
@@ -130,6 +130,7 @@ systrace_probe_func_t systrace_probe_func;
dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr;
dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr;
dtrace_return_probe_ptr_t dtrace_return_probe_ptr;
+int (*dtrace_invop_jump_addr)(struct trapframe *);
#endif
static struct powerpc_exception powerpc_exceptions[] = {
@@ -220,10 +221,8 @@ trap(struct trapframe *frame)
/*
* XXXDTRACE: add fasttrap and pid probes handlers here (if ever)
*/
- if (!user) {
- if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type))
- return;
- }
+ if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type))
+ return;
#endif
if (user) {
@@ -296,7 +295,7 @@ trap(struct trapframe *frame)
/* Identify the trap reason */
if (frame->srr1 & EXC_PGM_TRAP)
sig = SIGTRAP;
- else if (ppc_instr_emulate(frame) == 0)
+ else if (ppc_instr_emulate(frame) == 0)
frame->srr0 += 4;
else
sig = SIGILL;
@@ -311,6 +310,16 @@ trap(struct trapframe *frame)
KASSERT(cold || td->td_ucred != NULL,
("kernel trap doesn't have ucred"));
switch (type) {
+#ifdef KDTRACE_HOOKS
+ case EXC_PGM:
+ if (frame->srr1 & EXC_PGM_TRAP) {
+ if (*(uintptr_t *)frame->srr0 == 0x7c810808) {
+ if (dtrace_invop_jump_addr != NULL) {
+ dtrace_invop_jump_addr(frame);
+ }
+ }
+ }
+#endif
#ifdef __powerpc64__
case EXC_DSE:
if ((frame->cpu.aim.dar & SEGMENT_MASK) == USER_ADDR) {
diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S
index a00cc3d..d137fd4 100644
--- a/sys/powerpc/aim/trap_subr32.S
+++ b/sys/powerpc/aim/trap_subr32.S
@@ -242,13 +242,6 @@
#ifdef KDTRACE_HOOKS
.data
- .globl dtrace_invop_jump_addr
- .align 4
- .type dtrace_invop_jump_addr, @object
- .size dtrace_invop_jump_addr, 4
-dtrace_invop_jump_addr:
- .word 0
- .word 0
.globl dtrace_invop_calltrap_addr
.align 4
.type dtrace_invop_calltrap_addr, @object
diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S
index 0a12753..8550227 100644
--- a/sys/powerpc/aim/trap_subr64.S
+++ b/sys/powerpc/aim/trap_subr64.S
@@ -276,13 +276,6 @@ restore_kernsrs:
#ifdef KDTRACE_HOOKS
.data
- .globl dtrace_invop_jump_addr
- .align 8
- .type dtrace_invop_jump_addr, @object
- .size dtrace_invop_jump_addr, 8
-dtrace_invop_jump_addr:
- .word 0
- .word 0
.globl dtrace_invop_calltrap_addr
.align 8
.type dtrace_invop_calltrap_addr, @object
diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c
index 343b046..b9f4838 100644
--- a/sys/powerpc/booke/pmap.c
+++ b/sys/powerpc/booke/pmap.c
@@ -274,6 +274,8 @@ static void mmu_booke_clear_reference(mmu_t, vm_page_t);
static void mmu_booke_copy(mmu_t, pmap_t, pmap_t, vm_offset_t,
vm_size_t, vm_offset_t);
static void mmu_booke_copy_page(mmu_t, vm_page_t, vm_page_t);
+static void mmu_booke_copy_pages(mmu_t, vm_page_t *,
+ vm_offset_t, vm_page_t *, vm_offset_t, int);
static void mmu_booke_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t,
vm_prot_t, boolean_t);
static void mmu_booke_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t,
@@ -334,6 +336,7 @@ static mmu_method_t mmu_booke_methods[] = {
MMUMETHOD(mmu_clear_reference, mmu_booke_clear_reference),
MMUMETHOD(mmu_copy, mmu_booke_copy),
MMUMETHOD(mmu_copy_page, mmu_booke_copy_page),
+ MMUMETHOD(mmu_copy_pages, mmu_booke_copy_pages),
MMUMETHOD(mmu_enter, mmu_booke_enter),
MMUMETHOD(mmu_enter_object, mmu_booke_enter_object),
MMUMETHOD(mmu_enter_quick, mmu_booke_enter_quick),
@@ -2136,6 +2139,36 @@ mmu_booke_copy_page(mmu_t mmu, vm_page_t sm, vm_page_t dm)
mtx_unlock(&copy_page_mutex);
}
+static inline void
+mmu_booke_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset,
+ vm_page_t *mb, vm_offset_t b_offset, int xfersize)
+{
+ void *a_cp, *b_cp;
+ vm_offset_t a_pg_offset, b_pg_offset;
+ int cnt;
+
+ mtx_lock(&copy_page_mutex);
+ while (xfersize > 0) {
+ a_pg_offset = a_offset & PAGE_MASK;
+ cnt = min(xfersize, PAGE_SIZE - a_pg_offset);
+ mmu_booke_kenter(mmu, copy_page_src_va,
+ VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT]));
+ a_cp = (char *)copy_page_src_va + a_pg_offset;
+ b_pg_offset = b_offset & PAGE_MASK;
+ cnt = min(cnt, PAGE_SIZE - b_pg_offset);
+ mmu_booke_kenter(mmu, copy_page_dst_va,
+ VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT]));
+ b_cp = (char *)copy_page_dst_va + b_pg_offset;
+ bcopy(a_cp, b_cp, cnt);
+ mmu_booke_kremove(mmu, copy_page_dst_va);
+ mmu_booke_kremove(mmu, copy_page_src_va);
+ a_offset += cnt;
+ b_offset += cnt;
+ xfersize -= cnt;
+ }
+ mtx_unlock(&copy_page_mutex);
+}
+
/*
* mmu_booke_zero_page_idle zeros the specified hardware page by mapping it
* into virtual memory and using bzero to clear its contents. This is intended
diff --git a/sys/powerpc/powerpc/mmu_if.m b/sys/powerpc/powerpc/mmu_if.m
index 8cd6e52..0382bd8 100644
--- a/sys/powerpc/powerpc/mmu_if.m
+++ b/sys/powerpc/powerpc/mmu_if.m
@@ -215,6 +215,14 @@ METHOD void copy_page {
vm_page_t _dst;
};
+METHOD void copy_pages {
+ mmu_t _mmu;
+ vm_page_t *_ma;
+ vm_offset_t _a_offset;
+ vm_page_t *_mb;
+ vm_offset_t _b_offset;
+ int _xfersize;
+};
/**
* @brief Create a mapping between a virtual/physical address pair in the
diff --git a/sys/powerpc/powerpc/pmap_dispatch.c b/sys/powerpc/powerpc/pmap_dispatch.c
index c919196..42f1a39 100644
--- a/sys/powerpc/powerpc/pmap_dispatch.c
+++ b/sys/powerpc/powerpc/pmap_dispatch.c
@@ -133,6 +133,16 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
}
void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+
+ CTR6(KTR_PMAP, "%s(%p, %#x, %p, %#x, %#x)", __func__, ma,
+ a_offset, mb, b_offset, xfersize);
+ MMU_COPY_PAGES(mmu_obj, ma, a_offset, mb, b_offset, xfersize);
+}
+
+void
pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t p,
vm_prot_t prot, boolean_t wired)
{
diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c
index 86a8d01..a658de9 100644
--- a/sys/rpc/clnt_dg.c
+++ b/sys/rpc/clnt_dg.c
@@ -431,7 +431,7 @@ call_again:
send_again:
mtx_unlock(&cs->cs_lock);
- MGETHDR(mreq, M_WAITOK, MT_DATA);
+ mreq = m_gethdr(M_WAITOK, MT_DATA);
KASSERT(cu->cu_mcalllen <= MHLEN, ("RPC header too big"));
bcopy(cu->cu_mcallc, mreq->m_data, cu->cu_mcalllen);
mreq->m_len = cu->cu_mcalllen;
diff --git a/sys/rpc/clnt_rc.c b/sys/rpc/clnt_rc.c
index b910059..0015b3b 100644
--- a/sys/rpc/clnt_rc.c
+++ b/sys/rpc/clnt_rc.c
@@ -247,8 +247,7 @@ clnt_reconnect_call(
stat = clnt_reconnect_connect(cl);
if (stat == RPC_SYSTEMERROR) {
error = tsleep(&fake_wchan,
- rc->rc_intr ? PCATCH | PBDRY : 0, "rpccon",
- hz);
+ rc->rc_intr ? PCATCH : 0, "rpccon", hz);
if (error == EINTR || error == ERESTART)
return (RPC_INTR);
tries++;
diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c
index e42d26d..eec9f50 100644
--- a/sys/rpc/clnt_vc.c
+++ b/sys/rpc/clnt_vc.c
@@ -162,7 +162,7 @@ clnt_vc_create(
interrupted = 0;
sleep_flag = PSOCK;
if (intrflag != 0)
- sleep_flag |= (PCATCH | PBDRY);
+ sleep_flag |= PCATCH;
while ((so->so_state & SS_ISCONNECTING)
&& so->so_error == 0) {
error = msleep(&so->so_timeo, SOCK_MTX(so),
@@ -349,7 +349,7 @@ call_again:
/*
* Leave space to pre-pend the record mark.
*/
- MGETHDR(mreq, M_WAITOK, MT_DATA);
+ mreq = m_gethdr(M_WAITOK, MT_DATA);
mreq->m_data += sizeof(uint32_t);
KASSERT(ct->ct_mpos + sizeof(uint32_t) <= MHLEN,
("RPC header too big"));
@@ -470,7 +470,6 @@ call_again:
errp->re_errno = error;
switch (error) {
case EINTR:
- case ERESTART:
stat = RPC_INTR;
break;
case EWOULDBLOCK:
@@ -704,7 +703,7 @@ clnt_vc_control(CLIENT *cl, u_int request, void *info)
case CLSET_INTERRUPTIBLE:
if (*(int *) info)
- ct->ct_waitflag = PCATCH | PBDRY;
+ ct->ct_waitflag = PCATCH;
else
ct->ct_waitflag = 0;
break;
diff --git a/sys/rpc/rpc_generic.c b/sys/rpc/rpc_generic.c
index 65f57cf..dd5c6c3 100644
--- a/sys/rpc/rpc_generic.c
+++ b/sys/rpc/rpc_generic.c
@@ -750,9 +750,7 @@ clnt_call_private(
struct mbuf *mrep;
enum clnt_stat stat;
- MGET(mreq, M_WAITOK, MT_DATA);
- MCLGET(mreq, M_WAITOK);
- mreq->m_len = 0;
+ mreq = m_getcl(M_WAITOK, MT_DATA, 0);
xdrmbuf_create(&xdrs, mreq, XDR_ENCODE);
if (!xargs(&xdrs, argsp)) {
diff --git a/sys/rpc/rpcm_subs.h b/sys/rpc/rpcm_subs.h
index f0d60a3..e4fddb5 100644
--- a/sys/rpc/rpcm_subs.h
+++ b/sys/rpc/rpcm_subs.h
@@ -80,7 +80,7 @@
#define rpcm_build(a,c,s) \
{ if ((s) > M_TRAILINGSPACE(mb)) { \
- MGET(mb2, M_WAITOK, MT_DATA); \
+ mb2 = m_get(M_WAITOK, MT_DATA); \
if ((s) > MLEN) \
panic("build > MLEN"); \
mb->m_next = mb2; \
diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c
index f038e78..bbc6f6d 100644
--- a/sys/rpc/svc.c
+++ b/sys/rpc/svc.c
@@ -563,9 +563,7 @@ svc_sendreply(struct svc_req *rqstp, xdrproc_t xdr_results, void * xdr_location)
rply.acpted_rply.ar_results.where = NULL;
rply.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void;
- MGET(m, M_WAITOK, MT_DATA);
- MCLGET(m, M_WAITOK);
- m->m_len = 0;
+ m = m_getcl(M_WAITOK, MT_DATA, 0);
xdrmbuf_create(&xdrs, m, XDR_ENCODE);
ok = xdr_results(&xdrs, xdr_location);
XDR_DESTROY(&xdrs);
diff --git a/sys/rpc/svc_dg.c b/sys/rpc/svc_dg.c
index ba6a56e..3df79bb 100644
--- a/sys/rpc/svc_dg.c
+++ b/sys/rpc/svc_dg.c
@@ -238,8 +238,7 @@ svc_dg_reply(SVCXPRT *xprt, struct rpc_msg *msg,
bool_t stat = TRUE;
int error;
- MGETHDR(mrep, M_WAITOK, MT_DATA);
- mrep->m_len = 0;
+ mrep = m_gethdr(M_WAITOK, MT_DATA);
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);
diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c
index 667d84c..80824ef 100644
--- a/sys/rpc/svc_vc.c
+++ b/sys/rpc/svc_vc.c
@@ -796,8 +796,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_msg *msg,
/*
* Leave space for record mark.
*/
- MGETHDR(mrep, M_WAITOK, MT_DATA);
- mrep->m_len = 0;
+ mrep = m_gethdr(M_WAITOK, MT_DATA);
mrep->m_data += sizeof(uint32_t);
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);
@@ -850,8 +849,7 @@ svc_vc_backchannel_reply(SVCXPRT *xprt, struct rpc_msg *msg,
/*
* Leave space for record mark.
*/
- MGETHDR(mrep, M_WAITOK, MT_DATA);
- mrep->m_len = 0;
+ mrep = m_gethdr(M_WAITOK, MT_DATA);
mrep->m_data += sizeof(uint32_t);
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 8bfc454..97a085a 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -1918,6 +1918,14 @@ pmap_copy_page(vm_page_t msrc, vm_page_t mdst)
}
}
+void
+pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
+ vm_offset_t b_offset, int xfersize)
+{
+
+ panic("pmap_copy_pages: not implemented");
+}
+
/*
* Returns true if the pmap's pv is one of the first
* 16 pvs linked to from this page. This count may
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 672ef5a..2261b56 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -508,9 +508,9 @@ void bufdone_finish(struct buf *);
void bd_speedup(void);
int cluster_read(struct vnode *, u_quad_t, daddr_t, long,
- struct ucred *, long, int, struct buf **);
-int cluster_wbuild(struct vnode *, long, daddr_t, int);
-void cluster_write(struct vnode *, struct buf *, u_quad_t, int);
+ struct ucred *, long, int, int, struct buf **);
+int cluster_wbuild(struct vnode *, long, daddr_t, int, int);
+void cluster_write(struct vnode *, struct buf *, u_quad_t, int, int);
void vfs_bio_set_valid(struct buf *, int base, int size);
void vfs_bio_clrbuf(struct buf *);
void vfs_busy_pages(struct buf *, int clear_modify);
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index af7f92b..ec10bc6 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -195,7 +195,7 @@ struct mbuf {
#define M_FIRSTFRAG 0x00001000 /* packet is first fragment */
#define M_LASTFRAG 0x00002000 /* packet is last fragment */
#define M_SKIP_FIREWALL 0x00004000 /* skip firewall processing */
-#define M_FREELIST 0x00008000 /* mbuf is on the free list */
+ /* 0x00008000 free */
#define M_VLANTAG 0x00010000 /* ether_vtag is valid */
#define M_PROMISC 0x00020000 /* packet was not for us */
#define M_NOFREE 0x00040000 /* do not free mbuf, embedded in cluster */
@@ -655,7 +655,8 @@ m_last(struct mbuf *m)
#define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type)))
#define MCLGET(m, how) m_clget((m), (how))
#define MEXTADD(m, buf, size, free, arg1, arg2, flags, type) \
- m_extadd((m), (caddr_t)(buf), (size), (free),(arg1),(arg2),(flags), (type))
+ (void )m_extadd((m), (caddr_t)(buf), (size), (free), (arg1), (arg2),\
+ (flags), (type), M_NOWAIT)
#define m_getm(m, len, how, type) \
m_getm2((m), (len), (how), (type), M_PKTHDR)
@@ -707,6 +708,18 @@ m_last(struct mbuf *m)
} while (0)
/*
+ * As above, for mbuf with external storage.
+ */
+#define MEXT_ALIGN(m, len) do { \
+ KASSERT((m)->m_flags & M_EXT, \
+ ("%s: MEXT_ALIGN not an M_EXT mbuf", __func__)); \
+ KASSERT((m)->m_data == (m)->m_ext.ext_buf, \
+ ("%s: MEXT_ALIGN not a virgin mbuf", __func__)); \
+ (m)->m_data += ((m)->m_ext.ext_size - (len)) & \
+ ~(sizeof(long) - 1); \
+} while (0)
+
+/*
* Compute the amount of space available before the current start of data in
* an mbuf.
*
@@ -780,8 +793,8 @@ int m_apply(struct mbuf *, int, int,
int (*)(void *, void *, u_int), void *);
int m_append(struct mbuf *, int, c_caddr_t);
void m_cat(struct mbuf *, struct mbuf *);
-void m_extadd(struct mbuf *, caddr_t, u_int,
- void (*)(void *, void *), void *, void *, int, int);
+int m_extadd(struct mbuf *, caddr_t, u_int,
+ void (*)(void *, void *), void *, void *, int, int, int);
struct mbuf *m_collapse(struct mbuf *, int, int);
void m_copyback(struct mbuf *, int, int, c_caddr_t);
void m_copydata(const struct mbuf *, int, int, caddr_t);
@@ -800,7 +813,7 @@ int m_dup_pkthdr(struct mbuf *, struct mbuf *, int);
u_int m_fixhdr(struct mbuf *);
struct mbuf *m_fragment(struct mbuf *, int, int);
void m_freem(struct mbuf *);
-struct mbuf *m_get2(int, short, int, int);
+struct mbuf *m_get2(int, int, short, int);
struct mbuf *m_getjcl(int, short, int, int);
struct mbuf *m_getm2(struct mbuf *, int, int, short, int);
struct mbuf *m_getptr(struct mbuf *, int, int *);
diff --git a/sys/sys/param.h b/sys/sys/param.h
index ce72863..996d47c 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1000029 /* Master, propagated to newvers */
+#define __FreeBSD_version 1000030 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 0696edd..bc16acf 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -693,6 +693,8 @@ int vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags,
struct vnode **rvp);
int vn_io_fault_uiomove(char *data, int xfersize, struct uio *uio);
+int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize,
+ struct uio *uio);
#define vn_rangelock_unlock(vp, cookie) \
rangelock_unlock(&(vp)->v_rl, (cookie), VI_MTX(vp))
diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c
index 0e29be87f..a5e99d9 100644
--- a/sys/ufs/ffs/ffs_balloc.c
+++ b/sys/ufs/ffs/ffs_balloc.c
@@ -418,7 +418,7 @@ retry:
if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
error = cluster_read(vp, ip->i_size, lbn,
(int)fs->fs_bsize, NOCRED,
- MAXBSIZE, seqcount, &nbp);
+ MAXBSIZE, seqcount, 0, &nbp);
} else {
error = bread(vp, lbn, (int)fs->fs_bsize, NOCRED, &nbp);
}
@@ -679,9 +679,9 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
if (osize < fs->fs_bsize && osize > 0) {
UFS_LOCK(ump);
error = ffs_realloccg(ip, nb, dp->di_db[nb],
- ffs_blkpref_ufs2(ip, lastlbn, (int)nb,
- &dp->di_db[0]), osize, (int)fs->fs_bsize,
- flags, cred, &bp);
+ ffs_blkpref_ufs2(ip, lastlbn, (int)nb,
+ &dp->di_db[0]), osize, (int)fs->fs_bsize,
+ flags, cred, &bp);
if (error)
return (error);
if (DOINGSOFTDEP(vp))
@@ -733,7 +733,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t startoffset, int size,
UFS_LOCK(ump);
error = ffs_realloccg(ip, lbn, dp->di_db[lbn],
ffs_blkpref_ufs2(ip, lbn, (int)lbn,
- &dp->di_db[0]), osize, nsize, flags,
+ &dp->di_db[0]), osize, nsize, flags,
cred, &bp);
if (error)
return (error);
@@ -966,7 +966,7 @@ retry:
if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
error = cluster_read(vp, ip->i_size, lbn,
(int)fs->fs_bsize, NOCRED,
- MAXBSIZE, seqcount, &nbp);
+ MAXBSIZE, seqcount, 0, &nbp);
} else {
error = bread(vp, lbn, (int)fs->fs_bsize, NOCRED, &nbp);
}
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index c065187..c310ece 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -519,7 +519,8 @@ ffs_read(ap)
* doing sequential access.
*/
error = cluster_read(vp, ip->i_size, lbn,
- size, NOCRED, blkoffset + uio->uio_resid, seqcount, &bp);
+ size, NOCRED, blkoffset + uio->uio_resid,
+ seqcount, 0, &bp);
} else if (seqcount > 1) {
/*
* If we are NOT allowed to cluster, then
@@ -784,7 +785,8 @@ ffs_write(ap)
} else if (xfersize + blkoffset == fs->fs_bsize) {
if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) {
bp->b_flags |= B_CLUSTEROK;
- cluster_write(vp, bp, ip->i_size, seqcount);
+ cluster_write(vp, bp, ip->i_size, seqcount,
+ 0);
} else {
bawrite(bp);
}
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index f69b1f9..574c59c 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1554,6 +1554,7 @@ relock:
cache_purge(fvp);
if (tvp)
cache_purge(tvp);
+ cache_purge_negative(tdvp);
unlockout:
vput(fdvp);
diff --git a/sys/netncp/ncp_sock.h b/sys/vm/_vm_radix.h
index f8feac5..f066462 100644
--- a/sys/netncp/ncp_sock.h
+++ b/sys/vm/_vm_radix.h
@@ -1,5 +1,7 @@
-/*-
- * Copyright (c) 1999 Boris Popov
+/*
+ * Copyright (c) 2013 EMC Corp.
+ * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
+ * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,25 +27,25 @@
*
* $FreeBSD$
*/
-#ifndef _NETNCP_NCP_SOCK_H_
-#define _NETNCP_NCP_SOCK_H_
-struct ncp_conn;
-struct mbuf;
-struct ncp_rq;
-struct proc;
-struct socket;
-struct timeval;
+#ifndef __VM_RADIX_H_
+#define __VM_RADIX_H_
-int ncp_sock_connect(struct ncp_conn *ncp);
-int ncp_sock_recv(struct socket *so, struct mbuf **mp, int *rlen);
-int ncp_sock_send(struct socket *so, struct mbuf *data, struct ncp_rq *rqp);
-int ncp_sock_disconnect(struct ncp_conn *conn);
-int ncp_sock_checksum(struct ncp_conn *conn, int enable);
+/*
+ * Radix tree root.
+ */
+struct vm_radix {
+ uintptr_t rt_root;
+};
+
+#ifdef _KERNEL
-void ncp_check_rq(struct ncp_conn *conn);
-void ncp_check_conn(struct ncp_conn *conn);
+static __inline boolean_t
+vm_radix_is_empty(struct vm_radix *rtree)
+{
-void ncp_check_wd(struct ncp_conn *conn);
+ return (rtree->rt_root == 0);
+}
-#endif /* _NCP_SOCK_H_ */
+#endif /* _KERNEL */
+#endif /* !__VM_RADIX_H_ */
diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h
index d06c22b..c64a549 100644
--- a/sys/vm/pmap.h
+++ b/sys/vm/pmap.h
@@ -108,6 +108,8 @@ void pmap_clear_modify(vm_page_t m);
void pmap_clear_reference(vm_page_t m);
void pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t);
void pmap_copy_page(vm_page_t, vm_page_t);
+void pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset,
+ vm_page_t mb[], vm_offset_t b_offset, int xfersize);
void pmap_enter(pmap_t, vm_offset_t, vm_prot_t, vm_page_t,
vm_prot_t, boolean_t);
void pmap_enter_object(pmap_t pmap, vm_offset_t start,
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index 9f602b7..64a2ebb 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -85,11 +85,11 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_extern.h>
#include <vm/uma.h>
-vm_map_t kernel_map=0;
-vm_map_t kmem_map=0;
-vm_map_t exec_map=0;
+vm_map_t kernel_map;
+vm_map_t kmem_map;
+vm_map_t exec_map;
vm_map_t pipe_map;
-vm_map_t buffer_map=0;
+vm_map_t buffer_map;
const void *zero_region;
CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0);
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 684fdf4..3d9ec61 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$");
#include <vm/swap_pager.h>
#include <vm/vm_kern.h>
#include <vm/vm_extern.h>
+#include <vm/vm_radix.h>
#include <vm/vm_reserv.h>
#include <vm/uma.h>
@@ -167,8 +168,8 @@ vm_object_zdtor(void *mem, int size, void *arg)
object = (vm_object_t)mem;
KASSERT(TAILQ_EMPTY(&object->memq),
("object %p has resident pages in its memq", object));
- KASSERT(object->root == NULL,
- ("object %p has resident pages in its tree", object));
+ KASSERT(vm_radix_is_empty(&object->rtree),
+ ("object %p has resident pages in its trie", object));
#if VM_NRESERVLEVEL > 0
KASSERT(LIST_EMPTY(&object->rvq),
("object %p has reservations",
@@ -199,11 +200,11 @@ vm_object_zinit(void *mem, int size, int flags)
rw_init_flags(&object->lock, "vm object", RW_DUPOK);
/* These are true for any object that has been freed */
- object->root = NULL;
+ object->rtree.rt_root = 0;
object->paging_in_progress = 0;
object->resident_page_count = 0;
object->shadow_count = 0;
- object->cache = NULL;
+ object->cache.rt_root = 0;
return (0);
}
@@ -295,6 +296,8 @@ vm_object_init(void)
NULL,
#endif
vm_object_zinit, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM|UMA_ZONE_NOFREE);
+
+ vm_radix_init();
}
void
@@ -742,7 +745,7 @@ vm_object_terminate(vm_object_t object)
* modified by the preceding loop.
*/
if (object->resident_page_count != 0) {
- object->root = NULL;
+ vm_radix_reclaim_allnodes(&object->rtree);
TAILQ_INIT(&object->memq);
object->resident_page_count = 0;
if (object->type == OBJT_VNODE)
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index dac90fc..2f2c961 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -72,6 +72,8 @@
#include <sys/_mutex.h>
#include <sys/_rwlock.h>
+#include <vm/_vm_radix.h>
+
/*
* Types defined:
*
@@ -79,10 +81,10 @@
*
* The root of cached pages pool is protected by both the per-object lock
* and the free pages queue mutex.
- * On insert in the cache splay tree, the per-object lock is expected
+ * On insert in the cache radix trie, the per-object lock is expected
* to be already held and the free pages queue mutex will be
* acquired during the operation too.
- * On remove and lookup from the cache splay tree, only the free
+ * On remove and lookup from the cache radix trie, only the free
* pages queue mutex is expected to be locked.
* These rules allow for reliably checking for the presence of cached
* pages with only the per-object lock held, thereby reducing contention
@@ -101,7 +103,7 @@ struct vm_object {
LIST_HEAD(, vm_object) shadow_head; /* objects that this is a shadow for */
LIST_ENTRY(vm_object) shadow_list; /* chain of shadow objects */
TAILQ_HEAD(, vm_page) memq; /* list of resident pages */
- vm_page_t root; /* root of the resident page splay tree */
+ struct vm_radix rtree; /* root of the resident page radix trie*/
vm_pindex_t size; /* Object size */
int generation; /* generation ID */
int ref_count; /* How many refs?? */
@@ -116,7 +118,7 @@ struct vm_object {
vm_ooffset_t backing_object_offset;/* Offset in backing object */
TAILQ_ENTRY(vm_object) pager_object_list; /* list of all objects of this pager type */
LIST_HEAD(, vm_reserv) rvq; /* list of reservations */
- vm_page_t cache; /* (o + f) root of the cache page splay tree */
+ struct vm_radix cache; /* (o + f) root of the cache page radix trie */
void *handle;
union {
/*
@@ -246,7 +248,7 @@ static __inline boolean_t
vm_object_cache_is_empty(vm_object_t object)
{
- return (object->cache == NULL);
+ return (vm_radix_is_empty(&object->cache));
}
vm_object_t vm_object_allocate (objtype_t, vm_pindex_t);
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 9a68a9e..3e4cce9 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -73,7 +73,7 @@
* * The page daemon can acquire and hold any pair of page queue
* locks in any order.
*
- * - The object mutex is held when inserting or removing
+ * - The object lock is required when inserting or removing
* pages from an object (vm_page_insert() or vm_page_remove()).
*
*/
@@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
#include <vm/vm_phys.h>
+#include <vm/vm_radix.h>
#include <vm/vm_reserv.h>
#include <vm/vm_extern.h>
#include <vm/uma.h>
@@ -794,63 +795,6 @@ vm_page_dirty_KBI(vm_page_t m)
}
/*
- * vm_page_splay:
- *
- * Implements Sleator and Tarjan's top-down splay algorithm. Returns
- * the vm_page containing the given pindex. If, however, that
- * pindex is not found in the vm_object, returns a vm_page that is
- * adjacent to the pindex, coming before or after it.
- */
-vm_page_t
-vm_page_splay(vm_pindex_t pindex, vm_page_t root)
-{
- struct vm_page dummy;
- vm_page_t lefttreemax, righttreemin, y;
-
- if (root == NULL)
- return (root);
- lefttreemax = righttreemin = &dummy;
- for (;; root = y) {
- if (pindex < root->pindex) {
- if ((y = root->left) == NULL)
- break;
- if (pindex < y->pindex) {
- /* Rotate right. */
- root->left = y->right;
- y->right = root;
- root = y;
- if ((y = root->left) == NULL)
- break;
- }
- /* Link into the new root's right tree. */
- righttreemin->left = root;
- righttreemin = root;
- } else if (pindex > root->pindex) {
- if ((y = root->right) == NULL)
- break;
- if (pindex > y->pindex) {
- /* Rotate left. */
- root->right = y->left;
- y->left = root;
- root = y;
- if ((y = root->right) == NULL)
- break;
- }
- /* Link into the new root's left tree. */
- lefttreemax->right = root;
- lefttreemax = root;
- } else
- break;
- }
- /* Assemble the new root. */
- lefttreemax->right = root->left;
- righttreemin->left = root->right;
- root->left = dummy.right;
- root->right = dummy.left;
- return (root);
-}
-
-/*
* vm_page_insert: [ internal use only ]
*
* Inserts the given mem entry into the object and object list.
@@ -865,7 +809,7 @@ vm_page_splay(vm_pindex_t pindex, vm_page_t root)
void
vm_page_insert(vm_page_t m, vm_object_t object, vm_pindex_t pindex)
{
- vm_page_t root;
+ vm_page_t neighbor;
VM_OBJECT_ASSERT_WLOCKED(object);
if (m->object != NULL)
@@ -880,28 +824,19 @@ vm_page_insert(vm_page_t m, vm_object_t object, vm_pindex_t pindex)
/*
* Now link into the object's ordered list of backed pages.
*/
- root = object->root;
- if (root == NULL) {
- m->left = NULL;
- m->right = NULL;
+ if (object->resident_page_count == 0) {
TAILQ_INSERT_TAIL(&object->memq, m, listq);
} else {
- root = vm_page_splay(pindex, root);
- if (pindex < root->pindex) {
- m->left = root->left;
- m->right = root;
- root->left = NULL;
- TAILQ_INSERT_BEFORE(root, m, listq);
- } else if (pindex == root->pindex)
- panic("vm_page_insert: offset already allocated");
- else {
- m->right = root->right;
- m->left = root;
- root->right = NULL;
- TAILQ_INSERT_AFTER(&object->memq, root, m, listq);
- }
+ neighbor = vm_radix_lookup_le(&object->rtree, pindex);
+ if (neighbor != NULL) {
+ KASSERT(pindex > neighbor->pindex,
+ ("vm_page_insert: offset %ju less than %ju",
+ (uintmax_t)pindex, (uintmax_t)neighbor->pindex));
+ TAILQ_INSERT_AFTER(&object->memq, neighbor, m, listq);
+ } else
+ TAILQ_INSERT_HEAD(&object->memq, m, listq);
}
- object->root = m;
+ vm_radix_insert(&object->rtree, m);
/*
* Show that the object has one more resident page.
@@ -937,7 +872,6 @@ void
vm_page_remove(vm_page_t m)
{
vm_object_t object;
- vm_page_t next, prev, root;
if ((m->oflags & VPO_UNMANAGED) == 0)
vm_page_lock_assert(m, MA_OWNED);
@@ -952,42 +886,7 @@ vm_page_remove(vm_page_t m)
/*
* Now remove from the object's list of backed pages.
*/
- if ((next = TAILQ_NEXT(m, listq)) != NULL && next->left == m) {
- /*
- * Since the page's successor in the list is also its parent
- * in the tree, its right subtree must be empty.
- */
- next->left = m->left;
- KASSERT(m->right == NULL,
- ("vm_page_remove: page %p has right child", m));
- } else if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL &&
- prev->right == m) {
- /*
- * Since the page's predecessor in the list is also its parent
- * in the tree, its left subtree must be empty.
- */
- KASSERT(m->left == NULL,
- ("vm_page_remove: page %p has left child", m));
- prev->right = m->right;
- } else {
- if (m != object->root)
- vm_page_splay(m->pindex, object->root);
- if (m->left == NULL)
- root = m->right;
- else if (m->right == NULL)
- root = m->left;
- else {
- /*
- * Move the page's successor to the root, because
- * pages are usually removed in ascending order.
- */
- if (m->right != next)
- vm_page_splay(m->pindex, m->right);
- next->left = m->left;
- root = next;
- }
- object->root = root;
- }
+ vm_radix_remove(&object->rtree, m->pindex);
TAILQ_REMOVE(&object->memq, m, listq);
/*
@@ -1015,15 +914,9 @@ vm_page_remove(vm_page_t m)
vm_page_t
vm_page_lookup(vm_object_t object, vm_pindex_t pindex)
{
- vm_page_t m;
VM_OBJECT_ASSERT_WLOCKED(object);
- if ((m = object->root) != NULL && m->pindex != pindex) {
- m = vm_page_splay(pindex, m);
- if ((object->root = m)->pindex != pindex)
- m = NULL;
- }
- return (m);
+ return (vm_radix_lookup(&object->rtree, pindex));
}
/*
@@ -1040,13 +933,8 @@ vm_page_find_least(vm_object_t object, vm_pindex_t pindex)
vm_page_t m;
VM_OBJECT_ASSERT_WLOCKED(object);
- if ((m = TAILQ_FIRST(&object->memq)) != NULL) {
- if (m->pindex < pindex) {
- m = vm_page_splay(pindex, object->root);
- if ((object->root = m)->pindex < pindex)
- m = TAILQ_NEXT(m, listq);
- }
- }
+ if ((m = TAILQ_FIRST(&object->memq)) != NULL && m->pindex < pindex)
+ m = vm_radix_lookup_ge(&object->rtree, pindex);
return (m);
}
@@ -1126,45 +1014,18 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex)
void
vm_page_cache_free(vm_object_t object, vm_pindex_t start, vm_pindex_t end)
{
- vm_page_t m, m_next;
+ vm_page_t m;
boolean_t empty;
mtx_lock(&vm_page_queue_free_mtx);
- if (__predict_false(vm_object_cache_is_empty(object))) {
+ if (__predict_false(vm_radix_is_empty(&object->cache))) {
mtx_unlock(&vm_page_queue_free_mtx);
return;
}
- m = object->cache = vm_page_splay(start, object->cache);
- if (m->pindex < start) {
- if (m->right == NULL)
- m = NULL;
- else {
- m_next = vm_page_splay(start, m->right);
- m_next->left = m;
- m->right = NULL;
- m = object->cache = m_next;
- }
- }
-
- /*
- * At this point, "m" is either (1) a reference to the page
- * with the least pindex that is greater than or equal to
- * "start" or (2) NULL.
- */
- for (; m != NULL && (m->pindex < end || end == 0); m = m_next) {
- /*
- * Find "m"'s successor and remove "m" from the
- * object's cache.
- */
- if (m->right == NULL) {
- object->cache = m->left;
- m_next = NULL;
- } else {
- m_next = vm_page_splay(start, m->right);
- m_next->left = m->left;
- object->cache = m_next;
- }
- /* Convert "m" to a free page. */
+ while ((m = vm_radix_lookup_ge(&object->cache, start)) != NULL) {
+ if (end != 0 && m->pindex >= end)
+ break;
+ vm_radix_remove(&object->cache, m->pindex);
m->object = NULL;
m->valid = 0;
/* Clear PG_CACHED and set PG_FREE. */
@@ -1174,7 +1035,7 @@ vm_page_cache_free(vm_object_t object, vm_pindex_t start, vm_pindex_t end)
cnt.v_cache_count--;
cnt.v_free_count++;
}
- empty = vm_object_cache_is_empty(object);
+ empty = vm_radix_is_empty(&object->cache);
mtx_unlock(&vm_page_queue_free_mtx);
if (object->type == OBJT_VNODE && empty)
vdrop(object->handle);
@@ -1189,15 +1050,9 @@ vm_page_cache_free(vm_object_t object, vm_pindex_t start, vm_pindex_t end)
static inline vm_page_t
vm_page_cache_lookup(vm_object_t object, vm_pindex_t pindex)
{
- vm_page_t m;
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
- if ((m = object->cache) != NULL && m->pindex != pindex) {
- m = vm_page_splay(pindex, m);
- if ((object->cache = m)->pindex != pindex)
- m = NULL;
- }
- return (m);
+ return (vm_radix_lookup(&object->cache, pindex));
}
/*
@@ -1209,28 +1064,11 @@ vm_page_cache_lookup(vm_object_t object, vm_pindex_t pindex)
static void
vm_page_cache_remove(vm_page_t m)
{
- vm_object_t object;
- vm_page_t root;
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
KASSERT((m->flags & PG_CACHED) != 0,
("vm_page_cache_remove: page %p is not cached", m));
- object = m->object;
- if (m != object->cache) {
- root = vm_page_splay(m->pindex, object->cache);
- KASSERT(root == m,
- ("vm_page_cache_remove: page %p is not cached in object %p",
- m, object));
- }
- if (m->left == NULL)
- root = m->right;
- else if (m->right == NULL)
- root = m->left;
- else {
- root = vm_page_splay(m->pindex, m->left);
- root->right = m->right;
- }
- object->cache = root;
+ vm_radix_remove(&m->object->cache, m->pindex);
m->object = NULL;
cnt.v_cache_count--;
}
@@ -1250,7 +1088,7 @@ void
vm_page_cache_transfer(vm_object_t orig_object, vm_pindex_t offidxstart,
vm_object_t new_object)
{
- vm_page_t m, m_next;
+ vm_page_t m;
/*
* Insertion into an object's collection of cached pages
@@ -1258,53 +1096,24 @@ vm_page_cache_transfer(vm_object_t orig_object, vm_pindex_t offidxstart,
* not.
*/
VM_OBJECT_ASSERT_WLOCKED(new_object);
- KASSERT(vm_object_cache_is_empty(new_object),
+ KASSERT(vm_radix_is_empty(&new_object->cache),
("vm_page_cache_transfer: object %p has cached pages",
new_object));
mtx_lock(&vm_page_queue_free_mtx);
- if ((m = orig_object->cache) != NULL) {
+ while ((m = vm_radix_lookup_ge(&orig_object->cache,
+ offidxstart)) != NULL) {
/*
* Transfer all of the pages with offset greater than or
* equal to 'offidxstart' from the original object's
* cache to the new object's cache.
*/
- m = vm_page_splay(offidxstart, m);
- if (m->pindex < offidxstart) {
- orig_object->cache = m;
- new_object->cache = m->right;
- m->right = NULL;
- } else {
- orig_object->cache = m->left;
- new_object->cache = m;
- m->left = NULL;
- }
- while ((m = new_object->cache) != NULL) {
- if ((m->pindex - offidxstart) >= new_object->size) {
- /*
- * Return all of the cached pages with
- * offset greater than or equal to the
- * new object's size to the original
- * object's cache.
- */
- new_object->cache = m->left;
- m->left = orig_object->cache;
- orig_object->cache = m;
- break;
- }
- m_next = vm_page_splay(m->pindex, m->right);
- /* Update the page's object and offset. */
- m->object = new_object;
- m->pindex -= offidxstart;
- if (m_next == NULL)
- break;
- m->right = NULL;
- m_next->left = m;
- new_object->cache = m_next;
- }
- KASSERT(vm_object_cache_is_empty(new_object) ||
- new_object->type == OBJT_SWAP,
- ("vm_page_cache_transfer: object %p's type is incompatible"
- " with cached pages", new_object));
+ if ((m->pindex - offidxstart) >= new_object->size)
+ break;
+ vm_radix_remove(&orig_object->cache, m->pindex);
+ /* Update the page's object and offset. */
+ m->object = new_object;
+ m->pindex -= offidxstart;
+ vm_radix_insert(&new_object->cache, m);
}
mtx_unlock(&vm_page_queue_free_mtx);
}
@@ -2324,7 +2133,7 @@ void
vm_page_cache(vm_page_t m)
{
vm_object_t object;
- vm_page_t next, prev, root;
+ boolean_t cache_was_empty;
vm_page_lock_assert(m, MA_OWNED);
object = m->object;
@@ -2359,42 +2168,7 @@ vm_page_cache(vm_page_t m)
* Remove the page from the object's collection of resident
* pages.
*/
- if ((next = TAILQ_NEXT(m, listq)) != NULL && next->left == m) {
- /*
- * Since the page's successor in the list is also its parent
- * in the tree, its right subtree must be empty.
- */
- next->left = m->left;
- KASSERT(m->right == NULL,
- ("vm_page_cache: page %p has right child", m));
- } else if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL &&
- prev->right == m) {
- /*
- * Since the page's predecessor in the list is also its parent
- * in the tree, its left subtree must be empty.
- */
- KASSERT(m->left == NULL,
- ("vm_page_cache: page %p has left child", m));
- prev->right = m->right;
- } else {
- if (m != object->root)
- vm_page_splay(m->pindex, object->root);
- if (m->left == NULL)
- root = m->right;
- else if (m->right == NULL)
- root = m->left;
- else {
- /*
- * Move the page's successor to the root, because
- * pages are usually removed in ascending order.
- */
- if (m->right != next)
- vm_page_splay(m->pindex, m->right);
- next->left = m->left;
- root = next;
- }
- object->root = root;
- }
+ vm_radix_remove(&object->rtree, m->pindex);
TAILQ_REMOVE(&object->memq, m, listq);
object->resident_page_count--;
@@ -2412,25 +2186,8 @@ vm_page_cache(vm_page_t m)
mtx_lock(&vm_page_queue_free_mtx);
m->flags |= PG_CACHED;
cnt.v_cache_count++;
- root = object->cache;
- if (root == NULL) {
- m->left = NULL;
- m->right = NULL;
- } else {
- root = vm_page_splay(m->pindex, root);
- if (m->pindex < root->pindex) {
- m->left = root->left;
- m->right = root;
- root->left = NULL;
- } else if (__predict_false(m->pindex == root->pindex))
- panic("vm_page_cache: offset already cached");
- else {
- m->right = root->right;
- m->left = root;
- root->right = NULL;
- }
- }
- object->cache = m;
+ cache_was_empty = vm_radix_is_empty(&object->cache);
+ vm_radix_insert(&object->cache, m);
#if VM_NRESERVLEVEL > 0
if (!vm_reserv_free_page(m)) {
#else
@@ -2448,9 +2205,9 @@ vm_page_cache(vm_page_t m)
* the object's only resident page.
*/
if (object->type == OBJT_VNODE) {
- if (root == NULL && object->resident_page_count != 0)
+ if (cache_was_empty && object->resident_page_count != 0)
vhold(object->handle);
- else if (root != NULL && object->resident_page_count == 0)
+ else if (!cache_was_empty && object->resident_page_count == 0)
vdrop(object->handle);
}
}
@@ -2898,10 +2655,7 @@ vm_page_is_valid(vm_page_t m, int base, int size)
VM_OBJECT_ASSERT_WLOCKED(m->object);
bits = vm_page_bits(base, size);
- if (m->valid && ((m->valid & bits) == bits))
- return 1;
- else
- return 0;
+ return (m->valid != 0 && (m->valid & bits) == bits);
}
/*
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 7a3f138..d2393dc 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -128,8 +128,6 @@ typedef uint64_t vm_page_bits_t;
struct vm_page {
TAILQ_ENTRY(vm_page) pageq; /* page queue or free list (Q) */
TAILQ_ENTRY(vm_page) listq; /* pages in same object (O) */
- struct vm_page *left; /* splay tree link (O) */
- struct vm_page *right; /* splay tree link (O) */
vm_object_t object; /* which object am I in (O,P)*/
vm_pindex_t pindex; /* offset into object (O,P) */
@@ -404,7 +402,6 @@ void vm_page_requeue(vm_page_t m);
void vm_page_requeue_locked(vm_page_t m);
void vm_page_set_valid_range(vm_page_t m, int base, int size);
void vm_page_sleep(vm_page_t m, const char *msg);
-vm_page_t vm_page_splay(vm_pindex_t, vm_page_t);
vm_offset_t vm_page_startup(vm_offset_t vaddr);
void vm_page_unhold_pages(vm_page_t *ma, int count);
void vm_page_unwire (vm_page_t, int);
diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c
new file mode 100644
index 0000000..3909b91
--- /dev/null
+++ b/sys/vm/vm_radix.c
@@ -0,0 +1,777 @@
+/*
+ * Copyright (c) 2013 EMC Corp.
+ * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
+ * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+/*
+ * Path-compressed radix trie implementation.
+ * The following code is not generalized into a general purpose library
+ * because there are way too many parameters embedded that should really
+ * be decided by the library consumers. At the same time, consumers
+ * of this code must achieve highest possible performance.
+ *
+ * The implementation takes into account the following rationale:
+ * - Size of the nodes should be as small as possible but still big enough
+ * to avoid a large maximum depth for the trie. This is a balance
+ * between the necessity to not wire too much physical memory for the nodes
+ * and the necessity to avoid too much cache pollution during the trie
+ * operations.
+ * - There is not a huge bias toward the number of lookup operations over
+ * the number of insert and remove operations. This basically implies
+ * that optimizations supposedly helping one operation but hurting the
+ * other might be carefully evaluated.
+ * - On average not many nodes are expected to be fully populated, hence
+ * level compression may just complicate things.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include "opt_ddb.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/vmmeter.h>
+
+#include <vm/uma.h>
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/vm_page.h>
+#include <vm/vm_radix.h>
+
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif
+
+/*
+ * These widths should allow the pointers to a node's children to fit within
+ * a single cache line. The extra levels from a narrow width should not be
+ * a problem thanks to path compression.
+ */
+#ifdef __LP64__
+#define VM_RADIX_WIDTH 4
+#else
+#define VM_RADIX_WIDTH 3
+#endif
+
+#define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH)
+#define VM_RADIX_MASK (VM_RADIX_COUNT - 1)
+#define VM_RADIX_LIMIT \
+ (howmany((sizeof(vm_pindex_t) * NBBY), VM_RADIX_WIDTH) - 1)
+
+/* Flag bits stored in node pointers. */
+#define VM_RADIX_ISLEAF 0x1
+#define VM_RADIX_FLAGS 0x1
+#define VM_RADIX_PAD VM_RADIX_FLAGS
+
+/* Returns one unit associated with specified level. */
+#define VM_RADIX_UNITLEVEL(lev) \
+ ((vm_pindex_t)1 << ((VM_RADIX_LIMIT - (lev)) * VM_RADIX_WIDTH))
+
+struct vm_radix_node {
+ void *rn_child[VM_RADIX_COUNT]; /* Child nodes. */
+ vm_pindex_t rn_owner; /* Owner of record. */
+ uint16_t rn_count; /* Valid children. */
+ uint16_t rn_clev; /* Current level. */
+};
+
+static uma_zone_t vm_radix_node_zone;
+
+/*
+ * Allocate a radix node. Pre-allocation should ensure that the request
+ * will always be satisfied.
+ */
+static __inline struct vm_radix_node *
+vm_radix_node_get(vm_pindex_t owner, uint16_t count, uint16_t clevel)
+{
+ struct vm_radix_node *rnode;
+
+ rnode = uma_zalloc(vm_radix_node_zone, M_NOWAIT);
+
+ /*
+ * The required number of nodes should already be pre-allocated
+ * by vm_radix_prealloc(). However, UMA can hold a few nodes
+ * in per-CPU buckets, which will not be accessible by the
+ * current CPU. Thus, the allocation could return NULL when
+ * the pre-allocated pool is close to exhaustion. Anyway,
+ * in practice this should never occur because a new node
+ * is not always required for insert. Thus, the pre-allocated
+ * pool should have some extra pages that prevent this from
+ * becoming a problem.
+ */
+ if (rnode == NULL)
+ panic("%s: uma_zalloc() returned NULL for a new node",
+ __func__);
+ rnode->rn_owner = owner;
+ rnode->rn_count = count;
+ rnode->rn_clev = clevel;
+ return (rnode);
+}
+
+/*
+ * Free radix node.
+ */
+static __inline void
+vm_radix_node_put(struct vm_radix_node *rnode)
+{
+
+ uma_zfree(vm_radix_node_zone, rnode);
+}
+
+/*
+ * Return the position in the array for a given level.
+ */
+static __inline int
+vm_radix_slot(vm_pindex_t index, uint16_t level)
+{
+
+ return ((index >> ((VM_RADIX_LIMIT - level) * VM_RADIX_WIDTH)) &
+ VM_RADIX_MASK);
+}
+
+/* Trims the key after the specified level. */
+static __inline vm_pindex_t
+vm_radix_trimkey(vm_pindex_t index, uint16_t level)
+{
+ vm_pindex_t ret;
+
+ ret = index;
+ if (level < VM_RADIX_LIMIT) {
+ ret >>= (VM_RADIX_LIMIT - level) * VM_RADIX_WIDTH;
+ ret <<= (VM_RADIX_LIMIT - level) * VM_RADIX_WIDTH;
+ }
+ return (ret);
+}
+
+/*
+ * Get the root node for a radix tree.
+ */
+static __inline struct vm_radix_node *
+vm_radix_getroot(struct vm_radix *rtree)
+{
+
+ return ((struct vm_radix_node *)(rtree->rt_root & ~VM_RADIX_FLAGS));
+}
+
+/*
+ * Set the root node for a radix tree.
+ */
+static __inline void
+vm_radix_setroot(struct vm_radix *rtree, struct vm_radix_node *rnode)
+{
+
+ rtree->rt_root = (uintptr_t)rnode;
+}
+
+/*
+ * Returns the associated page extracted from rnode if available,
+ * and NULL otherwise.
+ */
+static __inline vm_page_t
+vm_radix_node_page(struct vm_radix_node *rnode)
+{
+
+ return ((((uintptr_t)rnode & VM_RADIX_ISLEAF) != 0) ?
+ (vm_page_t)((uintptr_t)rnode & ~VM_RADIX_FLAGS) : NULL);
+}
+
+/*
+ * Adds the page as a child of the provided node.
+ */
+static __inline void
+vm_radix_addpage(struct vm_radix_node *rnode, vm_pindex_t index, uint16_t clev,
+ vm_page_t page)
+{
+ int slot;
+
+ slot = vm_radix_slot(index, clev);
+ rnode->rn_child[slot] = (void *)((uintptr_t)page | VM_RADIX_ISLEAF);
+}
+
+/*
+ * Returns the slot where two keys differ.
+ * It cannot accept 2 equal keys.
+ */
+static __inline uint16_t
+vm_radix_keydiff(vm_pindex_t index1, vm_pindex_t index2)
+{
+ uint16_t clev;
+
+ KASSERT(index1 != index2, ("%s: passing the same key value %jx",
+ __func__, (uintmax_t)index1));
+
+ index1 ^= index2;
+ for (clev = 0; clev <= VM_RADIX_LIMIT ; clev++)
+ if (vm_radix_slot(index1, clev))
+ return (clev);
+ panic("%s: cannot reach this point", __func__);
+ return (0);
+}
+
+/*
+ * Returns TRUE if it can be determined that key does not belong to the
+ * specified rnode. Otherwise, returns FALSE.
+ */
+static __inline boolean_t
+vm_radix_keybarr(struct vm_radix_node *rnode, vm_pindex_t idx)
+{
+
+ if (rnode->rn_clev > 0) {
+ idx = vm_radix_trimkey(idx, rnode->rn_clev - 1);
+ idx -= rnode->rn_owner;
+ if (idx != 0)
+ return (TRUE);
+ }
+ return (FALSE);
+}
+
+/*
+ * Adjusts the idx key to the first upper level available, based on a valid
+ * initial level and map of available levels.
+ * Returns a value bigger than 0 to signal that there are not valid levels
+ * available.
+ */
+static __inline int
+vm_radix_addlev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev)
+{
+ vm_pindex_t wrapidx;
+
+ for (; levels[ilev] == FALSE ||
+ vm_radix_slot(*idx, ilev) == (VM_RADIX_COUNT - 1); ilev--)
+ if (ilev == 0)
+ break;
+ KASSERT(ilev > 0 || levels[0],
+ ("%s: levels back-scanning problem", __func__));
+ if (ilev == 0 && vm_radix_slot(*idx, ilev) == (VM_RADIX_COUNT - 1))
+ return (1);
+ wrapidx = *idx;
+ *idx = vm_radix_trimkey(*idx, ilev);
+ *idx += VM_RADIX_UNITLEVEL(ilev);
+ return (*idx < wrapidx);
+}
+
+/*
+ * Adjusts the idx key to the first lower level available, based on a valid
+ * initial level and map of available levels.
+ * Returns a value bigger than 0 to signal that there are not valid levels
+ * available.
+ */
+static __inline int
+vm_radix_declev(vm_pindex_t *idx, boolean_t *levels, uint16_t ilev)
+{
+ vm_pindex_t wrapidx;
+
+ for (; levels[ilev] == FALSE ||
+ vm_radix_slot(*idx, ilev) == 0; ilev--)
+ if (ilev == 0)
+ break;
+ KASSERT(ilev > 0 || levels[0],
+ ("%s: levels back-scanning problem", __func__));
+ if (ilev == 0 && vm_radix_slot(*idx, ilev) == 0)
+ return (1);
+ wrapidx = *idx;
+ *idx = vm_radix_trimkey(*idx, ilev);
+ *idx |= VM_RADIX_UNITLEVEL(ilev) - 1;
+ *idx -= VM_RADIX_UNITLEVEL(ilev);
+ return (*idx > wrapidx);
+}
+
+/*
+ * Internal helper for vm_radix_reclaim_allnodes().
+ * This function is recursive.
+ */
+static void
+vm_radix_reclaim_allnodes_int(struct vm_radix_node *rnode)
+{
+ int slot;
+
+ for (slot = 0; slot < VM_RADIX_COUNT && rnode->rn_count != 0; slot++) {
+ if (rnode->rn_child[slot] == NULL)
+ continue;
+ if (vm_radix_node_page(rnode->rn_child[slot]) == NULL)
+ vm_radix_reclaim_allnodes_int(rnode->rn_child[slot]);
+ rnode->rn_child[slot] = NULL;
+ rnode->rn_count--;
+ }
+ vm_radix_node_put(rnode);
+}
+
+#ifdef INVARIANTS
+/*
+ * Radix node zone destructor.
+ */
+static void
+vm_radix_node_zone_dtor(void *mem, int size __unused, void *arg __unused)
+{
+ struct vm_radix_node *rnode;
+ int slot;
+
+ rnode = mem;
+ KASSERT(rnode->rn_count == 0,
+ ("vm_radix_node_put: rnode %p has %d children", rnode,
+ rnode->rn_count));
+ for (slot = 0; slot < VM_RADIX_COUNT; slot++)
+ KASSERT(rnode->rn_child[slot] == NULL,
+ ("vm_radix_node_put: rnode %p has a child", rnode));
+}
+#endif
+
+/*
+ * Radix node zone initializer.
+ */
+static int
+vm_radix_node_zone_init(void *mem, int size __unused, int flags __unused)
+{
+ struct vm_radix_node *rnode;
+
+ rnode = mem;
+ memset(rnode->rn_child, 0, sizeof(rnode->rn_child));
+ return (0);
+}
+
+/*
+ * Pre-allocate intermediate nodes from the UMA slab zone.
+ */
+static void
+vm_radix_prealloc(void *arg __unused)
+{
+
+ if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count))
+ panic("%s: unable to create new zone", __func__);
+ uma_prealloc(vm_radix_node_zone, cnt.v_page_count);
+}
+SYSINIT(vm_radix_prealloc, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_prealloc,
+ NULL);
+
+/*
+ * Initialize the UMA slab zone.
+ * Until vm_radix_prealloc() is called, the zone will be served by the
+ * UMA boot-time pre-allocated pool of pages.
+ */
+void
+vm_radix_init(void)
+{
+
+ vm_radix_node_zone = uma_zcreate("RADIX NODE",
+ sizeof(struct vm_radix_node), NULL,
+#ifdef INVARIANTS
+ vm_radix_node_zone_dtor,
+#else
+ NULL,
+#endif
+ vm_radix_node_zone_init, NULL, VM_RADIX_PAD, UMA_ZONE_VM |
+ UMA_ZONE_NOFREE);
+}
+
+/*
+ * Inserts the key-value pair into the trie.
+ * Panics if the key already exists.
+ */
+void
+vm_radix_insert(struct vm_radix *rtree, vm_page_t page)
+{
+ vm_pindex_t index, newind;
+ struct vm_radix_node *rnode, *tmp, *tmp2;
+ vm_page_t m;
+ int slot;
+ uint16_t clev;
+
+ index = page->pindex;
+
+ /*
+ * The owner of record for root is not really important because it
+ * will never be used.
+ */
+ rnode = vm_radix_getroot(rtree);
+ if (rnode == NULL) {
+ rnode = vm_radix_node_get(0, 1, 0);
+ vm_radix_setroot(rtree, rnode);
+ vm_radix_addpage(rnode, index, 0, page);
+ return;
+ }
+ while (rnode != NULL) {
+ if (vm_radix_keybarr(rnode, index))
+ break;
+ slot = vm_radix_slot(index, rnode->rn_clev);
+ m = vm_radix_node_page(rnode->rn_child[slot]);
+ if (m != NULL) {
+ if (m->pindex == index)
+ panic("%s: key %jx is already present",
+ __func__, (uintmax_t)index);
+ clev = vm_radix_keydiff(m->pindex, index);
+ tmp = vm_radix_node_get(vm_radix_trimkey(index,
+ clev - 1), 2, clev);
+ rnode->rn_child[slot] = tmp;
+ vm_radix_addpage(tmp, index, clev, page);
+ vm_radix_addpage(tmp, m->pindex, clev, m);
+ return;
+ }
+ if (rnode->rn_child[slot] == NULL) {
+ rnode->rn_count++;
+ vm_radix_addpage(rnode, index, rnode->rn_clev, page);
+ return;
+ }
+ rnode = rnode->rn_child[slot];
+ }
+ if (rnode == NULL)
+ panic("%s: path traversal ended unexpectedly", __func__);
+
+ /*
+ * Scan the trie from the top and find the parent to insert
+ * the new object.
+ */
+ newind = rnode->rn_owner;
+ clev = vm_radix_keydiff(newind, index);
+ slot = VM_RADIX_COUNT;
+ for (rnode = vm_radix_getroot(rtree); ; rnode = tmp) {
+ KASSERT(rnode != NULL, ("%s: edge cannot be NULL in the scan",
+ __func__));
+ KASSERT(clev >= rnode->rn_clev,
+ ("%s: unexpected trie depth: clev: %d, rnode->rn_clev: %d",
+ __func__, clev, rnode->rn_clev));
+ slot = vm_radix_slot(index, rnode->rn_clev);
+ tmp = rnode->rn_child[slot];
+ KASSERT(tmp != NULL && vm_radix_node_page(tmp) == NULL,
+ ("%s: unexpected lookup interruption", __func__));
+ if (tmp->rn_clev > clev)
+ break;
+ }
+ KASSERT(rnode != NULL && tmp != NULL && slot < VM_RADIX_COUNT,
+ ("%s: invalid scan parameters rnode: %p, tmp: %p, slot: %d",
+ __func__, (void *)rnode, (void *)tmp, slot));
+
+ /*
+ * A new node is needed because the right insertion level is reached.
+ * Setup the new intermediate node and add the 2 children: the
+ * new object and the older edge.
+ */
+ tmp2 = vm_radix_node_get(vm_radix_trimkey(index, clev - 1), 2,
+ clev);
+ rnode->rn_child[slot] = tmp2;
+ vm_radix_addpage(tmp2, index, clev, page);
+ slot = vm_radix_slot(newind, clev);
+ tmp2->rn_child[slot] = tmp;
+}
+
+/*
+ * Returns the value stored at the index. If the index is not present,
+ * NULL is returned.
+ */
+vm_page_t
+vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index)
+{
+ struct vm_radix_node *rnode;
+ vm_page_t m;
+ int slot;
+
+ rnode = vm_radix_getroot(rtree);
+ while (rnode != NULL) {
+ if (vm_radix_keybarr(rnode, index))
+ return (NULL);
+ slot = vm_radix_slot(index, rnode->rn_clev);
+ rnode = rnode->rn_child[slot];
+ m = vm_radix_node_page(rnode);
+ if (m != NULL) {
+ if (m->pindex == index)
+ return (m);
+ else
+ return (NULL);
+ }
+ }
+ return (NULL);
+}
+
+/*
+ * Look up the nearest entry at a position bigger than or equal to index.
+ */
+vm_page_t
+vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index)
+{
+ vm_pindex_t inc;
+ vm_page_t m;
+ struct vm_radix_node *rnode;
+ int slot;
+ uint16_t difflev;
+ boolean_t maplevels[VM_RADIX_LIMIT + 1];
+#ifdef INVARIANTS
+ int loops = 0;
+#endif
+
+restart:
+ KASSERT(++loops < 1000, ("%s: too many loops", __func__));
+ for (difflev = 0; difflev < (VM_RADIX_LIMIT + 1); difflev++)
+ maplevels[difflev] = FALSE;
+ rnode = vm_radix_getroot(rtree);
+ while (rnode != NULL) {
+ maplevels[rnode->rn_clev] = TRUE;
+
+ /*
+ * If the keys differ before the current bisection node
+ * the search key might rollback to the earliest
+ * available bisection node, or to the smaller value
+ * in the current domain (if the owner is bigger than the
+ * search key).
+ * The maplevels array records any node has been seen
+ * at a given level. This aids the search for a valid
+ * bisection node.
+ */
+ if (vm_radix_keybarr(rnode, index)) {
+ difflev = vm_radix_keydiff(index, rnode->rn_owner);
+ if (index > rnode->rn_owner) {
+ if (vm_radix_addlev(&index, maplevels,
+ difflev) > 0)
+ break;
+ } else
+ index = vm_radix_trimkey(rnode->rn_owner,
+ difflev);
+ goto restart;
+ }
+ slot = vm_radix_slot(index, rnode->rn_clev);
+ m = vm_radix_node_page(rnode->rn_child[slot]);
+ if (m != NULL && m->pindex >= index)
+ return (m);
+ if (rnode->rn_child[slot] != NULL && m == NULL) {
+ rnode = rnode->rn_child[slot];
+ continue;
+ }
+
+ /*
+ * Look for an available edge or page within the current
+ * bisection node.
+ */
+ if (slot < (VM_RADIX_COUNT - 1)) {
+ inc = VM_RADIX_UNITLEVEL(rnode->rn_clev);
+ index = vm_radix_trimkey(index, rnode->rn_clev);
+ index += inc;
+ slot++;
+ for (;; index += inc, slot++) {
+ m = vm_radix_node_page(rnode->rn_child[slot]);
+ if (m != NULL && m->pindex >= index)
+ return (m);
+ if ((rnode->rn_child[slot] != NULL &&
+ m == NULL) || slot == (VM_RADIX_COUNT - 1))
+ break;
+ }
+ }
+
+ /*
+ * If a valid page or edge bigger than the search slot is
+ * found in the traversal, skip to the next higher-level key.
+ */
+ if (slot == (VM_RADIX_COUNT - 1) &&
+ (rnode->rn_child[slot] == NULL || m != NULL)) {
+ if (rnode->rn_clev == 0 || vm_radix_addlev(&index,
+ maplevels, rnode->rn_clev - 1) > 0)
+ break;
+ goto restart;
+ }
+ rnode = rnode->rn_child[slot];
+ }
+ return (NULL);
+}
+
+/*
+ * Look up the nearest entry at a position less than or equal to index.
+ */
+vm_page_t
+vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index)
+{
+ vm_pindex_t inc;
+ vm_page_t m;
+ struct vm_radix_node *rnode;
+ int slot;
+ uint16_t difflev;
+ boolean_t maplevels[VM_RADIX_LIMIT + 1];
+#ifdef INVARIANTS
+ int loops = 0;
+#endif
+
+restart:
+ KASSERT(++loops < 1000, ("%s: too many loops", __func__));
+ for (difflev = 0; difflev < (VM_RADIX_LIMIT + 1); difflev++)
+ maplevels[difflev] = FALSE;
+ rnode = vm_radix_getroot(rtree);
+ while (rnode != NULL) {
+ maplevels[rnode->rn_clev] = TRUE;
+
+ /*
+ * If the keys differ before the current bisection node
+ * the search key might rollback to the earliest
+ * available bisection node, or to the higher value
+ * in the current domain (if the owner is smaller than the
+ * search key).
+ * The maplevels array records any node has been seen
+ * at a given level. This aids the search for a valid
+ * bisection node.
+ */
+ if (vm_radix_keybarr(rnode, index)) {
+ difflev = vm_radix_keydiff(index, rnode->rn_owner);
+ if (index > rnode->rn_owner) {
+ index = vm_radix_trimkey(rnode->rn_owner,
+ difflev);
+ index |= VM_RADIX_UNITLEVEL(difflev) - 1;
+ } else if (vm_radix_declev(&index, maplevels,
+ difflev) > 0)
+ break;
+ goto restart;
+ }
+ slot = vm_radix_slot(index, rnode->rn_clev);
+ m = vm_radix_node_page(rnode->rn_child[slot]);
+ if (m != NULL && m->pindex <= index)
+ return (m);
+ if (rnode->rn_child[slot] != NULL && m == NULL) {
+ rnode = rnode->rn_child[slot];
+ continue;
+ }
+
+ /*
+ * Look for an available edge or page within the current
+ * bisection node.
+ */
+ if (slot > 0) {
+ inc = VM_RADIX_UNITLEVEL(rnode->rn_clev);
+ index = vm_radix_trimkey(index, rnode->rn_clev);
+ index |= inc - 1;
+ index -= inc;
+ slot--;
+ for (;; index -= inc, slot--) {
+ m = vm_radix_node_page(rnode->rn_child[slot]);
+ if (m != NULL && m->pindex <= index)
+ return (m);
+ if ((rnode->rn_child[slot] != NULL &&
+ m == NULL) || slot == 0)
+ break;
+ }
+ }
+
+ /*
+ * If a valid page or edge smaller than the search slot is
+ * found in the traversal, skip to the next higher-level key.
+ */
+ if (slot == 0 && (rnode->rn_child[slot] == NULL || m != NULL)) {
+ if (rnode->rn_clev == 0 || vm_radix_declev(&index,
+ maplevels, rnode->rn_clev - 1) > 0)
+ break;
+ goto restart;
+ }
+ rnode = rnode->rn_child[slot];
+ }
+ return (NULL);
+}
+
+/*
+ * Remove the specified index from the tree.
+ * Panics if the key is not present.
+ */
+void
+vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index)
+{
+ struct vm_radix_node *rnode, *parent;
+ vm_page_t m;
+ int i, slot;
+
+ parent = NULL;
+ rnode = vm_radix_getroot(rtree);
+ for (;;) {
+ if (rnode == NULL)
+ panic("vm_radix_remove: impossible to locate the key");
+ slot = vm_radix_slot(index, rnode->rn_clev);
+ m = vm_radix_node_page(rnode->rn_child[slot]);
+ if (m != NULL && m->pindex == index) {
+ rnode->rn_child[slot] = NULL;
+ rnode->rn_count--;
+ if (rnode->rn_count > 1)
+ break;
+ if (parent == NULL) {
+ if (rnode->rn_count == 0) {
+ vm_radix_node_put(rnode);
+ vm_radix_setroot(rtree, NULL);
+ }
+ break;
+ }
+ for (i = 0; i < VM_RADIX_COUNT; i++)
+ if (rnode->rn_child[i] != NULL)
+ break;
+ KASSERT(i != VM_RADIX_COUNT,
+ ("%s: invalid node configuration", __func__));
+ slot = vm_radix_slot(index, parent->rn_clev);
+ KASSERT(parent->rn_child[slot] == rnode,
+ ("%s: invalid child value", __func__));
+ parent->rn_child[slot] = rnode->rn_child[i];
+ rnode->rn_count--;
+ rnode->rn_child[i] = NULL;
+ vm_radix_node_put(rnode);
+ break;
+ }
+ if (m != NULL && m->pindex != index)
+ panic("%s: invalid key found", __func__);
+ parent = rnode;
+ rnode = rnode->rn_child[slot];
+ }
+}
+
+/*
+ * Remove and free all the nodes from the radix tree.
+ * This function is recursive but there is a tight control on it as the
+ * maximum depth of the tree is fixed.
+ */
+void
+vm_radix_reclaim_allnodes(struct vm_radix *rtree)
+{
+ struct vm_radix_node *root;
+
+ root = vm_radix_getroot(rtree);
+ if (root == NULL)
+ return;
+ vm_radix_reclaim_allnodes_int(root);
+ vm_radix_setroot(rtree, NULL);
+}
+
+#ifdef DDB
+/*
+ * Show details about the given radix node.
+ */
+DB_SHOW_COMMAND(radixnode, db_show_radixnode)
+{
+ struct vm_radix_node *rnode;
+ int i;
+
+ if (!have_addr)
+ return;
+ rnode = (struct vm_radix_node *)addr;
+ db_printf("radixnode %p, owner %jx, children count %u, level %u:\n",
+ (void *)rnode, (uintmax_t)rnode->rn_owner, rnode->rn_count,
+ rnode->rn_clev);
+ for (i = 0; i < VM_RADIX_COUNT; i++)
+ if (rnode->rn_child[i] != NULL)
+ db_printf("slot: %d, val: %p, page: %p, clev: %d\n",
+ i, (void *)rnode->rn_child[i],
+ (void *)vm_radix_node_page(rnode->rn_child[i]),
+ rnode->rn_clev);
+}
+#endif /* DDB */
diff --git a/sys/netncp/ncp_rcfile.h b/sys/vm/vm_radix.h
index 926af4e..3414253 100644
--- a/sys/netncp/ncp_rcfile.h
+++ b/sys/vm/vm_radix.h
@@ -1,5 +1,7 @@
-/*-
- * Copyright (c) 1999 Boris Popov
+/*
+ * Copyright (c) 2013 EMC Corp.
+ * Copyright (c) 2011 Jeffrey Roberson <jeff@freebsd.org>
+ * Copyright (c) 2008 Mayur Shardul <mayur.shardul@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,38 +27,21 @@
*
* $FreeBSD$
*/
-#ifndef _NETNCP_NCP_RCFILE_H_
-#define _NETNCP_NCP_RCFILE_H_
-#include <sys/queue.h>
-struct rckey {
- SLIST_ENTRY(rckey) rk_next;
- char *rk_name;
- char *rk_value;
-};
+#ifndef _VM_RADIX_H_
+#define _VM_RADIX_H_
-struct rcsection {
- SLIST_ENTRY(rcsection) rs_next;
- SLIST_HEAD(rckey_head,rckey) rs_keys;
- char *rs_name;
-};
-
-struct rcfile {
- SLIST_ENTRY(rcfile) rf_next;
- SLIST_HEAD(rcsec_head, rcsection) rf_sect;
- char *rf_name;
- FILE *rf_f;
-};
+#include <vm/_vm_radix.h>
-__BEGIN_DECLS
+#ifdef _KERNEL
-int rc_open(char *, char *,struct rcfile **);
-int rc_close(struct rcfile *);
-int rc_getstringptr(struct rcfile *, char *, char *, char **);
-int rc_getstring(struct rcfile *, char *, char *, int, char *);
-int rc_getint(struct rcfile *, char *, char *, int *);
-int rc_getbool(struct rcfile *, char *, char *, int *);
+void vm_radix_init(void);
+void vm_radix_insert(struct vm_radix *rtree, vm_page_t page);
+vm_page_t vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index);
+vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index);
+vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index);
+void vm_radix_reclaim_allnodes(struct vm_radix *rtree);
+void vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index);
-__END_DECLS
-
-#endif /* _NETNCP_NCP_RCFILE_H_ */
+#endif /* _KERNEL */
+#endif /* !_VM_RADIX_H_ */
diff --git a/sys/vm/vm_reserv.c b/sys/vm/vm_reserv.c
index 98b0de2..4d36385 100644
--- a/sys/vm/vm_reserv.c
+++ b/sys/vm/vm_reserv.c
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_phys.h>
+#include <vm/vm_radix.h>
#include <vm/vm_reserv.h>
/*
@@ -342,33 +343,22 @@ vm_reserv_alloc_contig(vm_object_t object, vm_pindex_t pindex, u_long npages,
/*
* Look for an existing reservation.
*/
- msucc = NULL;
- mpred = object->root;
- while (mpred != NULL) {
- KASSERT(mpred->pindex != pindex,
+ mpred = vm_radix_lookup_le(&object->rtree, pindex);
+ if (mpred != NULL) {
+ KASSERT(mpred->pindex < pindex,
("vm_reserv_alloc_contig: pindex already allocated"));
rv = vm_reserv_from_page(mpred);
if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
goto found;
- else if (mpred->pindex < pindex) {
- if (msucc != NULL ||
- (msucc = TAILQ_NEXT(mpred, listq)) == NULL)
- break;
- KASSERT(msucc->pindex != pindex,
- ("vm_reserv_alloc_contig: pindex already allocated"));
- rv = vm_reserv_from_page(msucc);
- if (rv->object == object &&
- vm_reserv_has_pindex(rv, pindex))
- goto found;
- else if (pindex < msucc->pindex)
- break;
- } else if (msucc == NULL) {
- msucc = mpred;
- mpred = TAILQ_PREV(msucc, pglist, listq);
- continue;
- }
- msucc = NULL;
- mpred = object->root = vm_page_splay(pindex, object->root);
+ msucc = TAILQ_NEXT(mpred, listq);
+ } else
+ msucc = TAILQ_FIRST(&object->memq);
+ if (msucc != NULL) {
+ KASSERT(msucc->pindex > pindex,
+ ("vm_reserv_alloc_page: pindex already allocated"));
+ rv = vm_reserv_from_page(msucc);
+ if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
+ goto found;
}
/*
@@ -508,33 +498,22 @@ vm_reserv_alloc_page(vm_object_t object, vm_pindex_t pindex)
/*
* Look for an existing reservation.
*/
- msucc = NULL;
- mpred = object->root;
- while (mpred != NULL) {
- KASSERT(mpred->pindex != pindex,
+ mpred = vm_radix_lookup_le(&object->rtree, pindex);
+ if (mpred != NULL) {
+ KASSERT(mpred->pindex < pindex,
("vm_reserv_alloc_page: pindex already allocated"));
rv = vm_reserv_from_page(mpred);
if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
goto found;
- else if (mpred->pindex < pindex) {
- if (msucc != NULL ||
- (msucc = TAILQ_NEXT(mpred, listq)) == NULL)
- break;
- KASSERT(msucc->pindex != pindex,
- ("vm_reserv_alloc_page: pindex already allocated"));
- rv = vm_reserv_from_page(msucc);
- if (rv->object == object &&
- vm_reserv_has_pindex(rv, pindex))
- goto found;
- else if (pindex < msucc->pindex)
- break;
- } else if (msucc == NULL) {
- msucc = mpred;
- mpred = TAILQ_PREV(msucc, pglist, listq);
- continue;
- }
- msucc = NULL;
- mpred = object->root = vm_page_splay(pindex, object->root);
+ msucc = TAILQ_NEXT(mpred, listq);
+ } else
+ msucc = TAILQ_FIRST(&object->memq);
+ if (msucc != NULL) {
+ KASSERT(msucc->pindex > pindex,
+ ("vm_reserv_alloc_page: pindex already allocated"));
+ rv = vm_reserv_from_page(msucc);
+ if (rv->object == object && vm_reserv_has_pindex(rv, pindex))
+ goto found;
}
/*
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 5e331ee..a0340af 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -900,7 +900,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
}
bp = getpbuf(&vnode_pbuf_freecnt);
- kva = (vm_offset_t) bp->b_data;
+ kva = (vm_offset_t)bp->b_data;
/*
* and map the pages to be read into the kva
diff --git a/sys/xdr/xdr_mbuf.c b/sys/xdr/xdr_mbuf.c
index bcfdb18..690c2d2 100644
--- a/sys/xdr/xdr_mbuf.c
+++ b/sys/xdr/xdr_mbuf.c
@@ -123,7 +123,7 @@ xdrmbuf_getall(XDR *xdrs)
if (m)
m_adj(m, xdrs->x_handy);
else
- MGET(m, M_WAITOK, MT_DATA);
+ m = m_get(M_WAITOK, MT_DATA);
return (m);
}
@@ -228,9 +228,10 @@ xdrmbuf_putbytes(XDR *xdrs, const char *addr, u_int len)
if (xdrs->x_handy == m->m_len && M_TRAILINGSPACE(m) == 0) {
if (!m->m_next) {
- MGET(n, M_TRYWAIT, m->m_type);
if (m->m_flags & M_EXT)
- MCLGET(n, M_TRYWAIT);
+ n = m_getcl(M_WAITOK, m->m_type, 0);
+ else
+ n = m_get(M_WAITOK, m->m_type);
m->m_next = n;
}
m = m->m_next;
diff --git a/tools/regression/bin/sh/builtins/wait6.0 b/tools/regression/bin/sh/builtins/wait6.0
new file mode 100644
index 0000000..20e3c68
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/wait6.0
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+wait --
diff --git a/tools/regression/bin/sh/builtins/wait7.0 b/tools/regression/bin/sh/builtins/wait7.0
new file mode 100644
index 0000000..0fb092f
--- /dev/null
+++ b/tools/regression/bin/sh/builtins/wait7.0
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+: &
+wait -- $!
diff --git a/tools/regression/pjdfstest/tests/misc.sh b/tools/regression/pjdfstest/tests/misc.sh
index 0d3ce35..8978b5f 100644
--- a/tools/regression/pjdfstest/tests/misc.sh
+++ b/tools/regression/pjdfstest/tests/misc.sh
@@ -89,7 +89,7 @@ todo()
namegen()
{
- echo "pjdfstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5`"
+ echo "pjdfstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5 | awk '{print $NF}'`"
}
namegen_len()
@@ -98,7 +98,7 @@ namegen_len()
name=""
while :; do
- namepart="`dd if=/dev/urandom bs=64 count=1 2>/dev/null | openssl md5`"
+ namepart="`dd if=/dev/urandom bs=64 count=1 2>/dev/null | openssl md5 | awk '{print $NF}'`"
name="${name}${namepart}"
curlen=`printf "%s" "${name}" | wc -c`
[ ${curlen} -lt ${len} ] || break
diff --git a/tools/regression/security/cap_test/cap_test_capabilities.c b/tools/regression/security/cap_test/cap_test_capabilities.c
index b6423f8..9f5dde8 100644
--- a/tools/regression/security/cap_test/cap_test_capabilities.c
+++ b/tools/regression/security/cap_test/cap_test_capabilities.c
@@ -184,19 +184,19 @@ try_file_ops(int filefd, int dirfd, cap_rights_t rights)
MAP_SHARED, fd_cap, 0);
CHECK_MMAP_RESULT(CAP_MMAP_RWX);
- /* TODO: openat(O_APPEND) */
ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDONLY, 0600);
CHECK_RESULT(openat(O_CREATE | O_RDONLY),
CAP_CREATE | CAP_READ | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
- ret = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY, 0600);
- CHECK_RESULT(openat(O_CREATE | O_WRONLY),
+ ret = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY | O_APPEND,
+ 0600);
+ CHECK_RESULT(openat(O_CREATE | O_WRONLY | O_APPEND),
CAP_CREATE | CAP_WRITE | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
- ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR, 0600);
- CHECK_RESULT(openat(O_CREATE | O_RDWR),
+ ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR | O_APPEND, 0600);
+ CHECK_RESULT(openat(O_CREATE | O_RDWR | O_APPEND),
CAP_CREATE | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
@@ -207,28 +207,28 @@ try_file_ops(int filefd, int dirfd, cap_rights_t rights)
ret = openat(dirfd, "cap_fsync", O_CREAT, 0600);
CHECK(ret >= 0);
CHECK(close(ret) == 0);
- ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDONLY, 0600);
+ ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDONLY);
CHECK_RESULT(openat(O_FSYNC | O_RDONLY),
CAP_FSYNC | CAP_READ | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
- ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY, 0600);
- CHECK_RESULT(openat(O_FSYNC | O_WRONLY),
+ ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY | O_APPEND);
+ CHECK_RESULT(openat(O_FSYNC | O_WRONLY | O_APPEND),
CAP_FSYNC | CAP_WRITE | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
- ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR, 0600);
- CHECK_RESULT(openat(O_FSYNC | O_RDWR),
+ ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR | O_APPEND);
+ CHECK_RESULT(openat(O_FSYNC | O_RDWR | O_APPEND),
CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
- ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDONLY, 0600);
+ ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDONLY);
CHECK_RESULT(openat(O_SYNC | O_RDONLY),
CAP_FSYNC | CAP_READ | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
- ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY, 0600);
- CHECK_RESULT(openat(O_SYNC | O_WRONLY),
+ ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY | O_APPEND);
+ CHECK_RESULT(openat(O_SYNC | O_WRONLY | O_APPEND),
CAP_FSYNC | CAP_WRITE | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
- ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR, 0600);
- CHECK_RESULT(openat(O_SYNC | O_RDWR),
+ ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR | O_APPEND);
+ CHECK_RESULT(openat(O_SYNC | O_RDWR | O_APPEND),
CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_LOOKUP, ret >= 0);
CHECK(ret == -1 || close(ret) == 0);
CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0);
@@ -253,6 +253,39 @@ try_file_ops(int filefd, int dirfd, cap_rights_t rights)
CHECK(ret == -1 || close(ret) == 0);
CHECK(unlinkat(dirfd, "cap_ftruncate", 0) == 0);
+ ret = openat(dfd_cap, "cap_create", O_CREAT | O_WRONLY, 0600);
+ CHECK_RESULT(openat(O_CREATE | O_WRONLY),
+ CAP_CREATE | CAP_WRITE | CAP_SEEK | CAP_LOOKUP, ret >= 0);
+ CHECK(ret == -1 || close(ret) == 0);
+ CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
+ ret = openat(dfd_cap, "cap_create", O_CREAT | O_RDWR, 0600);
+ CHECK_RESULT(openat(O_CREATE | O_RDWR),
+ CAP_CREATE | CAP_READ | CAP_WRITE | CAP_SEEK | CAP_LOOKUP,
+ ret >= 0);
+ CHECK(ret == -1 || close(ret) == 0);
+ CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0);
+
+ ret = openat(dirfd, "cap_fsync", O_CREAT, 0600);
+ CHECK(ret >= 0);
+ CHECK(close(ret) == 0);
+ ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_WRONLY);
+ CHECK_RESULT(openat(O_FSYNC | O_WRONLY),
+ CAP_FSYNC | CAP_WRITE | CAP_SEEK | CAP_LOOKUP, ret >= 0);
+ CHECK(ret == -1 || close(ret) == 0);
+ ret = openat(dfd_cap, "cap_fsync", O_FSYNC | O_RDWR);
+ CHECK_RESULT(openat(O_FSYNC | O_RDWR),
+ CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_SEEK | CAP_LOOKUP, ret >= 0);
+ CHECK(ret == -1 || close(ret) == 0);
+ ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_WRONLY);
+ CHECK_RESULT(openat(O_SYNC | O_WRONLY),
+ CAP_FSYNC | CAP_WRITE | CAP_SEEK | CAP_LOOKUP, ret >= 0);
+ CHECK(ret == -1 || close(ret) == 0);
+ ret = openat(dfd_cap, "cap_fsync", O_SYNC | O_RDWR);
+ CHECK_RESULT(openat(O_SYNC | O_RDWR),
+ CAP_FSYNC | CAP_READ | CAP_WRITE | CAP_SEEK | CAP_LOOKUP, ret >= 0);
+ CHECK(ret == -1 || close(ret) == 0);
+ CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0);
+
/*
* Note: this is not expected to work over NFS.
*/
diff --git a/usr.bin/ee/nls/ru_RU.KOI8-R/ee.msg b/usr.bin/ee/nls/ru_RU.KOI8-R/ee.msg
index 9067d29..bfced0f 100644
--- a/usr.bin/ee/nls/ru_RU.KOI8-R/ee.msg
+++ b/usr.bin/ee/nls/ru_RU.KOI8-R/ee.msg
@@ -64,7 +64,7 @@ $quote "
52 "line : ÐÏËÁÚÁÔØ ÎÏÍÅÒ ÓÔÒÏËÉ 0-9 : ÐÅÒÅÊÔÉ Ë ÓÔÒÏËÅ N "
53 "expand : ÚÁÍÅÎÑÔØ ÔÁÂÕÌÑÃÉÀ ÐÒÏÂÅÌÁÍÉ noexpand: ÎÅ ÚÁÍÅÎÑÔØ ÔÁÂÕÌÑÃÉÀ "
54 " "
-55 " ee [+#] [-i] [-e] [-h] [ÆÁÊÌÙ(Ù)] "
+55 " ee [+#] [-i] [-e] [-h] [ÆÁÊÌ(Ù)] "
56 "+# :Ë ÓÔÒÏËÅ N -i :ÂÅÚ ÉÎÆÏ-ÏËÎÁ -e :ÎÅ ÚÁÍÅÎÑÔØ ÔÁÂÙ -h :ÂÅÚ ×ÙÄÅÌÅÎÉÑ ÒÁÍÏË "
57 "^[ (Esc) ÍÅÎÀ ^e ÐÏÉÓË ^y ÕÄÁÌÉÔØ ÓÔÒÏËÕ ^u ××ÅÒÈ ^p ÐÒÅÄ. ÓÔÒ. "
58 "^a ascii-ËÏÄ ^x ÐÏ×ÔÏÒ ÐÏÉÓËÁ ^z ×ÅÒÎÕÔØ ÓÔÒÏËÕ ^d ×ÎÉÚ ^n ÓÌÅÄ. ÓÔÒ. "
@@ -154,7 +154,7 @@ $quote "
142 "NOHIGHLIGHT"
143 "EIGHTBIT"
144 "NOEIGHTBIT"
-145 "ËÌÁ×ÉÛÙ ËÁË × Emacs "
+145 "ËÌÁ×ÉÛÉ ËÁË × Emacs "
146 "^a × ÎÁÞÁÌÏ ÓÔÒÏËÉ ^i ÔÁÂÕÌÑÃÉÑ ^r ×ÅÒÎÕÔØ ÓÌÏ×Ï "
147 "^b ×ÌÅ×Ï ^j ×ÅÒÎÕÔØ ÓÉÍ×ÏÌ ^t × ÓÁÍÙÊ ×ÅÒÈ "
148 "^c ËÏÍÁÎÄÁ ^k ÕÄÁÌÉÔØ ÓÔÒÏËÕ ^u × ÓÁÍÙÊ ÎÉÚ "
diff --git a/usr.bin/find/find.h b/usr.bin/find/find.h
index f602707..53cb69f 100644
--- a/usr.bin/find/find.h
+++ b/usr.bin/find/find.h
@@ -88,7 +88,7 @@ typedef struct _plandata {
nlink_t _l_data; /* link count */
short _d_data; /* level depth (-1 to N) */
off_t _o_data; /* file size */
- time_t _t_data; /* time value */
+ struct timespec _t_data; /* time value */
uid_t _u_data; /* uid */
short _mt_data; /* mount flags */
struct _plandata *_p_data[2]; /* PLAN trees */
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 61d61cb..7f16a8f 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -238,7 +238,7 @@ nextarg(OPTION *option, char ***argvp)
*/
#define TIME_CORRECT(p) \
if (((p)->flags & F_ELG_MASK) == F_LESSTHAN) \
- ++((p)->t_data);
+ ++((p)->t_data.tv_sec);
/*
* -[acm]min n functions --
@@ -255,16 +255,16 @@ f_Xmin(PLAN *plan, FTSENT *entry)
{
if (plan->flags & F_TIME_C) {
COMPARE((now - entry->fts_statp->st_ctime +
- 60 - 1) / 60, plan->t_data);
+ 60 - 1) / 60, plan->t_data.tv_sec);
} else if (plan->flags & F_TIME_A) {
COMPARE((now - entry->fts_statp->st_atime +
- 60 - 1) / 60, plan->t_data);
+ 60 - 1) / 60, plan->t_data.tv_sec);
} else if (plan->flags & F_TIME_B) {
COMPARE((now - entry->fts_statp->st_birthtime +
- 60 - 1) / 60, plan->t_data);
+ 60 - 1) / 60, plan->t_data.tv_sec);
} else {
COMPARE((now - entry->fts_statp->st_mtime +
- 60 - 1) / 60, plan->t_data);
+ 60 - 1) / 60, plan->t_data.tv_sec);
}
}
@@ -278,7 +278,8 @@ c_Xmin(OPTION *option, char ***argvp)
ftsoptions &= ~FTS_NOSTAT;
new = palloc(option);
- new->t_data = find_parsenum(new, option->name, nmins, NULL);
+ new->t_data.tv_sec = find_parsenum(new, option->name, nmins, NULL);
+ new->t_data.tv_nsec = 0;
TIME_CORRECT(new);
return new;
}
@@ -309,9 +310,9 @@ f_Xtime(PLAN *plan, FTSENT *entry)
xtime = entry->fts_statp->st_mtime;
if (plan->flags & F_EXACTTIME)
- COMPARE(now - xtime, plan->t_data);
+ COMPARE(now - xtime, plan->t_data.tv_sec);
else
- COMPARE((now - xtime + 86400 - 1) / 86400, plan->t_data);
+ COMPARE((now - xtime + 86400 - 1) / 86400, plan->t_data.tv_sec);
}
PLAN *
@@ -324,7 +325,8 @@ c_Xtime(OPTION *option, char ***argvp)
ftsoptions &= ~FTS_NOSTAT;
new = palloc(option);
- new->t_data = find_parsetime(new, option->name, value);
+ new->t_data.tv_sec = find_parsetime(new, option->name, value);
+ new->t_data.tv_nsec = 0;
if (!(new->flags & F_EXACTTIME))
TIME_CORRECT(new);
return new;
@@ -1152,14 +1154,19 @@ c_name(OPTION *option, char ***argvp)
int
f_newer(PLAN *plan, FTSENT *entry)
{
+ struct timespec ft;
+
if (plan->flags & F_TIME_C)
- return entry->fts_statp->st_ctime > plan->t_data;
+ ft = entry->fts_statp->st_ctim;
else if (plan->flags & F_TIME_A)
- return entry->fts_statp->st_atime > plan->t_data;
+ ft = entry->fts_statp->st_atim;
else if (plan->flags & F_TIME_B)
- return entry->fts_statp->st_birthtime > plan->t_data;
+ ft = entry->fts_statp->st_birthtim;
else
- return entry->fts_statp->st_mtime > plan->t_data;
+ ft = entry->fts_statp->st_mtim;
+ return (ft.tv_sec > plan->t_data.tv_sec ||
+ (ft.tv_sec == plan->t_data.tv_sec &&
+ ft.tv_nsec > plan->t_data.tv_nsec));
}
PLAN *
@@ -1175,20 +1182,22 @@ c_newer(OPTION *option, char ***argvp)
new = palloc(option);
/* compare against what */
if (option->flags & F_TIME2_T) {
- new->t_data = get_date(fn_or_tspec);
- if (new->t_data == (time_t) -1)
+ new->t_data.tv_sec = get_date(fn_or_tspec);
+ if (new->t_data.tv_sec == (time_t) -1)
errx(1, "Can't parse date/time: %s", fn_or_tspec);
+ /* Use the seconds only in the comparison. */
+ new->t_data.tv_nsec = 999999999;
} else {
if (stat(fn_or_tspec, &sb))
err(1, "%s", fn_or_tspec);
if (option->flags & F_TIME2_C)
- new->t_data = sb.st_ctime;
+ new->t_data = sb.st_ctim;
else if (option->flags & F_TIME2_A)
- new->t_data = sb.st_atime;
+ new->t_data = sb.st_atim;
else if (option->flags & F_TIME2_B)
- new->t_data = sb.st_birthtime;
+ new->t_data = sb.st_birthtim;
else
- new->t_data = sb.st_mtime;
+ new->t_data = sb.st_mtim;
}
return new;
}
diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c
index 640ee3d..b7a7c91 100644
--- a/usr.bin/grep/regex/tre-fastmatch.c
+++ b/usr.bin/grep/regex/tre-fastmatch.c
@@ -103,7 +103,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data,
((!fg->reversed \
? ((type == STR_WIDE) ? ((j + fg->wlen) > len) \
: ((j + fg->len) > len)) \
- : (j <= 0)))
+ : (j < 0)))
/*
* Checks whether the new position after shifting in the input string
diff --git a/usr.bin/head/head.1 b/usr.bin/head/head.1
index 0e16477..dd12485 100644
--- a/usr.bin/head/head.1
+++ b/usr.bin/head/head.1
@@ -28,7 +28,7 @@
.\" @(#)head.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd June 6, 1993
+.Dd March 16, 2013
.Dt HEAD 1
.Os
.Sh NAME
@@ -57,6 +57,19 @@ where
is the name of the file.
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+To display the first 500 lines of the file
+.Ar foo :
+.Pp
+.Dl $ head -n 500 foo
+.Pp
+.Nm
+can be used in conjunction with
+.Xr tail 1
+in the following way to, for example, display only line 500 from the file
+.Ar foo :
+.Pp
+.Dl $ head -n 500 foo | tail -n 1
.Sh SEE ALSO
.Xr tail 1
.Sh HISTORY
diff --git a/usr.bin/ncplist/Makefile b/usr.bin/ncplist/Makefile
deleted file mode 100644
index fdddb6c..0000000
--- a/usr.bin/ncplist/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-
-PROG= ncplist
-NO_WCAST_ALIGN=
-
-DPADD= ${LIBNCP} ${LIBIPX}
-LDADD= -lncp -lipx
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/ncplist/ncplist.1 b/usr.bin/ncplist/ncplist.1
deleted file mode 100644
index 1c5eb89..0000000
--- a/usr.bin/ncplist/ncplist.1
+++ /dev/null
@@ -1,88 +0,0 @@
-.\" $FreeBSD$
-.Dd January 21, 2010
-.Dt NCPLIST 1
-.Os
-.Sh NAME
-.Nm ncplist
-.Nd "display various information about ncplib and NetWare servers"
-.Sh SYNOPSIS
-.Nm
-.Ar command
-.Op Ar arguments
-.Sh DESCRIPTION
-The
-.Nm
-utility displays the state of ncplib and NetWare servers.
-The first argument
-is a one-letter
-.Ar command
-that may be followed by
-.Ar arguments .
-.Pp
-The commands are:
-.Bl -tag -width indent
-.It Ic b Ar server type Op Ar pattern
-Lists bindery objects of
-.Ar type
-on a specified
-.Ar server .
-The
-.Ar type
-argument
-can be one of the following:
-.Pp
-.Bl -tag -width ".Cm pserver" -offset indent -compact
-.It Em Type
-.Em Meaning
-.It Cm user
-bindery users
-.It Cm group
-bindery groups
-.It Cm pserver
-bindery print servers
-.It Cm tree
-tree name hosted by given server
-.El
-.Pp
-Note that if you are not logged in to the specified server,
-the list may be incomplete or empty.
-.It Ic c
-List active NCP connections on the local machine.
-.It Ic s Op Ar server
-Display
-.Tn NetWare
-servers known to a given
-.Ar server .
-If no server is specified, the nearest server will be used.
-.It Ic u Ar server
-Displays a list of users logged in on a given
-.Ar server .
-If you are not logged in to the specified server,
-the list will be empty.
-.It Ic q Ar server Op Ar pattern
-Displays bindery queues on a given
-.Ar server .
-.It Ic v Ar server
-Displays mounted volumes on a given
-.Ar server .
-.El
-.Sh IMPLEMENTATION NOTES
-This utility is provided mostly for educational purposes.
-.Sh FILES
-.Bl -tag -width /var/log/utx.log -compact
-.It Pa ~/.nwfsrc
-keeps description for each connection.
-See
-.Pa /usr/share/examples/nwclient/dot.nwfsrc
-for details.
-.El
-.Sh HISTORY
-The
-.Nm
-utility first appeared in
-.Fx 4.0 .
-.Sh AUTHORS
-.An Boris Popov Aq bp@butya.kz ,
-.Aq rbp@chat.ru
-.Sh BUGS
-Please report any bugs to the author.
diff --git a/usr.bin/ncplist/ncplist.c b/usr.bin/ncplist/ncplist.c
deleted file mode 100644
index ae3d22c..0000000
--- a/usr.bin/ncplist/ncplist.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Boris Popov.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/time.h>
-
-#include <grp.h>
-#include <pwd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <netncp/ncp_lib.h>
-
-extern char *__progname;
-
-static struct ncp_conn_stat conndesc;
-
-static void help(void);
-static void show_connlist(void);
-static void show_serverlist(char *server);
-static void show_userlist(char *server);
-static void list_volumes(char *server);
-static void str_trim_right(char *s, char c);
-
-
-static int
-ncp_get_connid(char *server, int justattach)
-{
- int connid, error;
- struct ncp_conn_loginfo li;
-
- connid = ncp_conn_find(server, NULL);
- if (connid > 0) {
- ncp_conn_getinfo(connid, &conndesc);
- return connid;
- }
- if (!justattach) {
- if (connid == -1) {
- printf("You are not attached to server %s\n",server);
- return -1;
- }
- printf("You are not attached to any server\n");
- return -1;
- }
- ncp_li_init(&li, 0, NULL);
- if (server) {
- ncp_li_setserver(&li, server);
- error = ncp_find_fileserver(&li, AF_IPX, NULL);
- if (error) {
- printf("Could not find server %s\n", li.server);
- return -1;
- }
- } else {
- error = ncp_find_fileserver(&li, AF_IPX, NULL);
- if (error) {
- printf("Can't find any file server\n");
- return -1;
- }
- }
- error = ncp_connect(&li, &connid);
- if (error) {
- printf("Can't attach to a nearest server\n");
- return -1;
- }
- ncp_conn_getinfo(connid, &conndesc);
- return connid;
-}
-
-static struct ncp_bitname conn_statenames [] = {
- {NCPFL_INVALID, "invalid"},
- {NCPFL_LOGGED, "active"},
- {NCPFL_PERMANENT, "permanent"},
- {NCPFL_PRIMARY, "primary"},
- {0, NULL}
-};
-
-static void
-str_trim_right(char *s, char c)
-{
- int len;
-
- for (len = strlen(s) - 1; len > 0 && s[len] == c; len--)
- s[len] = '\0';
-}
-
-void
-show_connlist(void)
-{
- void *p;
- int cnt;
- char buf[200];
- struct ncp_conn_stat *ncsp;
-
- printf("Active NCP connections:\n");
- p = ncp_conn_list();
- if (p == NULL) {
- printf("None\n");
- return;
- }
- printf(" refid server:user(connid), owner:group(mode), refs, <state>\n");
- cnt = *(int*)p;
- ncsp = (struct ncp_conn_stat*)(((int*)p)+1);
- while (cnt--) {
- printf("%6d %s:%s(%d), %s:%s(%o), %d, %s",
- ncsp->connRef, ncsp->li.server,ncsp->user,ncsp->connid,
- user_from_uid(ncsp->owner, 0),
- group_from_gid(ncsp->group, 0),
- ncsp->li.access_mode,
- ncsp->ref_cnt,
- ncp_printb(buf, ncsp->flags, conn_statenames));
- printf("\n");
- ncsp++;
- }
- free(p);
- printf("\n");
-}
-
-void
-show_serverlist(char *server)
-{
- int found = 0, connid;
- struct ncp_bindery_object obj;
- const char *pattern = "*";
-
- connid = ncp_get_connid(server, 1);
- if (connid < 0)
- return;
- printf("Visible servers (from %s):\n", conndesc.li.server);
- printf("Name Network Node Port\n");
- printf("----------------------------------------------- -------- ------------ ----\n");
- obj.object_id = 0xffffffff;
-
- while (ncp_scan_bindery_object(connid, obj.object_id, NCP_BINDERY_FSERVER,
- pattern, &obj) == 0) {
- struct nw_property prop;
- struct ipx_addr *naddr = (struct ipx_addr *) &prop;
-
- found = 1;
- printf("%-48s", obj.object_name);
-
- if (ncp_read_property_value(connid, NCP_BINDERY_FSERVER,
- obj.object_name, 1, "NET_ADDRESS",
- &prop) == 0) {
- ipx_print_addr(naddr);
- }
- printf("\n");
- }
-
- if (!found) {
- printf("No servers found\n");
- }
- printf("\n");
-}
-
-
-void
-show_userlist(char *server)
-{
- int connid, error, i;
- struct ncp_file_server_info info;
- struct ncp_bindery_object user;
- time_t login_time;
- struct ipx_addr addr;
- u_int8_t conn_type;
-
- connid = ncp_get_connid(server, 0);
- if (connid < 0) return;
- if (ncp_get_file_server_information(connid, &info) != 0) {
- perror("Could not get server information");
- return;
- }
- printf("User information for server %s\n",info.ServerName);
- printf("\n%-6s%-21s%-27s%-12s\n"
- "---------------------------------------------"
- "---------------------------------\n",
- "Conn",
- "User name",
- "Station Address",
- "Login time");
- for (i = 1; i <= info.MaximumServiceConnections; i++) {
- char name[49];
- name[48] = '\0';
- error = ncp_get_stations_logged_info(connid, i, &user, &login_time);
- if (error) continue;
- memset(&addr, 0, sizeof(addr));
- error = ncp_get_internet_address(connid, i, &addr, &conn_type);
- if (error) continue;
- memcpy(name, user.object_name, 48);
- str_trim_right(name, ' ');
- printf("%4d: %-20s ", i, name);
- ipx_print_addr(&addr);
- printf(" ");
- printf("%s", ctime(&login_time));
- }
-
- return;
-}
-
-static void
-show_queuelist(char *server, char *patt)
-{
- struct ncp_bindery_object q;
- int found = 0, connid;
- char default_pattern[] = "*";
- char *pattern = default_pattern;
-
- connid = ncp_get_connid(server, 1);
- if (connid < 0) return;
- if (patt != NULL)
- pattern = patt;
- ncp_str_upper(pattern);
-
- printf("\nServer: %s\n", server);
- printf("%-52s%-10s\n"
- "-----------------------------------------------"
- "-------------\n",
- "Print queue name",
- "Queue ID");
- q.object_id = 0xffffffff;
-
- while (ncp_scan_bindery_object(connid, q.object_id,
- NCP_BINDERY_PQUEUE, pattern, &q) == 0)
- {
- found = 1;
- printf("%-52s", q.object_name);
- printf("%08X\n", (unsigned int) q.object_id);
- }
-
- if (!found) {
- printf("No queues found\n");
- }
- return;
-}
-
-void
-list_volumes(char *server)
-{
- int found = 0, connid, i, error;
- struct ncp_file_server_info si;
- char volname[NCP_VOLNAME_LEN+1];
-
- connid = ncp_get_connid(server, 1);
- if (connid < 0) return;
-
- error = ncp_get_file_server_information(connid, &si);
- if (error) {
- ncp_error("Can't get information for server %s", error, server);
- return;
- }
-
- printf("\nMounted volumes on server %s:\n", server);
- printf("Number Name\n");
- printf("------ -----------------------------------------------\n");
-
- for(i = 0; i < si.NumberMountedVolumes; i++) {
- if (NWGetVolumeName(connid, i, volname))
- continue;
- found = 1;
- printf("%6d %s\n", i, volname);
- }
-
- if (!found)
- printf("No volumes found ?\n");
- return;
-}
-
-struct ncp_bind_type {
- u_long type;
- const char *name;
-};
-
-static struct ncp_bind_type btypes[] = {
- {NCP_BINDERY_USER, "USER"},
- {NCP_BINDERY_UGROUP, "GROUP"},
- {NCP_BINDERY_PSERVER, "PSERVER"},
- {0x278, "TREE"},
- {0, NULL}
-};
-
-static void
-list_bindery(char *server, char *type, char *patt)
-{
- struct ncp_bindery_object q;
- int i, found = 0, connid;
- char default_pattern[] = "*";
- char *pattern = default_pattern;
- u_long objtype;
-
- ncp_str_upper(type);
- objtype = 0;
-
- for(i = 0; btypes[i].type; i++) {
- if (strcmp(btypes[i].name, type) == 0) {
- objtype = btypes[i].type;
- break;
- }
- }
- if (!objtype) {
- printf("Bindery object of type %s is unknown\n", type);
- return;
- }
- if (patt != NULL)
- pattern = patt;
- ncp_str_upper(pattern);
- connid = ncp_get_connid(server, 1);
- if (connid < 0) return;
-
- connid = ncp_get_connid(server, 1);
- if (connid < 0) return;
-
-
- printf("\nServer: %s\n", server);
- printf("%-52s%-10s\n"
- "-----------------------------------------------"
- "-------------\n",
- "Object name",
- "Object ID");
-
- q.object_id = 0xffffffff;
- while (ncp_scan_bindery_object(connid, q.object_id,
- objtype, pattern, &q) == 0)
- {
- found = 1;
- printf("%-52s", q.object_name);
- printf("%08X\n", (unsigned int) q.object_id);
- }
-
- if (!found) {
- printf("No bindery objects found\n");
- }
- return;
-}
-
-enum listop {
- LO_NONE, LO_SERVERS, LO_QUEUES, LO_BINDERY, LO_USERS, LO_VOLUMES
-};
-
-#define MAX_ARGS 10
-
-int
-main(int argc, char *argv[])
-{
- int opt, nargs = 0, i;
- enum listop what;
- char *args[MAX_ARGS];
-
- bzero(args, sizeof(args));
-
- what = LO_NONE;
- while ((opt = getopt(argc, argv, "h")) != -1) {
- switch (opt) {
- case 'h': case '?':
- help();
- /*NOTREACHED */
- default:
- help();
- return 1;
- }
- }
- if (optind >= argc)
- help();
-
- if(ncp_initlib())
- exit(1);
-
- switch(argv[optind++][0]) {
- case 'b':
- what = LO_BINDERY;
- nargs = 2;
- break;
- case 'c':
- show_connlist();
- return 0;
- case 's':
- what = LO_SERVERS;
- break;
- case 'u':
- what = LO_USERS;
- nargs = 1;
- break;
- case 'q':
- what = LO_QUEUES;
- nargs = 1;
- break;
- case 'v':
- what = LO_VOLUMES;
- nargs = 1;
- break;
- default:
- printf("Unknown command %s\n", argv[optind-1]);
- help();
- }
- for (i = 0; i < MAX_ARGS; i++) {
- if (optind < argc) {
- args[i] = argv[optind++];
- } else if (i < nargs) {
- printf("Not enough arguments\n");
- help();
- return 1;
- } else
- break;
- }
- switch(what) {
- case LO_SERVERS:
- show_serverlist(args[0]);
- break;
- case LO_USERS:
- show_userlist(args[0]);
- break;
- case LO_QUEUES:
- show_queuelist(args[0], args[1]);
- break;
- case LO_VOLUMES:
- list_volumes(args[0]);
- break;
- case LO_BINDERY:
- list_bindery(args[0], args[1], args[2]);
- break;
- default:
- help();
- }
- return 0;
-}
-
-static void
-help(void)
-{
- printf("\n");
- printf("usage: %s command [args]\n", __progname);
- printf("where commands are:\n"
- " b server user|group [pattern] list bindery objects on server\n"
- " c display opened connections\n"
- " s [server] display known servers\n"
- " u server list logged-in users on server\n"
- " q server [pattern] list print queues on server\n"
- " v server list mounted volumes on a specified server\n"
- "\n");
- exit(1);
-}
diff --git a/usr.bin/ncplogin/Makefile b/usr.bin/ncplogin/Makefile
deleted file mode 100644
index 8795f29..0000000
--- a/usr.bin/ncplogin/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD$
-
-PROG= ncplogin
-MAN= ncplogin.1 ncplogout.1
-
-LINKS= ${BINDIR}/ncplogin ${BINDIR}/ncplogout
-
-LDADD= -lncp -lipx
-DPADD= ${LIBNCP} ${LIBIPX}
-
-.include <bsd.prog.mk>
diff --git a/usr.bin/ncplogin/ncplogin.1 b/usr.bin/ncplogin/ncplogin.1
deleted file mode 100644
index 24b806a..0000000
--- a/usr.bin/ncplogin/ncplogin.1
+++ /dev/null
@@ -1,262 +0,0 @@
-.\" $FreeBSD$
-.Dd September 15, 1999
-.Dt NCPLOGIN 1
-.Os
-.Sh NAME
-.Nm ncplogin
-.Nd create permanent connection to a NetWare server
-.Sh SYNOPSIS
-.Nm
-.Op Fl BCDN
-.Op Fl S Ar server
-.Op Fl U Ar user
-.Op Fl A Ar host
-.Op Fl I Ar level
-.Op Fl M Ar mode
-.Oo
-.Fl O Xo
-.Op Ar owner Ns
-.Op : Ns Ar group
-.Xc
-.Oc
-.Op Fl R Ar retrycount
-.Op Fl T Ar tree
-.Op Fl W Ar timeout
-.Nm
-.Op Fl BCDN
-.Op Fl A Ar host
-.Op Fl I Ar level
-.Op Fl M Ar mode
-.Oo
-.Fl O Xo
-.Op Ar owner Ns
-.Op : Ns Ar group
-.Xc
-.Oc
-.Op Fl R Ar retrycount
-.Op Fl T Ar tree
-.Op Fl W Ar timeout
-.No / Ns Ar server Ns : Ns Ar user
-.Sh DESCRIPTION
-Connections to a
-.Tn NetWare
-server can be created and used independently of the
-.Xr mount_nwfs 8
-command.
-Connections can be created by any user.
-Each user can have multiple
-connections, but each
-.Ar NetWareServer Ns : Ns Ar NetWareUser
-pair should be unique.
-.Pp
-The
-.Nm
-command is used to create a permanent connection to a
-.Tn NetWare
-server.
-Permanent connections will stay open even if no application uses them.
-This allows users to run different
-.Pa ncp*
-programs
-without specifying a file server and user to use.
-Established connections can be destroyed with the
-.Xr ncplogout 1
-command.
-.Pp
-Upper case options described in this manual page
-are common for other
-.Pa ncp*
-programs and are referred to as
-.Dq connection options .
-Options
-.Fl U
-and
-.Fl S
-are mutually exclusive with the
-.No / Ns Ar server Ns : Ns Ar user
-syntax.
-.Pp
-The following options are available:
-.Bl -tag -width indent
-.It Fl S Ar server
-Specify the name of the
-.Tn NetWare
-server to connect to.
-This affects only
-.Tn IPX
-servers.
-For servers supporting
-.Tn IP
-natively, see the
-.Fl A
-option.
-.It Fl U Ar user
-Specify the name of the user used in the login sequence.
-.It Fl A Ar host
-Use the
-.Tn UDP
-protocol to connect to a
-.Tn NetWare
-5.x server specified by the
-.Ar host
-argument.
-.It Fl C
-Do not convert the password to uppercase.
-.It Fl D
-Mark the connection as primary.
-The option can be used to modify existing connections.
-Only the
-.Nm
-program accepts this option.
-.It Fl I Ar signature_level
-Try to use
-.Ar signature_level .
-Available values are:
-.Pp
-.Bl -tag -width ".Em Value" -offset indent -compact
-.It Em Value
-.Em Meaning
-.It 0
-disable signatures
-.It 1
-enable (use if required by server)
-.It 2
-request but do not require signing
-.It 3
-require signatures
-.El
-.Pp
-Note that only packet header signing is implemented.
-.It Fl M Ar mode
-Share this connection.
-The bits in the
-.Ar mode
-argument are similar to standard file permissions:
-.Pp
-.Bl -tag -width ".Em Mask" -offset indent -compact
-.It Em Mask
-.Em Meaning
-.It 4
-.Pq READ
-connection will be visible.
-.It 2
-.Pq WRITE
-connection can be closed/modified.
-.It 1
-.Pq EXECUTE
-user is allowed to execute requests.
-.El
-.Pp
-By default, the connection is created with
-.Ar mode
-0700
-and only the owner can use it.
-Specifying 0750 as the argument to the
-.Fl M
-option would allow read-only group access as well.
-This would allow the group to perform
-.Tn NCP
-requests,
-but not to destroy the connection.
-When a server is not explicitly specified,
-.Pa ncp*
-programs try to find a suitable connection in the following order:
-.Bl -enum -offset indent
-.It
-Try to find a connection owned by the user.
-If there is more than one such
-connection, try to determine which one is primary.
-(The primary flag is set with the
-.Fl D
-option.)
-.It
-If the primary connection could not be determined,
-the first shared connection will be used.
-.El
-.It Fl N
-Do not prompt for a password.
-At run time,
-.Nm
-reads the
-.Pa ~/.nwfsrc
-file for additional configuration parameters and a password.
-If no password is found for the specified
-.Ar server Ns : Ns Ar user
-pair,
-.Nm
-prompts for it.
-.It Fl O
-Specify the
-.Ar owner
-and
-.Ar group
-attributes for the connection.
-By default, newly created connections take the
-.Ar owner
-attribute from the creating user's username and the
-.Ar group
-attribute from the creating user's primary group.
-This option overrides that behaviour.
-Only the superuser can override the
-.Ar owner
-attribute for a connection.
-.It Fl P
-Mark the connection as permanent.
-The
-.Nm
-utility always creates permanent connections.
-This option can be useful in other
-.Pa ncp*
-programs.
-.It Fl R Ar retry_count
-Specify the number of retries to be performed
-before dropping the connection.
-The default value is 10.
-.Pp
-Note: after a connection is marked
-.Dq BAD ,
-each request will try to restore it.
-This process restores only the
-.Tn NCP
-connection;
-it does not reopen any files that were open
-at the time that the connection was marked
-.Dq BAD .
-.It Fl W Ar timeout
-Specify the server request timeout in seconds.
-The default is 5 seconds.
-.It / Ns Ar server Ns : Ns Ar user
-This syntax is provided for the sake of simplicity
-and is mutually exclusive with the
-.Fl S
-and
-.Fl U
-options.
-.El
-.Sh IMPLEMENTATION NOTES
-Low-level connection management is implemented in the
-.Pa ncp.ko
-kernel module.
-The
-.Xr IPXrouted 8
-program is also required for
-.Tn IPX
-support.
-.Sh FILES
-.Bl -tag -width ".Pa ~/.nwfsrc"
-.It Pa ~/.nwfsrc
-keeps static parameters for connections and other information;
-see
-.Pa /usr/share/examples/nwclient/dot.nwfsrc
-for details.
-.El
-.Sh HISTORY
-The
-.Nm
-command first appeared in
-.Fx 4.0 .
-.Sh AUTHORS
-.An Boris Popov Aq bp@butya.kz ,
-.Aq rbp@chat.ru
-.Sh BUGS
-Please report any bugs to the author.
diff --git a/usr.bin/ncplogin/ncplogin.c b/usr.bin/ncplogin/ncplogin.c
deleted file mode 100644
index e64f63a..0000000
--- a/usr.bin/ncplogin/ncplogin.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Boris Popov.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <sys/errno.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sysexits.h>
-#include <unistd.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_rcfile.h>
-
-extern char *__progname;
-
-static void
-login_usage(void) {
- printf("usage: %s [-Dh] [-A host] [-BCN] [-I level] [-M mode] \n"
- " [-R retrycount] [-W timeout] /server:user\n", __progname);
- exit(1);
-}
-
-static void
-logout_usage(void) {
- printf("usage: %s [-c handle] [-h] [/server:user]\n", __progname);
- exit(1);
-}
-
-static void
-login(int argc, char *argv[], struct ncp_conn_loginfo *li) {
- int error = 0, connid, opt, setprimary = 0;
-
- while ((opt = getopt(argc, argv, STDPARAM_OPT"D")) != -1) {
- switch(opt){
- case STDPARAM_ARGS:
- if (ncp_li_arg(li, opt, optarg))
- exit(1);
- break;
- case 'D':
- setprimary = 1;
- break;
- default:
- login_usage();
- /*NOTREACHED*/
- }
- }
- if (li->access_mode == 0)
- li->access_mode = S_IRWXU;
- if (ncp_li_check(li))
- exit(1);
- li->opt |= NCP_OPT_WDOG | NCP_OPT_PERMANENT;
- /* now we can try to login, or use already established connection */
- error = ncp_li_login(li, &connid);
- if (error) {
- ncp_error("Could not login to server %s", error, li->server);
- exit(1);
- }
- error = ncp_setpermanent(connid, 1);
- if (error && errno != EACCES){
- ncp_error("Can't make connection permanent", error);
- exit(1);
- }
- if (setprimary && ncp_setprimary(connid, 1) != 0)
- ncp_error("Warning: can't make connection primary", errno);
- printf("Logged in with conn handle:%d\n", connid);
- return;
-}
-
-static void
-logout(int argc, char *argv[], struct ncp_conn_loginfo *li) {
- int error = 0, connid, opt;
-
- connid = -1;
- while ((opt = getopt(argc, argv, STDPARAM_OPT"c:")) != -1){
- switch (opt) {
- case 'c':
- connid = atoi(optarg);
- break;
- case STDPARAM_ARGS:
- if (ncp_li_arg(li, opt, optarg))
- exit(1);
- break;
- default:
- logout_usage();
- /*NOTREACHED*/
- }
- }
- if (connid == -1) {
- if (li->server[0] == 0)
- errx(EX_USAGE, "no server name specified");
- if (li->user == 0)
- errx(EX_USAGE, "no user name specified");
- if (ncp_conn_scan(li, &connid))
- errx(EX_OSERR, "You are not attached to server %s",
- li->server);
- }
- if (ncp_setpermanent(connid, 0) < 0 && errno != EACCES) {
- ncp_error("Connection isn't valid", errno);
- exit(EX_OSERR);
- }
- error = ncp_disconnect(connid);
- if (error) {
- if (errno == EACCES) {
- warnx("you logged out, but connection belongs"
- "to other user and not closed");
- } else {
- ncp_error("Can't logout with connid %d", error, connid);
- error = 1;
- }
- }
- exit(error ? 1 : 0);
-}
-
-int
-main(int argc, char *argv[]) {
- int islogin, error;
- char *p, *p1;
- struct ncp_conn_loginfo li;
-
- islogin = strcmp(__progname, "ncplogin") == 0;
-
- if (argc == 2) {
- if (strcmp(argv[1], "-h") == 0) {
- if (islogin)
- login_usage();
- else
- logout_usage();
- }
- }
-
- if (ncp_initlib())
- exit(1);
- if (ncp_li_init(&li, argc, argv))
- return 1;
-
- if (argc >= 2 && argv[argc - 1][0] == '/') {
- p = argv[argc - 1];
- error = 1;
- do {
- if (*p++ != '/')
- break;
- p1 = strchr(p, ':');
- if (p1 == NULL)
- break;
- *p1++ = 0;
- if (ncp_li_setserver(&li, p))
- break;
- if (*p1 == 0)
- break;
- if (ncp_li_setuser(&li, p1)) break;
- error = 0;
- } while(0);
- if (error)
- errx(EX_DATAERR,
- "an error occurred while parsing '%s'",
- argv[argc - 1]);
- }
-
- if (ncp_li_readrc(&li))
- return 1;
- if (ncp_rc)
- rc_close(ncp_rc);
- if (islogin)
- login(argc, argv, &li);
- else
- logout(argc, argv, &li);
- return 0;
-}
diff --git a/usr.bin/ncplogin/ncplogout.1 b/usr.bin/ncplogin/ncplogout.1
deleted file mode 100644
index 14acaf5..0000000
--- a/usr.bin/ncplogin/ncplogout.1
+++ /dev/null
@@ -1,56 +0,0 @@
-.\" $FreeBSD$
-.Dd September 15, 1999
-.Dt NCPLOGOUT 1
-.Os
-.Sh NAME
-.Nm ncplogout
-.Nd schedule permanent connection to close
-.Sh SYNOPSIS
-.Nm
-.Op Fl S Ar server
-.Op Fl U Ar user
-.Op Fl c Ar handle
-.Nm
-.Op Fl c Ar handle
-.No / Ns Ar server Ns : Ns Ar user
-.Sh DESCRIPTION
-The
-.Nm
-utility will schedule a connection created by
-.Xr ncplogin 1
-command to be closed.
-If the connection is busy (i.e., used by other processes) it will
-be closed when the last process using it is terminated.
-This command is similar to the
-.Tn DOS
-.Pa logout.exe
-command.
-.Pp
-The options are:
-.Bl -tag -width indent
-.It Fl S Ar server
-Specify the name of the
-.Tn NetWare
-server to which the connection should be terminated.
-Can be omitted if there is only
-one connection active.
-.It Fl U Ar user
-Specify the name of the user to use when identifying the connection.
-Can be omitted if there is only
-one connection active.
-.It Fl c Ar handle
-Close a connection by handle.
-A list of available handles can be obtained with the following command:
-.Pp
-.Dl "ncplist c"
-.El
-.Sh HISTORY
-The
-.Nm
-utility first appeared in
-.Fx 4.0 .
-.Sh AUTHORS
-.An Boris Popov Aq bp@butya.kz ,
-.Aq bp@FreeBSD.org
-.Sh BUGS
-Please report any bugs to the author.
diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1
index 90f4067..c52340a 100644
--- a/usr.bin/netstat/netstat.1
+++ b/usr.bin/netstat/netstat.1
@@ -28,7 +28,7 @@
.\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd February 22, 2010
+.Dd March 10, 2013
.Dt NETSTAT 1
.Os
.Sh NAME
@@ -301,6 +301,12 @@ is repeated, counters with a value of zero are suppressed.
Show
.Xr netisr 9
statistics.
+The flags field shows available ISR handlers:
+.Bl -column ".Li W" ".Dv NETISR_SNP_FLAGS_DRAINEDCPU"
+.It Li C Ta Dv NETISR_SNP_FLAGS_M2CPUID Ta "Able to map mbuf to cpu id"
+.It Li D Ta Dv NETISR_SNP_FLAGS_DRAINEDCPU Ta "Has queue drain handler"
+.It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id"
+.El
.El
.Pp
Some options have the general meaning:
diff --git a/usr.bin/renice/renice.8 b/usr.bin/renice/renice.8
index d6dfa88..052ef13 100644
--- a/usr.bin/renice/renice.8
+++ b/usr.bin/renice/renice.8
@@ -85,13 +85,6 @@ Reset the
interpretation to be (the default) process ID's.
.El
.Pp
-For example,
-.Pp
-.Dl "renice +1 987 -u daemon root -p 32"
-.Pp
-would change the priority of process ID's 987 and 32, and
-all processes owned by users daemon and root.
-.Pp
Users other than the super-user may only alter the priority of
processes they own,
and can only monotonically increase their ``nice value''
@@ -116,6 +109,11 @@ anything negative (to make things go very fast).
.It Pa /etc/passwd
to map user names to user ID's
.El
+.Sh EXAMPLES
+Change the priority of process ID's 987 and 32, and
+all processes owned by users daemon and root.
+.Pp
+.Dl "renice +1 987 -u daemon root -p 32"
.Sh SEE ALSO
.Xr nice 1 ,
.Xr rtprio 1 ,
diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1
index df5ed24..a142482 100644
--- a/usr.bin/script/script.1
+++ b/usr.bin/script/script.1
@@ -178,7 +178,7 @@ and
options first appeared in
.Nx 2.0
and were ported to
-.Fx 10 .
+.Fx 10.0 .
.Sh BUGS
The
.Nm
diff --git a/usr.bin/tail/tail.1 b/usr.bin/tail/tail.1
index d4ec2f9..35866f5 100644
--- a/usr.bin/tail/tail.1
+++ b/usr.bin/tail/tail.1
@@ -31,7 +31,7 @@
.\" @(#)tail.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
-.Dd June 5, 2009
+.Dd March 16, 2013
.Dt TAIL 1
.Os
.Sh NAME
@@ -147,6 +147,17 @@ is the name of the file unless
flag is specified.
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+To display the last 500 lines of the file
+.Ar foo :
+.Pp
+.Dl $ tail -n 500 foo
+.Pp
+Keep
+.Pa /var/log/messages
+open, displaying to the standard output anything appended to the file:
+.Pp
+.Dl $ tail -f /var/log/messages
.Sh SEE ALSO
.Xr cat 1 ,
.Xr head 1 ,
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index edfa43a..e01143d 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -797,7 +797,7 @@ format_next_process(caddr_t handle, char *(*get_userid)(int), int flags)
double pct;
struct handle *hp;
char status[16];
- int state;
+ int cpu, state;
struct rusage ru, *rup;
long p_tot, s_tot;
char *proc_fmt, thr_buf[6], jid_buf[6];
@@ -997,6 +997,13 @@ format_next_process(caddr_t handle, char *(*get_userid)(int), int flags)
}
/* format this entry */
+ if (smpmode) {
+ if (state == SRUN && pp->ki_oncpu != 0xff)
+ cpu = pp->ki_oncpu;
+ else
+ cpu = pp->ki_lastcpu;
+ } else
+ cpu = 0;
proc_fmt = smpmode ? smp_Proc_format : up_Proc_format;
if (ps.thread != 0)
thr_buf[0] = '\0';
@@ -1014,7 +1021,7 @@ format_next_process(caddr_t handle, char *(*get_userid)(int), int flags)
format_k2(PROCSIZE(pp)),
format_k2(pagetok(pp->ki_rssize)),
status,
- smpmode ? pp->ki_lastcpu : 0,
+ cpu,
format_time(cputime),
ps.wcpu ? 100.0 * weighted_cpu(pct, pp) : 100.0 * pct,
screen_width > cmdlengthdelta ? screen_width - cmdlengthdelta : 0,
diff --git a/usr.bin/unifdef/unifdefall.sh b/usr.bin/unifdef/unifdefall.sh
index c9a04cc..36442b9 100644
--- a/usr.bin/unifdef/unifdefall.sh
+++ b/usr.bin/unifdef/unifdefall.sh
@@ -42,8 +42,7 @@ case "$@" in
shift
esac
-basename=$(basename "$0")
-tmp=$(mktemp -d "${TMPDIR:-/tmp}/$basename.XXXXXXXXXX") || exit 2
+tmp=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXXXXXX") || exit 2
trap 'rm -r "$tmp" || exit 2' EXIT
export LC_ALL=C
diff --git a/usr.bin/unvis/Makefile b/usr.bin/unvis/Makefile
index 27fea4b..59528ef 100644
--- a/usr.bin/unvis/Makefile
+++ b/usr.bin/unvis/Makefile
@@ -3,4 +3,6 @@
PROG= unvis
+.PATH: ${.CURDIR}/../../contrib/unvis
+
.include <bsd.prog.mk>
diff --git a/usr.bin/vis/Makefile b/usr.bin/vis/Makefile
index 8f83a14..5d860de 100644
--- a/usr.bin/vis/Makefile
+++ b/usr.bin/vis/Makefile
@@ -1,6 +1,10 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
+# $FreeBSD$
PROG= vis
SRCS= vis.c foldit.c
+.PATH: ${.CURDIR}/../../contrib/vis
+CFLAGS+= -I${.CURDIR}/../../contrib/vis
+
.include <bsd.prog.mk>
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c
deleted file mode 100644
index 71b6404..0000000
--- a/usr.bin/vis/vis.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*-
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-__FBSDID("$FreeBSD$");
-
-#ifndef lint
-static const char copyright[] =
-"@(#) Copyright (c) 1989, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
-#endif
-
-#ifndef lint
-static const char sccsid[] = "@(#)vis.c 8.1 (Berkeley) 6/6/93";
-#endif
-
-#include <err.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <vis.h>
-
-#include "extern.h"
-
-static int eflags, fold, foldwidth = 80, none, markeol;
-#ifdef DEBUG
-static int debug;
-#endif
-
-static void process(FILE *);
-static void usage(void);
-
-int
-main(int argc, char *argv[])
-{
- FILE *fp;
- int ch;
-
- (void) setlocale(LC_CTYPE, "");
-
- while ((ch = getopt(argc, argv, "nwctsobfF:ld")) != -1)
- switch((char)ch) {
- case 'n':
- none++;
- break;
- case 'w':
- eflags |= VIS_WHITE;
- break;
- case 'c':
- eflags |= VIS_CSTYLE;
- break;
- case 't':
- eflags |= VIS_TAB;
- break;
- case 's':
- eflags |= VIS_SAFE;
- break;
- case 'o':
- eflags |= VIS_OCTAL;
- break;
- case 'b':
- eflags |= VIS_NOSLASH;
- break;
- case 'F':
- if ((foldwidth = atoi(optarg))<5)
- errx(1, "can't fold lines to less than 5 cols");
- /*FALLTHROUGH*/
- case 'f':
- fold++; /* fold output lines to 80 cols */
- break; /* using hidden newline */
- case 'l':
- markeol++; /* mark end of line with \$ */
- break;
-#ifdef DEBUG
- case 'd':
- debug++;
- break;
-#endif
- case '?':
- default:
- usage();
- }
- argc -= optind;
- argv += optind;
-
- if (*argv)
- while (*argv) {
- if ((fp=fopen(*argv, "r")) != NULL)
- process(fp);
- else
- warn("%s", *argv);
- argv++;
- }
- else
- process(stdin);
- exit(0);
-}
-
-
-static void
-usage(void)
-{
-#ifdef DEBUG
- fprintf(stderr, "usage: vis [-cbflnostwd] [-F foldwidth] [file ...]\n");
-#else
- fprintf(stderr, "usage: vis [-cbflnostw] [-F foldwidth] [file ...]\n");
-#endif
- exit(1);
-}
-
-static void
-process(FILE *fp)
-{
- static int col = 0;
- static char dummy[] = "\0";
- char *cp = dummy+1; /* so *(cp-1) starts out != '\n' */
- int c, rachar;
- char buff[5];
-
- c = getc(fp);
- while (c != EOF) {
- rachar = getc(fp);
- if (none) {
- cp = buff;
- *cp++ = c;
- if (c == '\\')
- *cp++ = '\\';
- *cp = '\0';
- } else if (markeol && c == '\n') {
- cp = buff;
- if ((eflags & VIS_NOSLASH) == 0)
- *cp++ = '\\';
- *cp++ = '$';
- *cp++ = '\n';
- *cp = '\0';
- } else
- (void) vis(buff, (char)c, eflags, (char)rachar);
-
- cp = buff;
- if (fold) {
-#ifdef DEBUG
- if (debug)
- printf("<%02d,", col);
-#endif
- col = foldit(cp, col, foldwidth);
-#ifdef DEBUG
- if (debug)
- printf("%02d>", col);
-#endif
- }
- do {
- putchar(*cp);
- } while (*++cp);
- c = rachar;
- }
- /*
- * terminate partial line with a hidden newline
- */
- if (fold && *(cp-1) != '\n')
- printf("\\\n");
-}
diff --git a/usr.sbin/ac/ac.8 b/usr.sbin/ac/ac.8
index 26667d8..954d9f7 100644
--- a/usr.sbin/ac/ac.8
+++ b/usr.sbin/ac/ac.8
@@ -105,17 +105,6 @@ hand.
No login or connect time accounting is performed if
.Pa /var/log/utx.log
does not exist.
-.Pp
-For example,
-.Bd -literal -offset indent
-ac -p -t "ttyd*" > modems
-ac -p -t "!ttyd*" > other
-.Ed
-.Pp
-allows times recorded in
-.Pa modems
-to be charged out at a different rate than
-.Pa other .
.Sh FILES
.Bl -tag -width /var/log/utx.log -compact
.It Pa /var/log/utx.log
@@ -123,6 +112,15 @@ connect time accounting file
.El
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+Allow times recorded in
+.Pa modems
+to be charged out at a different rate than
+.Pa other :
+.Bd -literal -offset indent
+ac -p -t "ttyd*" > modems
+ac -p -t "!ttyd*" > other
+.Ed
.Sh SEE ALSO
.Xr login 1 ,
.Xr getutxent 3 ,
diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c
index 08a9a58..43c542d 100644
--- a/usr.sbin/bhyve/pci_passthru.c
+++ b/usr.sbin/bhyve/pci_passthru.c
@@ -279,6 +279,7 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size)
int index;
pi = sc->psc_pi;
+ offset -= pi->pi_msix.table_offset;
index = offset / MSIX_TABLE_ENTRY_SIZE;
if (index >= pi->pi_msix.table_count)
@@ -323,6 +324,8 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc,
int error, index;
pi = sc->psc_pi;
+ offset -= pi->pi_msix.table_offset;
+
index = offset / MSIX_TABLE_ENTRY_SIZE;
if (index >= pi->pi_msix.table_count)
return;
diff --git a/usr.sbin/bhyve/pci_virtio_net.c b/usr.sbin/bhyve/pci_virtio_net.c
index 11647d6..7129f6b 100644
--- a/usr.sbin/bhyve/pci_virtio_net.c
+++ b/usr.sbin/bhyve/pci_virtio_net.c
@@ -170,7 +170,7 @@ pci_vtnet_iosize(struct pci_devinst *pi)
static int
hq_num_avail(struct vring_hqueue *hq)
{
- int ndesc;
+ uint16_t ndesc;
/*
* We're just computing (a-b) in GF(216).
diff --git a/usr.sbin/mount_nwfs/Makefile b/usr.sbin/mount_nwfs/Makefile
deleted file mode 100644
index 8f46581..0000000
--- a/usr.sbin/mount_nwfs/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-PROG= mount_nwfs
-SRCS= mount_nwfs.c getmntopts.c
-MAN= mount_nwfs.8
-
-MOUNT= ${.CURDIR}/../../sbin/mount
-CFLAGS+= -DNWFS -I${MOUNT}
-
-.PATH: ${MOUNT}
-
-DPADD= ${LIBNCP} ${LIBIPX}
-LDADD= -lncp -lipx
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/mount_nwfs/mount_nwfs.8 b/usr.sbin/mount_nwfs/mount_nwfs.8
deleted file mode 100644
index 3946f71..0000000
--- a/usr.sbin/mount_nwfs/mount_nwfs.8
+++ /dev/null
@@ -1,230 +0,0 @@
-.\" $FreeBSD$
-.Dd October 14, 1999
-.Dt MOUNT_NWFS 8
-.Os
-.Sh NAME
-.Nm mount_nwfs
-.Nd mount NetWare volume from a NetWare file server
-.Sh SYNOPSIS
-.Nm
-.Op Fl Chv
-.Fl S Ar server
-.Fl U Ar user
-.Op Fl connection\ options
-.Fl V Ar volume
-.Op Fl M Ar mode
-.Op Fl c Ar case
-.Op Fl d Ar mode
-.Op Fl f Ar mode
-.Op Fl g Ar gid
-.Op Fl l Ar locale
-.Op Fl n Ar os2
-.Op Fl u Ar uid
-.Op Fl w Ar scheme
-.Ar node
-.Nm
-.Op Fl options
-.Ar /server:user/volume[/path]
-.Ar node
-.Sh DESCRIPTION
-The
-.Nm
-utility allows to mount volume from a NetWare server.
-It may use either
-existing connection or create new: if no usable connection was found
-it will try to establish a new one.
-Connection has count of references to it,
-so when last mount will be dismounted connection will be closed.
-It is
-possible to create connection without any mounts (but use it for them) with
-.Xr ncplogin 1 .
-.Pp
-Note two forms of command line.
-In the first form, server and user specified
-via
-.Fl S
-and
-.Fl U
-options respectively.
-In the second form server and user specified in
-.Ar special
-part of
-.Xr mount 8
-command line arguments (the
-.Fl S ,
-.Fl U
-and
-.Fl V
-options are not used in this case).
-This allows use of
-.Xr fstab 5
-file (see
-.Sx EXAMPLES
-below).
-.Pp
-The options are:
-.Bl -tag -width indent
-.It Fl S Ar server
-Name of NetWare server to connect.
-For native IP you will need also
-.Fl A
-option.
-.It Fl U Ar user
-Name of user used in login sequence.
-.It Fl connection\ options
-See
-.Xr ncplogin 1
-for details.
-.It Fl V Ar volume
-Volume name to mount.
-Volume name can also be specified after all options and
-before
-.Ar mount-point .
-.It Ar node
-Path to mount volume.
-.It Fl c Ar case
-Select a
-.Ar case
-option which affects on name representation.
-.Ar Case
-can be one of the following:
-.Bl -tag -width "ValueXX"
-.It Em Value
-.Em Meaning
-.It l
-All existing file names converted to lower case.
-Newly created file gets a lower case under OS2 name space.
-This is the default when mounting volumes with DOS name space.
-.It L
-Same as 'l' but file system tries to be case insensitive.
-May not work well.
-.It n
-No case conversion is performed.
-.Em Warning !
-Use this option with DOS name space only as a last resort,
-because creating a lower case name in the DOS name space
-can lead to unpredictable results.
-This is the default when mounting volumes with OS2 name space.
-.It u
-All existing file names converted to upper case.
-Newly created file gets an upper case under OS2 name space.
-.It U
-Same as 'u' but file system tries to be case insensitive.
-May not work well.
-.El
-.It Fl f Ar mode , Fl d Ar mode
-Specify permissions that should be assigned to files and directories.
-The values must be specified as octal numbers.
-Default value for the file mode
-is taken from mount point, default value for the dir mode adds execute
-permission where the file mode gives read permission.
-.Pp
-Note that these permissions can differ from the rights granted by NetWare
-server.
-.It Fl n Ar namespace
-Do not use
-.Ar namespace .
-Currently only
-.Ar OS2
-can be here.
-.It Fl v
-Print version number.
-.It Fl u Ar uid , Fl g Ar gid
-User id and group id assigned to files.
-The default is owner and group id from
-directory where volume is mounted.
-.It Fl l Ar locale
-Set the locale for case conversion.
-By default
-.Nm
-tries to use an environment variable
-.Ev LC_* .
-.It Fl w Ar scheme
-Select a
-.Ar scheme
-used to convert file names between NetWare and
-.Fx .
-Supported conversion schemes are:
-.Bl -tag -width ".Cm koi2cp866"
-.It Cm asis
-Characters passed as is without any alteration.
-.It Cm koi2cp866
-koi8-r <-> CP866
-.It Cm se
-Suits for setups used in Sweden.
-.El
-.It Fl M Ar mode
-See
-.Xr ncplogin 1
-for details.
-If this option is omitted, connection permissions
-assumed the same as directory mode
-.Pq Fl d
-option.
-.El
-.Sh FILES
-.Bl -tag -width /var/log/wtmp -compact
-.It Pa ~/.nwfsrc
-keeps static parameters for connections and other information.
-See
-.Pa /usr/share/examples/nwclient/dot.nwfsrc
-for details.
-.El
-.Sh NOTES
-Before any NCP connection can be established kernel must be configured
-for IPX support, IPXrouted and KLD nwfs.ko should be loaded.
-.Sh EXAMPLES
-Next examples illustrates how to connect to NetWare server
-.Em nwserv
-as user
-.Em GUEST
-and mount volumes
-.Em SYS
-and
-.Em VOL1 :
-.Bd -literal -offset indent
-mount_nwfs -S nwserv -U guest -V sys /nw/s1/sys
-mount_nwfs /nwserv:guest/sys /nw/s1/sys
-mount -t nwfs /nwserv:guest/vol1 /nw/s1/vol1
-mount -t nwfs /nwserv:boris/sys/home/boris /home/boris/nw/home
-.Ed
-.Pp
-The last example mounts only subdirectory on a volume and equivalent
-to NetWare 'map root' command.
-.Pp
-It is possible to use
-.Xr fstab 5
-for nwfs mounts:
-.Bd -literal -offset indent
-/nwserv:guest/sys /nw/s1/sys nwfs rw,noauto 0 0
-/nwserv:guest/vol1 /nw/s1/vol2 nwfs rw,noauto 0 0
-.Ed
-.Sh HISTORY
-The
-.Nm
-utility first appeared in
-.Fx 4.0 .
-.Sh CREDITS
-In development of NetWare client for
-.Fx ,
-the following sources were used:
-.Pp
-Documentation from NetWare NDK.
-.Pp
-Ncpfs for Linux - written by
-.An Volker Lendecke Aq lendecke@math.uni\-goettingen.de .
-He granted me permission to publish parts of his code under
-.Bx Ns -style
-license,
-.Pp
-"Interrupt List" from
-.An Ralf Brown ,
-.Pp
-Many files from
-.Pa /sys
-directory.
-.Sh AUTHORS
-.An Boris Popov Aq bp@butya.kz ,
-.Aq rbp@chat.ru
-.Sh BUGS
-to number a few
diff --git a/usr.sbin/mount_nwfs/mount_nwfs.c b/usr.sbin/mount_nwfs/mount_nwfs.c
deleted file mode 100644
index 5f5f19a..0000000
--- a/usr.sbin/mount_nwfs/mount_nwfs.c
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Copyright (c) 1999, Boris Popov
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Boris Popov.
- * 4. Neither the name of the author nor the names of any co-contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-#include <sys/mount.h>
-#include <sys/sysctl.h>
-#include <machine/cpu.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <pwd.h>
-#include <grp.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <err.h>
-#include <sysexits.h>
-#include <time.h>
-
-#include <netncp/ncp_lib.h>
-#include <netncp/ncp_rcfile.h>
-#include <fs/nwfs/nwfs_mount.h>
-#include "mntopts.h"
-
-#define NWFS_VFSNAME "nwfs"
-
-static char mount_point[MAXPATHLEN + 1];
-static void usage(void);
-static int parsercfile(struct ncp_conn_loginfo *li, struct nwfs_args *mdata);
-
-static struct mntopt mopts[] = {
- MOPT_STDOPTS,
- MOPT_END
-};
-
-static int
-parsercfile(struct ncp_conn_loginfo *li __unused,
- struct nwfs_args *mdata __unused)
-{
- return 0;
-}
-
-int
-main(int argc, char *argv[])
-{
- NWCONN_HANDLE connHandle;
- struct nwfs_args mdata;
- struct ncp_conn_loginfo li;
- struct stat st;
- struct nw_entry_info einfo;
- struct tm *tm;
- time_t ltime;
- int opt, error, mntflags, nlsopt, wall_clock;
- int uid_set, gid_set;
- size_t len;
- char *p, *p1, tmp[1024];
- u_char *pv;
-
- if (argc < 2)
- usage();
- if (argc == 2) {
- if (strcmp(argv[1], "-h") == 0) {
- usage();
- } else if (strcmp(argv[1], "-v") == 0) {
- errx(EX_OK, "version %d.%d.%d", NWFS_VERSION / 100000,
- (NWFS_VERSION % 10000) / 1000,
- (NWFS_VERSION % 1000) / 100);
- }
- }
-
- if(ncp_initlib()) exit(1);
-
- mntflags = error = 0;
- bzero(&mdata,sizeof(mdata));
- gid_set = uid_set = 0;
- nlsopt = 0;
-
- if (ncp_li_init(&li, argc, argv)) return 1;
- /*
- * A little bit weird, but I should figure out which server/user to use
- * _before_ reading .rc file
- */
- if (argc >= 3 && argv[argc-1][0] != '-' && argv[argc-2][0] != '-' &&
- argv[argc-2][0] == '/') {
- p = argv[argc-2];
- error = 1;
- do {
- if (*p++ != '/') break;
- p1 = tmp;
- while (*p != ':' && *p != 0) *p1++ = *p++;
- if (*p++ == 0) break;
- *p1 = 0;
- if (ncp_li_setserver(&li, tmp)) break;
- p1 = tmp;
- while (*p != '/' && *p != 0) *p1++ = *p++;
- if (*p++ == 0) break;
- *p1 = 0;
- if (ncp_li_setuser(&li, tmp)) break;
- p1 = tmp;
- while (*p != '/' && *p != 0) *p1++ = *p++;
- *p1 = 0;
- if (strlen(tmp) > NCP_VOLNAME_LEN) {
- warnx("volume name too long: %s", tmp);
- break;
- }
- ncp_str_upper(strcpy(mdata.mounted_vol,tmp));
- if (*p == '/')
- p++;
- p1 = mdata.root_path + 2;
- pv = mdata.root_path + 1;
- for(;*p;) {
- *pv = 0;
- while (*p != '/' && *p) {
- *p1++ = *p++;
- (*pv)++;
- }
- if (*pv) {
- ncp_nls_mem_u2n(pv + 1, pv + 1, *pv);
- pv += (*pv) + 1;
- mdata.root_path[0]++;
- }
- if (*p++ == 0) break;
- p1++;
- }
- error = 0;
- } while(0);
- if (error)
- errx(EX_DATAERR,
- "an error occurred while parsing '%s'",
- argv[argc - 2]);
- }
- if (ncp_li_readrc(&li)) return 1;
- if (ncp_rc) {
- parsercfile(&li,&mdata);
- rc_close(ncp_rc);
- }
- while ((opt = getopt(argc, argv, STDPARAM_OPT"V:c:d:f:g:l:n:o:u:w:")) != -1) {
- switch (opt) {
- case STDPARAM_ARGS:
- if (ncp_li_arg(&li, opt, optarg)) {
- return 1;
- }
- break;
- case 'V':
- if (strlen(optarg) > NCP_VOLNAME_LEN)
- errx(EX_DATAERR, "volume too long: %s", optarg);
- ncp_str_upper(strcpy(mdata.mounted_vol,optarg));
- break;
- case 'u': {
- struct passwd *pwd;
-
- pwd = isdigit(optarg[0]) ?
- getpwuid(atoi(optarg)) : getpwnam(optarg);
- if (pwd == NULL)
- errx(EX_NOUSER, "unknown user '%s'", optarg);
- mdata.uid = pwd->pw_uid;
- uid_set = 1;
- break;
- }
- case 'g': {
- struct group *grp;
-
- grp = isdigit(optarg[0]) ?
- getgrgid(atoi(optarg)) : getgrnam(optarg);
- if (grp == NULL)
- errx(EX_NOUSER, "unknown group '%s'", optarg);
- mdata.gid = grp->gr_gid;
- gid_set = 1;
- break;
- }
- case 'd':
- errno = 0;
- mdata.dir_mode = strtol(optarg, &p, 8);
- if (errno || *p != 0)
- errx(EX_DATAERR, "invalid value for directory mode");
- break;
- case 'f':
- errno = 0;
- mdata.file_mode = strtol(optarg, &p, 8);
- if (errno || *p != 0)
- errx(EX_DATAERR, "invalid value for file mode");
- break;
- case '?':
- usage();
- /*NOTREACHED*/
- case 'n': {
- char *inp, *nsp;
-
- nsp = inp = optarg;
- while ((nsp = strsep(&inp, ",;:")) != NULL) {
- if (strcasecmp(nsp, "OS2") == 0)
- mdata.flags |= NWFS_MOUNT_NO_OS2;
- else if (strcasecmp(nsp, "LONG") == 0)
- mdata.flags |= NWFS_MOUNT_NO_LONG;
- else if (strcasecmp(nsp, "NFS") == 0)
- mdata.flags |= NWFS_MOUNT_NO_NFS;
- else
- errx(EX_DATAERR, "unknown namespace '%s'", nsp);
- }
- break;
- };
- case 'l':
- if (ncp_nls_setlocale(optarg) != 0) return 1;
- mdata.flags |= NWFS_MOUNT_HAVE_NLS;
- break;
- case 'o':
- getmntopts(optarg, mopts, &mntflags, 0);
- break;
- case 'c':
- switch (optarg[0]) {
- case 'l':
- nlsopt |= NWHP_LOWER;
- break;
- case 'u':
- nlsopt |= NWHP_UPPER;
- break;
- case 'n':
- nlsopt |= NWHP_LOWER | NWHP_UPPER;
- break;
- case 'L':
- nlsopt |= NWHP_LOWER | NWHP_NOSTRICT;
- break;
- case 'U':
- nlsopt |= NWHP_UPPER | NWHP_NOSTRICT;
- break;
- default:
- errx(EX_DATAERR, "invalid suboption '%c' for -c",
- optarg[0]);
- }
- break;
- case 'w':
- if (ncp_nls_setrecodebyname(optarg) != 0)
- return 1;
- mdata.flags |= NWFS_MOUNT_HAVE_NLS;
- break;
- default:
- usage();
- }
- }
-
- if (optind == argc - 2) {
- optind++;
- } else if (mdata.mounted_vol[0] == 0)
- errx(EX_USAGE, "volume name should be specified");
-
- if (optind != argc - 1)
- usage();
- realpath(argv[optind], mount_point);
-
- if (stat(mount_point, &st) == -1)
- err(EX_OSERR, "could not find mount point %s", mount_point);
- if (!S_ISDIR(st.st_mode)) {
- errno = ENOTDIR;
- err(EX_OSERR, "can't mount on %s", mount_point);
- }
- if (ncp_geteinfo(mount_point, &einfo) == 0)
- errx(EX_OSERR, "can't mount on %s twice", mount_point);
-
- if (uid_set == 0) {
- mdata.uid = st.st_uid;
- }
- if (gid_set == 0) {
- mdata.gid = st.st_gid;
- }
- if (mdata.file_mode == 0 ) {
- mdata.file_mode = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
- }
- if (mdata.dir_mode == 0) {
- mdata.dir_mode = mdata.file_mode;
- if ((mdata.dir_mode & S_IRUSR) != 0)
- mdata.dir_mode |= S_IXUSR;
- if ((mdata.dir_mode & S_IRGRP) != 0)
- mdata.dir_mode |= S_IXGRP;
- if ((mdata.dir_mode & S_IROTH) != 0)
- mdata.dir_mode |= S_IXOTH;
- }
- if (li.access_mode == 0) {
- li.access_mode = mdata.dir_mode;
- }
-/* if (mdata.flags & NWFS_MOUNT_HAVE_NLS) {*/
- mdata.nls = ncp_nls;
-/* }*/
- mdata.nls.opt = nlsopt;
-
- len = sizeof(wall_clock);
- if (sysctlbyname("machdep.wall_cmos_clock", &wall_clock, &len, NULL, 0) == -1)
- err(EX_OSERR, "get wall_clock");
- if (wall_clock == 0) {
- time(&ltime);
- tm = localtime(&ltime);
- mdata.tz = -(tm->tm_gmtoff / 60);
- }
-
- error = ncp_li_check(&li);
- if (error)
- return 1;
- li.opt |= NCP_OPT_WDOG;
- /* well, now we can try to login, or use already established connection */
- error = ncp_li_login(&li, &connHandle);
- if (error) {
- ncp_error("cannot login to server %s", error, li.server);
- exit(1);
- }
- error = ncp_conn2ref(connHandle, &mdata.connRef);
- if (error) {
- ncp_error("could not convert handle to reference", error);
- ncp_disconnect(connHandle);
- exit(1);
- }
- strcpy(mdata.mount_point,mount_point);
- mdata.version = NWFS_VERSION;
- error = mount(NWFS_VFSNAME, mdata.mount_point, mntflags, (void*)&mdata);
- if (error) {
- ncp_error("mount error: %s", error, mdata.mount_point);
- ncp_disconnect(connHandle);
- exit(1);
- }
- /*
- * I'm leave along my handle, but kernel should keep own ...
- */
- ncp_disconnect(connHandle);
- /* we are done ?, impossible ... */
- return 0;
-}
-
-static void
-usage(void)
-{
- fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
- "usage: mount_nwfs [-Chv] -S server -U user [-connection options]",
- " -V volume [-M mode] [-c case] [-d mode] [-f mode]",
- " [-g gid] [-l locale] [-n os2] [-u uid] [-w scheme]",
- " node",
- " mount_nwfs [-options] /server:user/volume[/path] node");
-
- exit (1);
-}
diff --git a/usr.sbin/pkg/Makefile b/usr.sbin/pkg/Makefile
index 0e1c2d8..d244bd2 100644
--- a/usr.sbin/pkg/Makefile
+++ b/usr.sbin/pkg/Makefile
@@ -4,7 +4,7 @@ PROG= pkg
SRCS= pkg.c dns_utils.c config.c
NO_MAN= yes
-DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBBSDYML} ${LIBSUBF}
+DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBBSDYML} ${LIBSBUF}
LDADD= -larchive -lelf -lfetch -lbsdyml -lsbuf
.include <bsd.prog.mk>
diff --git a/usr.sbin/usbconfig/usbconfig.c b/usr.sbin/usbconfig/usbconfig.c
index a1fa694..c046003 100644
--- a/usr.sbin/usbconfig/usbconfig.c
+++ b/usr.sbin/usbconfig/usbconfig.c
@@ -33,6 +33,7 @@
#include <grp.h>
#include <errno.h>
#include <ctype.h>
+#include <sys/types.h>
#include <libusb20_desc.h>
#include <libusb20.h>
OpenPOWER on IntegriCloud