From f8c7a42d831dbc6ff46a5448591fd28de34b649b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 20 Dec 2006 18:14:44 +0000 Subject: [PATCH] Rename sprintf -> ksprintf Rename snprintf -> knsprintf Make allowances for source files that are compiled for both userland and the kernel. --- sys/bus/cam/cam_periph.c | 4 +- sys/bus/cam/cam_xpt.c | 4 +- sys/bus/cam/scsi/scsi_all.c | 47 +++++----- sys/bus/cam/scsi/scsi_cd.c | 14 +-- sys/bus/cam/scsi/scsi_ch.c | 4 +- sys/bus/cam/scsi/scsi_da.c | 12 +-- sys/bus/cam/scsi/scsi_low.c | 6 +- sys/bus/eisa/eisaconf.c | 28 +++--- sys/bus/firewire/fwcrom.c | 11 +-- sys/bus/isa/isahint.c | 4 +- sys/bus/pccard/pccard.c | 6 +- sys/bus/pci/pci.c | 6 +- sys/bus/pci/pcisupport.c | 10 +-- sys/bus/usb/ehci.c | 4 +- sys/bus/usb/ehci_pci.c | 26 +++--- sys/bus/usb/ohci.c | 4 +- sys/bus/usb/ohci_pci.c | 22 ++--- sys/bus/usb/uhci.c | 4 +- sys/bus/usb/uhci_pci.c | 8 +- sys/bus/usb/uhub.c | 10 +-- sys/bus/usb/usb_subr.c | 24 +++--- sys/contrib/ipfilter/netinet/ip_fil.c | 17 ++-- sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 4 +- sys/contrib/ipfilter/netinet/ip_proxy.c | 6 +- sys/crypto/des/des_ecb.c | 4 +- sys/ddb/db_sym.c | 4 +- sys/dev/acpica5/acpi.c | 18 ++-- sys/dev/acpica5/acpi_cpu.c | 6 +- sys/dev/acpica5/acpi_ec.c | 8 +- sys/dev/acpica5/acpi_pci_link.c | 4 +- sys/dev/acpica5/acpi_thermal.c | 8 +- sys/dev/acpica5/acpi_timer.c | 4 +- sys/dev/atm/hea/eni.c | 4 +- sys/dev/atm/hea/eni_if.c | 4 +- sys/dev/atm/hfa/fore_command.c | 4 +- sys/dev/atm/hfa/fore_if.c | 4 +- sys/dev/atm/hfa/fore_init.c | 4 +- sys/dev/disk/advansys/advansys.c | 4 +- sys/dev/disk/advansys/adwcam.c | 4 +- sys/dev/disk/aha/aha.c | 20 ++--- sys/dev/disk/aic7xxx/aic79xx.c | 13 +-- sys/dev/disk/aic7xxx/aic7xxx.c | 27 +++--- sys/dev/disk/ata/ata-all.c | 4 +- sys/dev/disk/ata/atapi-all.c | 4 +- sys/dev/disk/ata/atapi-cd.c | 4 +- sys/dev/disk/buslogic/bt.c | 8 +- sys/dev/disk/fd/fd.c | 6 +- sys/dev/disk/isp/isp_freebsd.h | 4 +- sys/dev/disk/isp/ispvar.h | 4 +- sys/dev/disk/mpt/mpt_debug.c | 18 ++-- sys/dev/disk/nata/ata-all.c | 4 +- sys/dev/disk/nata/ata-chipset.c | 36 ++++---- sys/dev/disk/nata/ata-pci.c | 4 +- sys/dev/disk/nata/ata-queue.c | 6 +- sys/dev/disk/nata/ata-raid.c | 30 +++---- sys/dev/disk/nata/ata-usb.c | 4 +- sys/dev/disk/nata/atapi-cd.c | 4 +- sys/dev/disk/nata/atapi-fd.c | 6 +- sys/dev/disk/ncr/ncr.c | 4 +- sys/dev/disk/sbp/sbp.c | 4 +- sys/dev/disk/sym/sym_hipd.c | 4 +- sys/dev/drm/drm_os_freebsd.h | 6 +- sys/dev/misc/dcons/dcons_os.c | 6 +- sys/dev/misc/musycc/musycc.c | 86 +++++++++---------- sys/dev/misc/syscons/daemon/daemon_saver.c | 4 +- sys/dev/misc/syscons/fred/fred_saver.c | 4 +- sys/dev/misc/syscons/snake/snake_saver.c | 4 +- sys/dev/netif/an/if_an.c | 4 +- sys/dev/netif/ar/if_ar.c | 12 +-- sys/dev/netif/ath/hal/ah_osdep.c.patch | 4 +- sys/dev/netif/bge/if_bge.c | 4 +- sys/dev/netif/em/if_em.c | 4 +- sys/dev/netif/en_pci/if_en_pci.c | 4 +- sys/dev/netif/fwe/if_fwe.c | 4 +- sys/dev/netif/mn/if_mn.c | 62 ++++++------- sys/dev/netif/rtw/rtw.c | 4 +- sys/dev/netif/sk/if_sk.c | 4 +- sys/dev/netif/sr/if_sr.c | 10 +-- sys/dev/pccard/cardbus/cardbus.c | 6 +- sys/dev/raid/ciss/ciss.c | 4 +- sys/dev/raid/dpt/dpt_control.c | 14 +-- sys/dev/raid/iir/iir.c | 4 +- sys/dev/raid/ips/ips.c | 4 +- sys/dev/raid/mlx/mlx.c | 6 +- sys/dev/raid/mly/mly_cam.c | 4 +- sys/dev/raid/pst/pst-raid.c | 4 +- sys/dev/raid/twe/twe.c | 10 +-- sys/dev/raid/twe/twe_freebsd.c | 4 +- sys/dev/raid/vinum/vinumconfig.c | 6 +- sys/dev/raid/vinum/vinumio.c | 30 +++---- sys/dev/raid/vinum/vinumrevive.c | 4 +- sys/dev/raid/vinum/vinumstate.c | 8 +- sys/dev/raid/vinum/vinumutil.c | 6 +- sys/dev/sound/isa/ad1816.c | 8 +- sys/dev/sound/isa/ess.c | 10 +-- sys/dev/sound/isa/mss.c | 8 +- sys/dev/sound/isa/sb16.c | 10 +-- sys/dev/sound/isa/sb8.c | 8 +- sys/dev/sound/pci/als4000.c | 6 +- sys/dev/sound/pci/aureal.c | 6 +- sys/dev/sound/pci/cmi.c | 6 +- sys/dev/sound/pci/cs4281.c | 6 +- sys/dev/sound/pci/csapcm.c | 6 +- sys/dev/sound/pci/ds1.c | 6 +- sys/dev/sound/pci/emu10k1.c | 6 +- sys/dev/sound/pci/es137x.c | 6 +- sys/dev/sound/pci/fm801.c | 6 +- sys/dev/sound/pci/ich.c | 6 +- sys/dev/sound/pci/maestro.c | 6 +- sys/dev/sound/pci/maestro3.c | 6 +- sys/dev/sound/pci/neomagic.c | 6 +- sys/dev/sound/pci/solo.c | 6 +- sys/dev/sound/pci/t4dwave.c | 6 +- sys/dev/sound/pci/via8233.c | 6 +- sys/dev/sound/pci/via82c686.c | 6 +- sys/dev/sound/pci/vibes.c | 6 +- sys/dev/sound/pcm/ac97.c | 12 +-- sys/dev/sound/pcm/buffer.c | 6 +- sys/dev/sound/pcm/fake.c | 6 +- sys/dev/sound/pcm/mixer.c | 6 +- sys/dev/sound/pcm/sound.c | 6 +- sys/dev/sound/usb/uaudio.c | 30 +++---- sys/dev/sound/usb/uaudio_pcm.c | 4 +- sys/dev/usbmisc/udbp/udbp.c | 6 +- sys/dev/usbmisc/umass/umass.c | 8 +- sys/dev/video/bktr/bktr_audio.c | 6 +- sys/dev/video/bktr/bktr_os.c | 4 +- sys/dev/video/bktr/msp34xx.c | 6 +- sys/dev/video/gsc/gsc.c | 4 +- .../linux/i386/linprocfs/linprocfs_misc.c | 28 +++--- .../linux/i386/linprocfs/linprocfs_vnops.c | 8 +- sys/emulation/linux/linux_ioctl.c | 6 +- sys/emulation/ndis/kern_ndis.c | 10 +-- sys/emulation/ndis/subr_ndis.c | 8 +- sys/emulation/ndis/subr_ntoskrnl.c | 8 +- sys/kern/imgact_elf.c | 4 +- sys/kern/kern_checkpoint.c | 6 +- sys/kern/kern_conf.c | 10 +-- sys/kern/kern_firmware.c | 4 +- sys/kern/kern_intr.c | 6 +- sys/kern/kern_linker.c | 6 +- sys/kern/kern_sig.c | 6 +- sys/kern/kern_sysctl.c | 4 +- sys/kern/link_elf.c | 6 +- sys/kern/lwkt_caps.c | 4 +- sys/kern/subr_bus.c | 4 +- sys/kern/subr_diskmbr.c | 4 +- sys/kern/subr_diskslice.c | 6 +- sys/kern/subr_prf.c | 33 +------ sys/kern/tty.c | 4 +- sys/kern/vfs_conf.c | 4 +- sys/libkern/inet_ntoa.c | 12 +-- sys/net/ef/if_ef.c | 4 +- sys/net/i4b/driver/i4b_ing.c | 10 +-- sys/net/i4b/layer3/i4b_q931.c | 4 +- sys/net/if.c | 6 +- sys/net/ip6fw/ip6_fw.c | 42 ++++----- sys/net/ipfw/ip_fw.c | 52 +++++------ sys/net/ipfw/ip_fw2.c | 46 +++++----- sys/net/pf/pf_if.c | 4 +- sys/net/sppp/if_spppsubr.c | 16 ++-- sys/net/tap/if_tap.c | 6 +- sys/net/tun/if_tun.c | 4 +- sys/netgraph/bridge/ng_bridge.c | 8 +- sys/netgraph/cisco/ng_cisco.c | 6 +- sys/netgraph/eiface/ng_eiface.c | 6 +- sys/netgraph/ether/ng_ether.c | 4 +- sys/netgraph/fec/ng_fec.c | 4 +- sys/netgraph/ksocket/ng_ksocket.c | 10 +-- sys/netgraph/lmi/ng_lmi.c | 20 ++--- sys/netgraph/netgraph/ng_base.c | 12 +-- sys/netgraph/netgraph/ng_parse.c | 6 +- sys/netgraph/ng_device.c | 4 +- sys/netgraph/ppp/ng_ppp.c | 4 +- sys/netgraph/tty/ng_tty.c | 4 +- sys/netinet/ip_divert.c | 4 +- sys/netinet6/icmp6.c | 4 +- sys/netinet6/ipsec.c | 28 +++--- .../802_11/wlan/ieee80211_dragonfly.c | 4 +- sys/netproto/atalk/at_rmx.c | 6 +- sys/netproto/atm/atm_device.c | 4 +- sys/netproto/atm/atm_if.c | 12 +-- sys/netproto/atm/atm_socket.c | 4 +- sys/netproto/atm/sigpvc/sigpvc_if.c | 4 +- sys/netproto/atm/spans/spans_cls.c | 4 +- sys/netproto/atm/spans/spans_if.c | 4 +- sys/netproto/atm/spans/spans_print.c | 22 ++--- sys/netproto/atm/spans/spans_util.c | 4 +- sys/netproto/atm/uni/sscf_uni.c | 4 +- sys/netproto/atm/uni/sscop_pdu.c | 4 +- sys/netproto/atm/uni/uniarp_input.c | 4 +- sys/netproto/atm/uni/unisig_if.c | 4 +- sys/netproto/atm/uni/unisig_util.c | 8 +- sys/netproto/ipsec/ipsec.c | 8 +- sys/netproto/ipx/ipx.c | 10 +-- sys/netproto/natm/natm.c | 4 +- sys/netproto/smb/smb_conn.c | 8 +- sys/platform/pc32/i386/autoconf.c | 6 +- sys/platform/pc32/i386/est.c | 4 +- sys/platform/pc32/i386/userconfig.c | 36 ++++---- sys/platform/pc32/isa/asc.c | 4 +- sys/platform/pc32/isa/clock.c | 4 +- sys/platform/vkernel/i386/autoconf.c | 6 +- sys/sys/systm.h | 4 +- sys/vfs/fdesc/fdesc_vnops.c | 4 +- sys/vfs/nfs/bootp_subr.c | 6 +- sys/vfs/nfs/nfs_vfsops.c | 6 +- sys/vfs/nfs/nfs_vnops.c | 4 +- sys/vfs/procfs/procfs_map.c | 4 +- sys/vfs/procfs/procfs_rlimit.c | 12 +-- sys/vfs/procfs/procfs_status.c | 30 +++---- sys/vfs/procfs/procfs_vnops.c | 8 +- sys/vm/vm_zone.c | 6 +- 213 files changed, 971 insertions(+), 987 deletions(-) diff --git a/sys/bus/cam/cam_periph.c b/sys/bus/cam/cam_periph.c index 0dccf3c752..cc4254ece5 100644 --- a/sys/bus/cam/cam_periph.c +++ b/sys/bus/cam/cam_periph.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/cam_periph.c,v 1.24.2.3 2003/01/25 19:04:40 dillon Exp $ - * $DragonFly: src/sys/bus/cam/cam_periph.c,v 1.16 2006/09/05 00:55:31 dillon Exp $ + * $DragonFly: src/sys/bus/cam/cam_periph.c,v 1.17 2006/12/20 18:14:33 dillon Exp $ */ #include @@ -319,7 +319,7 @@ camperiphunit(struct periph_driver *p_drv, path_id_t pathid, unit = 0; periph_name = p_drv->driver_name; - snprintf(pathbuf, sizeof(pathbuf), "scbus%d", pathid); + ksnprintf(pathbuf, sizeof(pathbuf), "scbus%d", pathid); i = -1; for (hit = 0; (i = resource_locate(i, periph_name)) != -1; hit = 0) { dname = resource_query_name(i); diff --git a/sys/bus/cam/cam_xpt.c b/sys/bus/cam/cam_xpt.c index dc4a71e3a6..1931836c20 100644 --- a/sys/bus/cam/cam_xpt.c +++ b/sys/bus/cam/cam_xpt.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/cam_xpt.c,v 1.80.2.18 2002/12/09 17:31:55 gibbs Exp $ - * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.32 2006/11/07 18:49:57 dillon Exp $ + * $DragonFly: src/sys/bus/cam/cam_xpt.c,v 1.33 2006/12/20 18:14:33 dillon Exp $ */ #include #include @@ -4085,7 +4085,7 @@ xptpathid(const char *sim_name, int sim_unit, int sim_bus) char buf[32], *strval; pathid = CAM_XPT_PATH_ID; - snprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit); + ksnprintf(buf, sizeof(buf), "%s%d", sim_name, sim_unit); i = -1; while ((i = resource_locate(i, "scbus")) != -1) { dunit = resource_query_unit(i); diff --git a/sys/bus/cam/scsi/scsi_all.c b/sys/bus/cam/scsi/scsi_all.c index 4e7e41fe2d..b548915b32 100644 --- a/sys/bus/cam/scsi/scsi_all.c +++ b/sys/bus/cam/scsi/scsi_all.c @@ -27,19 +27,24 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/scsi/scsi_all.c,v 1.14.2.11 2003/10/30 15:06:35 thomas Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_all.c,v 1.5 2005/03/15 20:42:14 dillon Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_all.c,v 1.6 2006/12/20 18:14:34 dillon Exp $ */ #include #ifdef _KERNEL -#include +#include #include + #else + #include #include #include + +#define ksnprintf snprintf /* ick, userland uses us too */ + #endif #include "../cam.h" @@ -1605,7 +1610,7 @@ scsi_cdb_string(u_int8_t *cdb_ptr, char *cdb_string, size_t len) } *cdb_string = '\0'; for (i = 0; i < cdb_len; i++) - snprintf(cdb_string + strlen(cdb_string), + ksnprintf(cdb_string + strlen(cdb_string), len - strlen(cdb_string), "%x ", cdb_ptr[i]); return(cdb_string); @@ -1831,7 +1836,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, if (command_print != 0) { char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; - retlen = snprintf(tmpstr, tmpstrlen, "%s", path_str); + retlen = ksnprintf(tmpstr, tmpstrlen, "%s", path_str); if ((tmplen = str_len - cur_len - 1) < 0) goto sst_bailout; @@ -1841,14 +1846,14 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, str[str_len - 1] = '\0'; if ((csio->ccb_h.flags & CAM_CDB_POINTER) != 0) { - retlen = snprintf(tmpstr, tmpstrlen, "%s. CDB: %s\n", + retlen = ksnprintf(tmpstr, tmpstrlen, "%s. CDB: %s\n", scsi_op_desc(csio->cdb_io.cdb_ptr[0], &device->inq_data), scsi_cdb_string(csio->cdb_io.cdb_ptr, cdb_str, sizeof(cdb_str))); } else { - retlen = snprintf(tmpstr, tmpstrlen, "%s. CDB: %s\n", + retlen = ksnprintf(tmpstr, tmpstrlen, "%s. CDB: %s\n", scsi_op_desc(csio->cdb_io.cdb_bytes[0], &device->inq_data), scsi_cdb_string( csio->cdb_io.cdb_bytes, cdb_str, @@ -1893,7 +1898,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, } - retlen = snprintf(tmpstr, tmpstrlen, "%s", path_str); + retlen = ksnprintf(tmpstr, tmpstrlen, "%s", path_str); if ((tmplen = str_len - cur_len - 1) < 0) goto sst_bailout; @@ -1907,7 +1912,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, switch (error_code) { case SSD_DEFERRED_ERROR: - retlen = snprintf(tmpstr, tmpstrlen, "Deferred Error: "); + retlen = ksnprintf(tmpstr, tmpstrlen, "Deferred Error: "); if ((tmplen = str_len - cur_len - 1) < 0) goto sst_bailout; @@ -1918,7 +1923,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, /* FALLTHROUGH */ case SSD_CURRENT_ERROR: - retlen = snprintf(tmpstr, tmpstrlen, "%s", + retlen = ksnprintf(tmpstr, tmpstrlen, "%s", scsi_sense_key_text[sense_key]); if ((tmplen = str_len - cur_len - 1) < 0) @@ -1939,7 +1944,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, case SSD_KEY_DATA_PROTECT: break; case SSD_KEY_BLANK_CHECK: - retlen = snprintf(tmpstr, tmpstrlen, + retlen = ksnprintf(tmpstr, tmpstrlen, " req sz: %d (decimal)", info); @@ -1953,13 +1958,13 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, default: if (info) { if (sense->flags & SSD_ILI) { - retlen = snprintf (tmpstr, + retlen = ksnprintf (tmpstr, tmpstrlen, " ILI (length " "mismatch): %d", info); } else { - retlen = snprintf(tmpstr, + retlen = ksnprintf(tmpstr, tmpstrlen, " info:%x", info); @@ -1974,7 +1979,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, } } } else if (info) { - retlen = snprintf(tmpstr, tmpstrlen," info?:%x", info); + retlen = ksnprintf(tmpstr, tmpstrlen," info?:%x", info); if ((tmplen = str_len - cur_len -1) < 0) goto sst_bailout; @@ -1986,7 +1991,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, if (sense->extra_len >= 4) { if (bcmp(sense->cmd_spec_info, "\0\0\0\0", 4)) { - retlen = snprintf(tmpstr, tmpstrlen, + retlen = ksnprintf(tmpstr, tmpstrlen, " csi:%x,%x,%x,%x", sense->cmd_spec_info[0], sense->cmd_spec_info[1], @@ -2008,7 +2013,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, if (asc || ascq) { const char *desc = scsi_sense_desc(asc, ascq, &device->inq_data); - retlen = snprintf(tmpstr, tmpstrlen, + retlen = ksnprintf(tmpstr, tmpstrlen, " asc:%x,%x\n%s%s", asc, ascq, path_str, desc); @@ -2021,7 +2026,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, } if (sense->extra_len >= 7 && sense->fru) { - retlen = snprintf(tmpstr, tmpstrlen, + retlen = ksnprintf(tmpstr, tmpstrlen, " field replaceable unit: %x", sense->fru); @@ -2035,7 +2040,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, if ((sense->extra_len >= 10) && (sense->sense_key_spec[0] & SSD_SCS_VALID) != 0) { - retlen = snprintf(tmpstr, tmpstrlen, " sks:%x,%x", + retlen = ksnprintf(tmpstr, tmpstrlen, " sks:%x,%x", sense->sense_key_spec[0], scsi_2btoul(&sense->sense_key_spec[1])); @@ -2049,7 +2054,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, break; default: - retlen = snprintf(tmpstr, tmpstrlen, "error code %d", + retlen = ksnprintf(tmpstr, tmpstrlen, "error code %d", sense->error_code & SSD_ERRCODE); if ((tmplen = str_len - cur_len -1) < 0) @@ -2060,7 +2065,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, str[str_len - 1] = '\0'; if (sense->error_code & SSD_ERRCODE_VALID) { - retlen = snprintf(tmpstr, tmpstrlen, + retlen = ksnprintf(tmpstr, tmpstrlen, " at block no. %d (decimal)", info = scsi_4btoul(sense->info)); @@ -2073,7 +2078,7 @@ scsi_sense_string(struct cam_device *device, struct ccb_scsiio *csio, } } - retlen = snprintf(tmpstr, tmpstrlen, "\n"); + retlen = ksnprintf(tmpstr, tmpstrlen, "\n"); if ((tmplen = str_len - cur_len -1) < 0) goto sst_bailout; @@ -2397,7 +2402,7 @@ scsi_print_inquiry(struct scsi_inquiry_data *inq_data) if (SID_ANSI_REV(inq_data) == SCSI_REV_CCS) bcopy("CCS", rstr, 4); else - snprintf(rstr, sizeof (rstr), "%d", SID_ANSI_REV(inq_data)); + ksnprintf(rstr, sizeof (rstr), "%d", SID_ANSI_REV(inq_data)); printf("<%s %s %s> %s %s SCSI-%s device %s\n", vendor, product, revision, SID_IS_REMOVABLE(inq_data) ? "Removable" : "Fixed", diff --git a/sys/bus/cam/scsi/scsi_cd.c b/sys/bus/cam/scsi/scsi_cd.c index a6bc633df2..dbd613f8f0 100644 --- a/sys/bus/cam/scsi/scsi_cd.c +++ b/sys/bus/cam/scsi/scsi_cd.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/scsi/scsi_cd.c,v 1.31.2.16 2003/10/21 22:26:11 thomas Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_cd.c,v 1.25 2006/09/10 01:26:32 dillon Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_cd.c,v 1.26 2006/12/20 18:14:34 dillon Exp $ */ /* * Portions of this driver taken from the original FreeBSD cd driver. @@ -613,8 +613,8 @@ cdsysctlinit(void *context, int pending) periph = (struct cam_periph *)context; softc = (struct cd_softc *)periph->softc; - snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number); - snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); + ksnprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number); + ksnprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); sysctl_ctx_init(&softc->sysctl_ctx); softc->flags |= CD_FLAG_SCTX_INIT; @@ -740,7 +740,7 @@ cdregister(struct cam_periph *periph, void *arg) /* * Load the user's default, if any. */ - snprintf(tmpstr, sizeof(tmpstr), "kern.cam.cd.%d.minimum_cmd_size", + ksnprintf(tmpstr, sizeof(tmpstr), "kern.cam.cd.%d.minimum_cmd_size", periph->unit_number); TUNABLE_INT_FETCH(tmpstr, &softc->minimum_command_size); @@ -1729,7 +1729,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { - snprintf(announce_buf, sizeof(announce_buf), + ksnprintf(announce_buf, sizeof(announce_buf), "cd present [%lu x %lu byte records]", cdp->disksize, (u_long)cdp->blksize); @@ -1792,7 +1792,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) */ if ((have_sense) && (asc != 0x25) && (error_code == SSD_CURRENT_ERROR)) - snprintf(announce_buf, + ksnprintf(announce_buf, sizeof(announce_buf), "Attempt to query device " "size failed: %s, %s", @@ -1804,7 +1804,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) CAM_SCSI_STATUS_ERROR) && (csio->scsi_status == SCSI_STATUS_BUSY)) { - snprintf(announce_buf, + ksnprintf(announce_buf, sizeof(announce_buf), "Attempt to query device " "size failed: SCSI status: BUSY"); diff --git a/sys/bus/cam/scsi/scsi_ch.c b/sys/bus/cam/scsi/scsi_ch.c index 6a6b42d6ed..8d28d06fc2 100644 --- a/sys/bus/cam/scsi/scsi_ch.c +++ b/sys/bus/cam/scsi/scsi_ch.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/scsi/scsi_ch.c,v 1.20.2.2 2000/10/31 08:09:49 dwmalone Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_ch.c,v 1.17 2006/09/10 01:26:32 dillon Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_ch.c,v 1.18 2006/12/20 18:14:34 dillon Exp $ */ /* * Derived from the NetBSD SCSI changer driver. @@ -582,7 +582,7 @@ chdone(struct cam_periph *periph, union ccb *done_ccb) softc->sc_picker = softc->sc_firsts[CHET_MT]; #define PLURAL(c) (c) == 1 ? "" : "s" - snprintf(announce_buf, sizeof(announce_buf), + ksnprintf(announce_buf, sizeof(announce_buf), "%d slot%s, %d drive%s, " "%d picker%s, %d portal%s", softc->sc_counts[CHET_ST], diff --git a/sys/bus/cam/scsi/scsi_da.c b/sys/bus/cam/scsi/scsi_da.c index e25099f10c..e4c8a31ce4 100644 --- a/sys/bus/cam/scsi/scsi_da.c +++ b/sys/bus/cam/scsi/scsi_da.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/cam/scsi/scsi_da.c,v 1.42.2.46 2003/10/21 22:18:19 thomas Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_da.c,v 1.32 2006/09/10 01:26:32 dillon Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_da.c,v 1.33 2006/12/20 18:14:34 dillon Exp $ */ #ifdef _KERNEL @@ -1155,8 +1155,8 @@ dasysctlinit(void *context, int pending) periph = (struct cam_periph *)context; softc = (struct da_softc *)periph->softc; - snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); - snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); + ksnprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); + ksnprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); sysctl_ctx_init(&softc->sysctl_ctx); softc->flags |= DA_FLAG_SCTX_INIT; @@ -1277,7 +1277,7 @@ daregister(struct cam_periph *periph, void *arg) /* * Load the user's default, if any. */ - snprintf(tmpstr, sizeof(tmpstr), "kern.cam.da.%d.minimum_cmd_size", + ksnprintf(tmpstr, sizeof(tmpstr), "kern.cam.da.%d.minimum_cmd_size", periph->unit_number); TUNABLE_INT_FETCH(tmpstr, &softc->minimum_cmd_size); @@ -1620,7 +1620,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) dasetgeom(periph, rdcap); dp = &softc->params; - snprintf(announce_buf, sizeof(announce_buf), + ksnprintf(announce_buf, sizeof(announce_buf), "%luMB (%u %u byte sectors: %dH %dS/T %dC)", (unsigned long) (((u_int64_t)dp->secsize * dp->sectors) / (1024*1024)), dp->sectors, @@ -1687,7 +1687,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) */ if ((have_sense) && (asc != 0x25) && (error_code == SSD_CURRENT_ERROR)) - snprintf(announce_buf, + ksnprintf(announce_buf, sizeof(announce_buf), "Attempt to query device " "size failed: %s, %s", diff --git a/sys/bus/cam/scsi/scsi_low.c b/sys/bus/cam/scsi/scsi_low.c index 65ed4fc467..efae248797 100644 --- a/sys/bus/cam/scsi/scsi_low.c +++ b/sys/bus/cam/scsi/scsi_low.c @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/cam/scsi/scsi_low.c,v 1.1.2.5 2003/08/09 06:18:30 non Exp $ - * $DragonFly: src/sys/bus/cam/scsi/scsi_low.c,v 1.16 2006/09/05 00:55:32 dillon Exp $ + * $DragonFly: src/sys/bus/cam/scsi/scsi_low.c,v 1.17 2006/12/20 18:14:34 dillon Exp $ * $NetBSD: scsi_low.c,v 1.24.10.8 2001/06/26 07:39:44 honda Exp $ */ @@ -830,8 +830,8 @@ scsi_low_attach_cam(struct scsi_low_softc *slp) struct cam_devq *devq; int tagged_openings; - sprintf(slp->sl_xname, "%s%d", - DEVPORT_DEVNAME(slp->sl_dev), DEVPORT_DEVUNIT(slp->sl_dev)); + ksprintf(slp->sl_xname, "%s%d", + DEVPORT_DEVNAME(slp->sl_dev), DEVPORT_DEVUNIT(slp->sl_dev)); devq = cam_simq_alloc(SCSI_LOW_NCCB); if (devq == NULL) diff --git a/sys/bus/eisa/eisaconf.c b/sys/bus/eisa/eisaconf.c index c51805e825..34891ebe7d 100644 --- a/sys/bus/eisa/eisaconf.c +++ b/sys/bus/eisa/eisaconf.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/eisa/eisaconf.c,v 1.55 2000/01/14 07:13:57 peter Exp $ - * $DragonFly: src/sys/bus/eisa/eisaconf.c,v 1.9 2006/10/25 20:55:51 dillon Exp $ + * $DragonFly: src/sys/bus/eisa/eisaconf.c,v 1.10 2006/12/20 18:14:35 dillon Exp $ */ #include "opt_eisa.h" @@ -105,12 +105,12 @@ mainboard_probe(device_t dev) idstring = kmalloc(8 + sizeof(" (System Board)") + 1, M_DEVBUF, M_INTWAIT); - sprintf(idstring, "%c%c%c%03x%01x (System Board)", - EISA_MFCTR_CHAR0(id), - EISA_MFCTR_CHAR1(id), - EISA_MFCTR_CHAR2(id), - EISA_PRODUCT_ID(id), - EISA_REVISION_ID(id)); + ksprintf(idstring, "%c%c%c%03x%01x (System Board)", + EISA_MFCTR_CHAR0(id), + EISA_MFCTR_CHAR1(id), + EISA_MFCTR_CHAR2(id), + EISA_PRODUCT_ID(id), + EISA_REVISION_ID(id)); device_set_desc(dev, idstring); return (0); @@ -252,7 +252,7 @@ eisa_print_child(device_t dev, device_t child) int retval = 0; if (device_get_desc(child)) { - snprintf(buf, sizeof(buf), "<%s>", device_get_desc(child)); + ksnprintf(buf, sizeof(buf), "<%s>", device_get_desc(child)); eisa_reg_print(child, buf, NULL, &column); } @@ -260,11 +260,11 @@ eisa_print_child(device_t dev, device_t child) while ((resv = eisa_find_ioaddr(e_dev, rid++))) { if ((resv->size == 1) || (resv->flags & RESVADDR_BITMASK)) { - snprintf(buf, sizeof(buf), "%s%lx", + ksnprintf(buf, sizeof(buf), "%s%lx", ((rid == 1) ? "at 0x" : "0x"), resv->addr); } else { - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", + ksnprintf(buf, sizeof(buf), "%s%lx-0x%lx", ((rid == 1) ? "at 0x" : "0x"), resv->addr, (resv->addr + (resv->size - 1))); @@ -277,11 +277,11 @@ eisa_print_child(device_t dev, device_t child) while ((resv = eisa_find_maddr(e_dev, rid++))) { if ((resv->size == 1) || (resv->flags & RESVADDR_BITMASK)) { - snprintf(buf, sizeof(buf), "%s%lx", + ksnprintf(buf, sizeof(buf), "%s%lx", ((rid == 1) ? "at 0x" : "0x"), resv->addr); } else { - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", + ksnprintf(buf, sizeof(buf), "%s%lx-0x%lx", ((rid == 1) ? "at 0x" : "0x"), resv->addr, (resv->addr + (resv->size - 1))); @@ -292,13 +292,13 @@ eisa_print_child(device_t dev, device_t child) rid = 0; while ((irq = eisa_find_irq(e_dev, rid++)) != NULL) { - snprintf(buf, sizeof(buf), "irq %d (%s)", irq->irq_no, + ksnprintf(buf, sizeof(buf), "irq %d (%s)", irq->irq_no, (irq->irq_trigger ? "level" : "edge")); eisa_reg_print(child, buf, ((rid == 1) ? &separator : NULL), &column); } - snprintf(buf, sizeof(buf), "on %s slot %d\n", + ksnprintf(buf, sizeof(buf), "on %s slot %d\n", device_get_nameunit(dev), eisa_get_slot(child)); eisa_reg_print(child, buf, NULL, &column); diff --git a/sys/bus/firewire/fwcrom.c b/sys/bus/firewire/fwcrom.c index 966c23cbe7..cbe93821e4 100644 --- a/sys/bus/firewire/fwcrom.c +++ b/sys/bus/firewire/fwcrom.c @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/bus/firewire/fwcrom.c,v 1.7 2006/01/22 14:03:51 swildner Exp $ + * $DragonFly: src/sys/bus/firewire/fwcrom.c,v 1.8 2006/12/20 18:14:36 dillon Exp $ */ #ifndef __DragonFly__ @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD: src/sys/dev/firewire/fwcrom.c,v 1.9 2003/10/02 04:06:55 simo #include #include #include +#define ksnprintf snprintf /* sigh. used by fwcontrol */ #endif #ifdef __DragonFly__ @@ -299,7 +300,7 @@ crom_desc_specver(u_int32_t spec, u_int32_t ver, char *buf, int len) } } if (s != NULL) - snprintf(buf, len, "%s", s); + ksnprintf(buf, len, "%s", s); } char * @@ -314,14 +315,14 @@ crom_desc(struct crom_context *cc, char *buf, int len) switch (reg->key & CSRTYPE_MASK) { case CSRTYPE_I: #if 0 - len -= snprintf(buf, len, "%d", reg->val); + len -= ksnprintf(buf, len, "%d", reg->val); buf += strlen(buf); #else *buf = '\0'; #endif break; case CSRTYPE_C: - len -= snprintf(buf, len, "offset=0x%04x(%d)", + len -= ksnprintf(buf, len, "offset=0x%04x(%d)", reg->val, reg->val); buf += strlen(buf); break; @@ -330,7 +331,7 @@ crom_desc(struct crom_context *cc, char *buf, int len) case CSRTYPE_D: dir = (struct csrdirectory *) (reg + reg->val); crc = crom_crc((u_int32_t *)&dir->entry[0], dir->crc_len); - len -= snprintf(buf, len, "len=%d crc=0x%04x(%s) ", + len -= ksnprintf(buf, len, "len=%d crc=0x%04x(%s) ", dir->crc_len, dir->crc, (crc == dir->crc) ? "OK" : "NG"); buf += strlen(buf); diff --git a/sys/bus/isa/isahint.c b/sys/bus/isa/isahint.c index cdff93f35b..b471cdf234 100644 --- a/sys/bus/isa/isahint.c +++ b/sys/bus/isa/isahint.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/isa/isahint.c,v 1.8.2.1 2001/03/21 11:18:25 nyan Exp $ - * $DragonFly: src/sys/bus/isa/isahint.c,v 1.6 2006/10/25 20:55:51 dillon Exp $ + * $DragonFly: src/sys/bus/isa/isahint.c,v 1.7 2006/12/20 18:14:37 dillon Exp $ */ #include @@ -100,7 +100,7 @@ isahint_identify(driver_t *driver, device_t parent) /* * Add all devices configured to be attached to parent. */ - sprintf(buf, "isa%d", device_get_unit(parent)); + ksprintf(buf, "isa%d", device_get_unit(parent)); for (i = resource_query_string(-1, "at", buf); i != -1; i = resource_query_string(i, "at", buf)) { diff --git a/sys/bus/pccard/pccard.c b/sys/bus/pccard/pccard.c index 81510c4f06..a3e76af4c9 100644 --- a/sys/bus/pccard/pccard.c +++ b/sys/bus/pccard/pccard.c @@ -1,6 +1,6 @@ /* $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $ */ /* $FreeBSD: src/sys/dev/pccard/pccard.c,v 1.70 2002/11/14 14:02:32 mux Exp $ */ -/* $DragonFly: src/sys/bus/pccard/pccard.c,v 1.17 2006/10/25 20:55:51 dillon Exp $ */ +/* $DragonFly: src/sys/bus/pccard/pccard.c,v 1.18 2006/12/20 18:14:37 dillon Exp $ */ /* * Copyright (c) 1997 Marc Horowitz. All rights reserved. @@ -963,7 +963,7 @@ pccard_child_location_str(device_t bus, device_t child, char *buf, struct pccard_ivar *devi = PCCARD_IVAR(child); struct pccard_function *func = devi->fcn; - snprintf(buf, buflen, "function=%d", func->number); + ksnprintf(buf, buflen, "function=%d", func->number); return (0); } @@ -975,7 +975,7 @@ pccard_child_pnpinfo_str(device_t bus, device_t child, char *buf, struct pccard_function *func = devi->fcn; struct pccard_softc *sc = PCCARD_SOFTC(bus); - snprintf(buf, buflen, "manufacturer=0x%04x product=0x%04x " + ksnprintf(buf, buflen, "manufacturer=0x%04x product=0x%04x " "cisvendor=\"%s\" cisproduct=\"%s\" function_type=%d", sc->card.manufacturer, sc->card.product, sc->card.cis1_info[0], sc->card.cis1_info[1], func->function); diff --git a/sys/bus/pci/pci.c b/sys/bus/pci/pci.c index 82042a09c8..ec778a67be 100644 --- a/sys/bus/pci/pci.c +++ b/sys/bus/pci/pci.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/pci.c,v 1.141.2.15 2002/04/30 17:48:18 tmm Exp $ - * $DragonFly: src/sys/bus/pci/pci.c,v 1.33 2006/10/25 20:55:51 dillon Exp $ + * $DragonFly: src/sys/bus/pci/pci.c,v 1.34 2006/12/20 18:14:37 dillon Exp $ * */ @@ -1815,7 +1815,7 @@ pci_child_location_str_method(device_t cbdev, device_t child, char *buf, struct pci_devinfo *dinfo; dinfo = device_get_ivars(child); - snprintf(buf, buflen, "slot=%d function=%d", pci_get_slot(child), + ksnprintf(buf, buflen, "slot=%d function=%d", pci_get_slot(child), pci_get_function(child)); return (0); } @@ -1829,7 +1829,7 @@ pci_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, dinfo = device_get_ivars(child); cfg = &dinfo->cfg; - snprintf(buf, buflen, "vendor=0x%04x device=0x%04x subvendor=0x%04x " + ksnprintf(buf, buflen, "vendor=0x%04x device=0x%04x subvendor=0x%04x " "subdevice=0x%04x class=0x%02x%02x%02x", cfg->vendor, cfg->device, cfg->subvendor, cfg->subdevice, cfg->baseclass, cfg->subclass, cfg->progif); diff --git a/sys/bus/pci/pcisupport.c b/sys/bus/pci/pcisupport.c index 635873d109..bf98af403e 100644 --- a/sys/bus/pci/pcisupport.c +++ b/sys/bus/pci/pcisupport.c @@ -1,7 +1,7 @@ /************************************************************************** ** ** $FreeBSD: src/sys/pci/pcisupport.c,v 1.154.2.15 2003/04/29 15:55:06 simokawa Exp $ -** $DragonFly: src/sys/bus/pci/pcisupport.c,v 1.18 2006/10/25 20:55:51 dillon Exp $ +** $DragonFly: src/sys/bus/pci/pcisupport.c,v 1.19 2006/12/20 18:14:37 dillon Exp $ ** ** Device driver for DEC/INTEL PCI chipsets. ** @@ -121,11 +121,11 @@ pci_bridge_type(device_t dev) case PCIS_BRIDGE_CARDBUS: strcpy(tmpbuf, "PCI to CardBus"); break; case PCIS_BRIDGE_OTHER: strcpy(tmpbuf, "PCI to Other"); break; default: - snprintf(tmpbuf, sizeof(tmpbuf), + ksnprintf(tmpbuf, sizeof(tmpbuf), "PCI to 0x%x", pci_get_subclass(dev)); break; } - snprintf(tmpbuf+strlen(tmpbuf), sizeof(tmpbuf)-strlen(tmpbuf), + ksnprintf(tmpbuf+strlen(tmpbuf), sizeof(tmpbuf)-strlen(tmpbuf), " bridge (vendor=%04x device=%04x)", pci_get_vendor(dev), pci_get_device(dev)); descr = kmalloc (strlen(tmpbuf) +1, M_DEVBUF, M_WAITOK); @@ -889,7 +889,7 @@ pci_vga_match(device_t dev) len = strlen(vendor) + strlen(chip) + strlen(type) + 4; MALLOC(buf, char *, len, M_TEMP, M_WAITOK); - sprintf(buf, "%s %s %s", vendor, chip, type); + ksprintf(buf, "%s %s %s", vendor, chip, type); return buf; } @@ -934,7 +934,7 @@ pci_vga_match(device_t dev) len = strlen(vendor) + 7 + 4 + 1 + strlen(type) + 1; MALLOC(buf, char *, len, M_TEMP, M_WAITOK); - sprintf(buf, "%s model %04x %s", vendor, id >> 16, type); + ksprintf(buf, "%s model %04x %s", vendor, id >> 16, type); return buf; } return type; diff --git a/sys/bus/usb/ehci.c b/sys/bus/usb/ehci.c index 47eafb5b93..510ddac222 100644 --- a/sys/bus/usb/ehci.c +++ b/sys/bus/usb/ehci.c @@ -1,6 +1,6 @@ /* $NetBSD: ehci.c,v 1.91 2005/02/27 00:27:51 perry Exp $ */ /* $FreeBSD: src/sys/dev/usb/ehci.c,v 1.36.2.3 2006/09/24 13:39:04 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/ehci.c,v 1.26 2006/12/10 02:03:56 sephe Exp $ */ +/* $DragonFly: src/sys/bus/usb/ehci.c,v 1.27 2006/12/20 18:14:37 dillon Exp $ */ /* * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -100,7 +100,7 @@ SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW, &ehcidebug, 0, "ehci debug level"); #ifndef __NetBSD__ -#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f)) +#define bitmask_snprintf(q,f,b,l) ksnprintf((b), (l), "%b", (q), (f)) #endif #else #define DPRINTF(x) diff --git a/sys/bus/usb/ehci_pci.c b/sys/bus/usb/ehci_pci.c index e99615469b..3c078ec789 100644 --- a/sys/bus/usb/ehci_pci.c +++ b/sys/bus/usb/ehci_pci.c @@ -35,7 +35,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/usb/ehci_pci.c,v 1.18.2.1 2006/01/26 01:43:13 iedowse Exp $ - * $DragonFly: src/sys/bus/usb/ehci_pci.c,v 1.12 2006/12/10 02:03:56 sephe Exp $ + * $DragonFly: src/sys/bus/usb/ehci_pci.c,v 1.13 2006/12/20 18:14:37 dillon Exp $ */ /* @@ -327,44 +327,44 @@ ehci_pci_attach(device_t self) device_set_desc(sc->sc_bus.bdev, ehci_pci_match(self)); switch (pci_get_vendor(self)) { case PCI_EHCI_VENDORID_ACERLABS: - sprintf(sc->sc_vendor, "AcerLabs"); + ksprintf(sc->sc_vendor, "AcerLabs"); break; case PCI_EHCI_VENDORID_AMD: - sprintf(sc->sc_vendor, "AMD"); + ksprintf(sc->sc_vendor, "AMD"); break; case PCI_EHCI_VENDORID_APPLE: - sprintf(sc->sc_vendor, "Apple"); + ksprintf(sc->sc_vendor, "Apple"); break; case PCI_EHCI_VENDORID_ATI: - sprintf(sc->sc_vendor, "ATI"); + ksprintf(sc->sc_vendor, "ATI"); break; case PCI_EHCI_VENDORID_CMDTECH: - sprintf(sc->sc_vendor, "CMDTECH"); + ksprintf(sc->sc_vendor, "CMDTECH"); break; case PCI_EHCI_VENDORID_INTEL: - sprintf(sc->sc_vendor, "Intel"); + ksprintf(sc->sc_vendor, "Intel"); break; case PCI_EHCI_VENDORID_NEC: - sprintf(sc->sc_vendor, "NEC"); + ksprintf(sc->sc_vendor, "NEC"); break; case PCI_EHCI_VENDORID_OPTI: - sprintf(sc->sc_vendor, "OPTi"); + ksprintf(sc->sc_vendor, "OPTi"); break; case PCI_EHCI_VENDORID_SIS: - sprintf(sc->sc_vendor, "SiS"); + ksprintf(sc->sc_vendor, "SiS"); break; case PCI_EHCI_VENDORID_NVIDIA: case PCI_EHCI_VENDORID_NVIDIA2: - sprintf(sc->sc_vendor, "nVidia"); + ksprintf(sc->sc_vendor, "nVidia"); break; case PCI_EHCI_VENDORID_VIA: - sprintf(sc->sc_vendor, "VIA"); + ksprintf(sc->sc_vendor, "VIA"); break; default: if (bootverbose) device_printf(self, "(New EHCI DeviceId=0x%08x)\n", pci_get_devid(self)); - sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); + ksprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } err = bus_setup_intr(self, sc->irq_res, 0, diff --git a/sys/bus/usb/ohci.c b/sys/bus/usb/ohci.c index de915d14a3..6a511aa50a 100644 --- a/sys/bus/usb/ohci.c +++ b/sys/bus/usb/ohci.c @@ -1,6 +1,6 @@ /* $NetBSD: ohci.c,v 1.138 2003/02/08 03:32:50 ichiro Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.154.2.4 2006/06/26 00:31:25 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/ohci.c,v 1.17 2006/12/10 02:03:56 sephe Exp $ */ +/* $DragonFly: src/sys/bus/usb/ohci.c,v 1.18 2006/12/20 18:14:37 dillon Exp $ */ /* Also, already ported: * $NetBSD: ohci.c,v 1.140 2003/05/13 04:42:00 gson Exp $ @@ -109,7 +109,7 @@ SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW, &ohcidebug, 0, "ohci debug level"); #ifndef __NetBSD__ -#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f)) +#define bitmask_snprintf(q,f,b,l) ksnprintf((b), (l), "%b", (q), (f)) #endif #else #define DPRINTF(x) diff --git a/sys/bus/usb/ohci_pci.c b/sys/bus/usb/ohci_pci.c index a941baa8f2..22de8ed0ee 100644 --- a/sys/bus/usb/ohci_pci.c +++ b/sys/bus/usb/ohci_pci.c @@ -35,7 +35,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/usb/ohci_pci.c,v 1.44.2.1 2006/01/29 01:26:46 iedowse Exp $ - * $DragonFly: src/sys/bus/usb/ohci_pci.c,v 1.6 2006/12/10 02:03:56 sephe Exp $ + * $DragonFly: src/sys/bus/usb/ohci_pci.c,v 1.7 2006/12/20 18:14:37 dillon Exp $ */ /* @@ -273,38 +273,38 @@ ohci_pci_attach(device_t self) device_set_desc(sc->sc_bus.bdev, ohci_pci_match(self)); switch (pci_get_vendor(self)) { case PCI_OHCI_VENDORID_ACERLABS: - sprintf(sc->sc_vendor, "AcerLabs"); + ksprintf(sc->sc_vendor, "AcerLabs"); break; case PCI_OHCI_VENDORID_AMD: - sprintf(sc->sc_vendor, "AMD"); + ksprintf(sc->sc_vendor, "AMD"); break; case PCI_OHCI_VENDORID_APPLE: - sprintf(sc->sc_vendor, "Apple"); + ksprintf(sc->sc_vendor, "Apple"); break; case PCI_OHCI_VENDORID_ATI: - sprintf(sc->sc_vendor, "ATI"); + ksprintf(sc->sc_vendor, "ATI"); break; case PCI_OHCI_VENDORID_CMDTECH: - sprintf(sc->sc_vendor, "CMDTECH"); + ksprintf(sc->sc_vendor, "CMDTECH"); break; case PCI_OHCI_VENDORID_NEC: - sprintf(sc->sc_vendor, "NEC"); + ksprintf(sc->sc_vendor, "NEC"); break; case PCI_OHCI_VENDORID_NVIDIA: case PCI_OHCI_VENDORID_NVIDIA2: - sprintf(sc->sc_vendor, "nVidia"); + ksprintf(sc->sc_vendor, "nVidia"); break; case PCI_OHCI_VENDORID_OPTI: - sprintf(sc->sc_vendor, "OPTi"); + ksprintf(sc->sc_vendor, "OPTi"); break; case PCI_OHCI_VENDORID_SIS: - sprintf(sc->sc_vendor, "SiS"); + ksprintf(sc->sc_vendor, "SiS"); break; default: if (bootverbose) device_printf(self, "(New OHCI DeviceId=0x%08x)\n", pci_get_devid(self)); - sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); + ksprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } err = bus_setup_intr(self, sc->irq_res, 0, diff --git a/sys/bus/usb/uhci.c b/sys/bus/usb/uhci.c index 633fa789a5..61e0156276 100644 --- a/sys/bus/usb/uhci.c +++ b/sys/bus/usb/uhci.c @@ -1,6 +1,6 @@ /* $NetBSD: uhci.c,v 1.170 2003/02/19 01:35:04 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.162.2.1 2006/03/01 01:59:04 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/uhci.c,v 1.18 2006/12/10 02:03:56 sephe Exp $ */ +/* $DragonFly: src/sys/bus/usb/uhci.c,v 1.19 2006/12/20 18:14:37 dillon Exp $ */ /* Also already incorporated from NetBSD: * $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ @@ -119,7 +119,7 @@ SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW, SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW, &uhcinoloop, 0, "uhci noloop"); #ifndef __NetBSD__ -#define bitmask_snprintf(q,f,b,l) snprintf((b), (l), "%b", (q), (f)) +#define bitmask_snprintf(q,f,b,l) ksnprintf((b), (l), "%b", (q), (f)) #endif #else #define DPRINTF(x) diff --git a/sys/bus/usb/uhci_pci.c b/sys/bus/usb/uhci_pci.c index f534cd08bd..05b191714e 100644 --- a/sys/bus/usb/uhci_pci.c +++ b/sys/bus/usb/uhci_pci.c @@ -35,7 +35,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/usb/uhci_pci.c,v 1.57 2005/03/01 07:50:11 imp Exp $ - * $DragonFly: src/sys/bus/usb/uhci_pci.c,v 1.9 2006/12/10 02:03:56 sephe Exp $ + * $DragonFly: src/sys/bus/usb/uhci_pci.c,v 1.10 2006/12/20 18:14:37 dillon Exp $ */ /* Universal Host Controller Interface @@ -300,16 +300,16 @@ uhci_pci_attach(device_t self) device_set_desc(sc->sc_bus.bdev, uhci_pci_match(self)); switch (pci_get_vendor(self)) { case PCI_UHCI_VENDORID_INTEL: - sprintf(sc->sc_vendor, "Intel"); + ksprintf(sc->sc_vendor, "Intel"); break; case PCI_UHCI_VENDORID_VIA: - sprintf(sc->sc_vendor, "VIA"); + ksprintf(sc->sc_vendor, "VIA"); break; default: if (bootverbose) device_printf(self, "(New UHCI DeviceId=0x%08x)\n", pci_get_devid(self)); - sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); + ksprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } switch (pci_read_config(self, PCI_USBREV, 1) & PCI_USBREV_MASK) { diff --git a/sys/bus/usb/uhub.c b/sys/bus/usb/uhub.c index 1999cb6c39..bcaaa2f23c 100644 --- a/sys/bus/usb/uhub.c +++ b/sys/bus/usb/uhub.c @@ -1,6 +1,6 @@ /* $NetBSD: uhub.c,v 1.68 2004/06/29 06:30:05 mycroft Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.69.2.1 2005/12/18 15:51:31 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/uhub.c,v 1.10 2006/12/10 02:03:56 sephe Exp $ */ +/* $DragonFly: src/sys/bus/usb/uhub.c,v 1.11 2006/12/20 18:14:37 dillon Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -643,10 +643,10 @@ uhub_child_location_str(device_t cbdev, device_t child, char *buf, for (i = 0; dev->subdevs[i]; i++) { if (dev->subdevs[i] == child) { if (dev->ifacenums == NULL) { - snprintf(buf, buflen, + ksnprintf(buf, buflen, "port=%i", port); } else { - snprintf(buf, buflen, + ksnprintf(buf, buflen, "port=%i interface=%i", port, dev->ifacenums[i]); } @@ -696,7 +696,7 @@ found_dev: /* XXX can sleep */ (void)usbd_get_string(dev, dev->ddesc.iSerialNumber, &serial[0]); if (dev->ifacenums == NULL) { - snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " + ksnprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "release=0x%04x sernum=\"%s\"", UGETW(dev->ddesc.idVendor), UGETW(dev->ddesc.idProduct), @@ -704,7 +704,7 @@ found_dev: UGETW(dev->ddesc.bcdDevice), serial); } else { iface = &dev->ifaces[dev->ifacenums[i]]; - snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " + ksnprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "release=0x%04x sernum=\"%s\" " "intclass=0x%02x intsubclass=0x%02x", diff --git a/sys/bus/usb/usb_subr.c b/sys/bus/usb/usb_subr.c index 8b82162801..be96c13882 100644 --- a/sys/bus/usb/usb_subr.c +++ b/sys/bus/usb/usb_subr.c @@ -1,6 +1,6 @@ /* $NetBSD: usb_subr.c,v 1.99 2002/07/11 21:14:34 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.76.2.3 2006/03/01 01:59:05 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/usb_subr.c,v 1.15 2006/12/10 02:03:56 sephe Exp $ */ +/* $DragonFly: src/sys/bus/usb/usb_subr.c,v 1.16 2006/12/20 18:14:37 dillon Exp $ */ /* Also already have from NetBSD: * $NetBSD: usb_subr.c,v 1.102 2003/01/01 16:21:50 augustss Exp $ @@ -146,7 +146,7 @@ usbd_errstr(usbd_status err) if (err < USBD_ERROR_MAX) { return usbd_error_strs[err]; } else { - snprintf(buffer, sizeof buffer, "%d", err); + ksnprintf(buffer, sizeof buffer, "%d", err); return buffer; } } @@ -258,17 +258,17 @@ usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev) if (vendor != NULL && *vendor) strcpy(v, vendor); else - sprintf(v, "vendor 0x%04x", UGETW(udd->idVendor)); + ksprintf(v, "vendor 0x%04x", UGETW(udd->idVendor)); if (product != NULL && *product) strcpy(p, product); else - sprintf(p, "product 0x%04x", UGETW(udd->idProduct)); + ksprintf(p, "product 0x%04x", UGETW(udd->idProduct)); } int usbd_printBCD(char *cp, int bcd) { - return (sprintf(cp, "%x.%02x", bcd >> 8, bcd & 0xff)); + return (ksprintf(cp, "%x.%02x", bcd >> 8, bcd & 0xff)); } void @@ -282,24 +282,24 @@ usbd_devinfo(usbd_device_handle dev, int showclass, char *cp) usb_interface_descriptor_t *id; usbd_devinfo_vp(dev, vendor, product, 1); - cp += sprintf(cp, "%s %s", vendor, product); + cp += ksprintf(cp, "%s %s", vendor, product); if (showclass & USBD_SHOW_DEVICE_CLASS) - cp += sprintf(cp, ", class %d/%d", - udd->bDeviceClass, udd->bDeviceSubClass); + cp += ksprintf(cp, ", class %d/%d", + udd->bDeviceClass, udd->bDeviceSubClass); bcdUSB = UGETW(udd->bcdUSB); bcdDevice = UGETW(udd->bcdDevice); - cp += sprintf(cp, ", rev "); + cp += ksprintf(cp, ", rev "); cp += usbd_printBCD(cp, bcdUSB); *cp++ = '/'; cp += usbd_printBCD(cp, bcdDevice); - cp += sprintf(cp, ", addr %d", dev->address); + cp += ksprintf(cp, ", addr %d", dev->address); if (showclass & USBD_SHOW_INTERFACE_CLASS) { /* fetch the interface handle for the first interface */ (void)usbd_device2interface_handle(dev, 0, &iface); id = usbd_get_interface_descriptor(iface); - cp += sprintf(cp, ", iclass %d/%d", - id->bInterfaceClass, id->bInterfaceSubClass); + cp += ksprintf(cp, ", iclass %d/%d", + id->bInterfaceClass, id->bInterfaceSubClass); } *cp = 0; } diff --git a/sys/contrib/ipfilter/netinet/ip_fil.c b/sys/contrib/ipfilter/netinet/ip_fil.c index ef29aa15f5..2495b0f14c 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.c +++ b/sys/contrib/ipfilter/netinet/ip_fil.c @@ -6,7 +6,7 @@ * @(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed * @(#)$Id: ip_fil.c,v 2.42.2.60 2002/08/28 12:40:39 darrenr Exp $ * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.25.2.7 2004/07/04 09:24:38 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.24 2006/09/30 20:03:44 swildner Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.25 2006/12/20 18:14:37 dillon Exp $ */ #ifndef SOLARIS #define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) @@ -39,6 +39,7 @@ # include # include # include +#define ksprintf sprintf #endif #include #include @@ -2054,7 +2055,7 @@ struct ifnet *ifp; { static char workbuf[64]; - sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit); + ksprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit); return workbuf; } # endif @@ -2191,9 +2192,9 @@ ip_t *ip; # if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \ (defined(OpenBSD) && (OpenBSD >= 199603)) || \ (defined(__DragonFly__)) - sprintf(fname, "%s", ifp->if_xname); + ksprintf(fname, "%s", ifp->if_xname); # else - sprintf(fname, "%s%d", ifp->if_name, ifp->if_unit); + ksprintf(fname, "%s%d", ifp->if_name, ifp->if_unit); # endif fd = open(fname, O_WRONLY|O_APPEND); if (fd == -1) { @@ -2216,7 +2217,7 @@ struct ifnet *ifp; # else static char fullifname[LIFNAMSIZ]; - sprintf(fullifname, "%s%d", ifp->if_name, ifp->if_unit); + ksprintf(fullifname, "%s%d", ifp->if_name, ifp->if_unit); return fullifname; # endif } @@ -2236,7 +2237,7 @@ int v; # else char fullname[LIFNAMSIZ]; - sprintf(fullname, "%s%d", ifp->if_name, ifp->if_unit); + ksprintf(fullname, "%s%d", ifp->if_name, ifp->if_unit); if (!strcmp(ifname, fullname)) # endif return ifp; @@ -2305,7 +2306,7 @@ void init_ifp() (defined(__DragonFly__)) for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) { ifp->if_output = write_output; - sprintf(fname, "/tmp/%s", ifp->if_xname); + ksprintf(fname, "/tmp/%s", ifp->if_xname); fd = open(fname, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600); if (fd == -1) perror("open"); @@ -2316,7 +2317,7 @@ void init_ifp() for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) { ifp->if_output = write_output; - sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit); + ksprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit); fd = open(fname, O_WRONLY|O_CREAT|O_EXCL|O_TRUNC, 0600); if (fd == -1) perror("open"); diff --git a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c index 6984a0902d..f3b6807759 100644 --- a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c @@ -2,7 +2,7 @@ * Simple FTP transparent proxy for in-kernel use. For use with the NAT * code. * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c,v 1.17.2.6 2004/07/04 09:24:39 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c,v 1.5 2004/07/28 00:22:37 hmp Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c,v 1.6 2006/12/20 18:14:37 dillon Exp $ */ #if SOLARIS && defined(_KERNEL) extern kmutex_t ipf_rw; @@ -211,7 +211,7 @@ int dlen; (void) snprintf(newbuf, sizeof(newbuf), "%s %u,%u,%u,%u,%u,%u\r\n", "PORT", a1, a2, a3, a4, a5, a6); #else - (void) sprintf(newbuf, "%s %u,%u,%u,%u,%u,%u\r\n", + (void) ksprintf(newbuf, "%s %u,%u,%u,%u,%u,%u\r\n", "PORT", a1, a2, a3, a4, a5, a6); #endif diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 98137169c4..0aec1979b3 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -5,7 +5,7 @@ * * @(#)$Id: ip_proxy.c,v 2.9.2.24 2002/08/28 12:45:51 darrenr Exp $ * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_proxy.c,v 1.11.2.5 2003/03/01 03:55:54 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_proxy.c,v 1.7 2004/02/12 22:35:47 joerg Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_proxy.c,v 1.8 2006/12/20 18:14:37 dillon Exp $ */ #if (defined(__DragonFly__) || defined(__FreeBSD__)) && defined(KERNEL) && !defined(_KERNEL) # define _KERNEL @@ -82,6 +82,10 @@ extern KRWLOCK_T ipf_nat, ipf_state; #endif +#ifndef _KERNEL +#define ksprintf sprintf +#endif + static int appr_fixseqack (fr_info_t *, ip_t *, ap_session_t *, int ); diff --git a/sys/crypto/des/des_ecb.c b/sys/crypto/des/des_ecb.c index d5672ba146..ea84be7e3a 100644 --- a/sys/crypto/des/des_ecb.c +++ b/sys/crypto/des/des_ecb.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/crypto/des/des_ecb.c,v 1.1.2.3 2002/03/26 10:12:24 ume Exp $ */ -/* $DragonFly: src/sys/crypto/des/des_ecb.c,v 1.3 2003/07/26 14:12:24 rob Exp $ */ +/* $DragonFly: src/sys/crypto/des/des_ecb.c,v 1.4 2006/12/20 18:14:37 dillon Exp $ */ /* $KAME: des_ecb.c,v 1.6 2001/09/10 04:03:58 itojun Exp $ */ /* crypto/des/ecb_enc.c */ @@ -90,7 +90,7 @@ char *des_options(void) size="int"; else size="long"; - sprintf(buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,size); + ksprintf(buf,"des(%s,%s,%s,%s)",ptr,risc,unroll,size); init=0; } return(buf); diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index 5770be9fca..d19e637e0e 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -24,7 +24,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/ddb/db_sym.c,v 1.32 1999/08/28 00:41:10 peter Exp $ - * $DragonFly: src/sys/ddb/db_sym.c,v 1.5 2005/12/23 21:35:44 swildner Exp $ + * $DragonFly: src/sys/ddb/db_sym.c,v 1.6 2006/12/20 18:14:37 dillon Exp $ */ /* @@ -86,7 +86,7 @@ db_qualify(c_db_sym_t sym, char *symtabname) static char tmp[256]; db_symbol_values(sym, &symname, 0); - snprintf(tmp, sizeof(tmp), "%s:%s", symtabname, symname); + ksnprintf(tmp, sizeof(tmp), "%s:%s", symtabname, symname); return tmp; } diff --git a/sys/dev/acpica5/acpi.c b/sys/dev/acpica5/acpi.c index bad5be7288..8944a28f48 100644 --- a/sys/dev/acpica5/acpi.c +++ b/sys/dev/acpica5/acpi.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.157 2004/06/05 09:56:04 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.24 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.25 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_acpi.h" @@ -330,7 +330,7 @@ acpi_identify(driver_t *driver, device_t parent) if (ACPI_FAILURE(acpi_Startup())) return (ENXIO); - snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%#x", ACPI_CA_VERSION); + ksnprintf(acpi_ca_version, sizeof(acpi_ca_version), "%#x", ACPI_CA_VERSION); /* Attach the actual ACPI device. */ if ((child = BUS_ADD_CHILD(parent, parent, 0, "acpi", 0)) == NULL) { @@ -672,7 +672,7 @@ acpi_quirks_set(void) len += strlen(quirk->value) + 2; if ((tmp = kmalloc(len, M_TEMP, M_NOWAIT)) == NULL) goto out; - sprintf(tmp, "%s %s", env ? env : "", quirk->value); + ksprintf(tmp, "%s %s", env ? env : "", quirk->value); #ifdef notyet setenv("debug.acpi.disabled", tmp); #endif /* notyet */ @@ -731,9 +731,9 @@ acpi_child_location_str_method(device_t cbdev, device_t child, char *buf, struct acpi_device *dinfo = device_get_ivars(child); if (dinfo->ad_handle) - snprintf(buf, buflen, "path=%s", acpi_name(dinfo->ad_handle)); + ksnprintf(buf, buflen, "path=%s", acpi_name(dinfo->ad_handle)); else - snprintf(buf, buflen, "magic=unknown"); + ksnprintf(buf, buflen, "magic=unknown"); return (0); } @@ -752,9 +752,9 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf, adinfo = (ACPI_DEVICE_INFO *) adbuf.Pointer; if (error) - snprintf(buf, buflen, "Unknown"); + ksnprintf(buf, buflen, "Unknown"); else - snprintf(buf, buflen, "_HID=%s _UID=%lu", + ksnprintf(buf, buflen, "_HID=%s _UID=%lu", (adinfo->Valid & ACPI_VALID_HID) ? adinfo->HardwareId.Value : "UNKNOWN", (adinfo->Valid & ACPI_VALID_UID) ? @@ -2530,7 +2530,7 @@ acpi_supported_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) buf[0] = '\0'; for (state = ACPI_STATE_S1; state < ACPI_S_STATES_MAX + 1; state++) { if (ACPI_SUCCESS(AcpiGetSleepTypeData(state, &TypeA, &TypeB))) { - sprintf(sleep_state, "S%d ", state); + ksprintf(sleep_state, "S%d ", state); strcat(buf, sleep_state); } } @@ -2588,7 +2588,7 @@ acpi_UserNotify(const char *subsystem, ACPI_HANDLE h, uint8_t notify) status = AcpiNsHandleToPathname(h, &handle_buf); if (ACPI_FAILURE(status)) return; - snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x", notify); + ksnprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x", notify); #if 0 devctl_notify("ACPI", subsystem, handle_buf.Pointer, notify_buf); #endif diff --git a/sys/dev/acpica5/acpi_cpu.c b/sys/dev/acpica5/acpi_cpu.c index 5c18be2e18..09109824a9 100644 --- a/sys/dev/acpica5/acpi_cpu.c +++ b/sys/dev/acpica5/acpi_cpu.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.41 2004/06/24 00:38:51 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_cpu.c,v 1.15 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_cpu.c,v 1.16 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_acpi.h" @@ -252,7 +252,7 @@ acpi_cpu_probe(device_t dev) cx_count++; } if (cx_count > 0) - snprintf(msg, sizeof(msg), "ACPI CPU (%d Cx states)", cx_count); + ksnprintf(msg, sizeof(msg), "ACPI CPU (%d Cx states)", cx_count); else strlcpy(msg, "ACPI CPU", sizeof(msg)); device_set_desc_copy(dev, msg); @@ -1172,7 +1172,7 @@ acpi_cpu_cx_lowest_sysctl(SYSCTL_HANDLER_ARGS) int val, error, i; sc = device_get_softc(cpu_devices[0]); - snprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); + ksnprintf(state, sizeof(state), "C%d", cpu_cx_lowest + 1); error = sysctl_handle_string(oidp, state, sizeof(state), req); if (error != 0 || req->newptr == NULL) return (error); diff --git a/sys/dev/acpica5/acpi_ec.c b/sys/dev/acpica5/acpi_ec.c index 616202b7e1..9e03628b1d 100644 --- a/sys/dev/acpica5/acpi_ec.c +++ b/sys/dev/acpica5/acpi_ec.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.51 2004/05/30 20:08:23 phk Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_ec.c,v 1.9 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_ec.c,v 1.10 2006/12/20 18:14:38 dillon Exp $ */ /****************************************************************************** * @@ -138,7 +138,7 @@ *****************************************************************************/ /* * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.51 2004/05/30 20:08:23 phk Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_ec.c,v 1.9 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_ec.c,v 1.10 2006/12/20 18:14:38 dillon Exp $ * */ @@ -520,7 +520,7 @@ acpi_ec_probe(device_t dev) out: if (ret == 0) { - snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", + ksnprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", params->gpe_bit, (params->glk) ? ", GLK" : "", DEV_ECDT(dev) ? ", ECDT" : ""); device_set_desc_copy(dev, desc); @@ -685,7 +685,7 @@ EcGpeQueryHandler(void *Context) goto re_enable; /* Evaluate _Qxx to respond to the controller. */ - sprintf(qxx, "_Q%02x", Data); + ksprintf(qxx, "_Q%02x", Data); strupr(qxx); Status = AcpiEvaluateObject(sc->ec_handle, qxx, NULL, NULL); if (ACPI_FAILURE(Status) && Status != AE_NOT_FOUND) { diff --git a/sys/dev/acpica5/acpi_pci_link.c b/sys/dev/acpica5/acpi_pci_link.c index 2383ea57c6..8df87067df 100644 --- a/sys/dev/acpica5/acpi_pci_link.c +++ b/sys/dev/acpica5/acpi_pci_link.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.16 2004/06/14 18:54:14 jhb Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_pci_link.c,v 1.5 2006/09/03 17:43:55 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_pci_link.c,v 1.6 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_acpi.h" @@ -966,7 +966,7 @@ acpi_pci_link_config(device_t dev, ACPI_BUFFER *prtbuf, int busno) if (entry->busno != busno) continue; - snprintf(prthint, sizeof(prthint), + ksnprintf(prthint, sizeof(prthint), "hw.acpi.pci.link.%d.%d.%d.irq", entry->busno, (int)((entry->prt.Address & 0xffff0000) >> 16), (int)entry->prt.Pin); diff --git a/sys/dev/acpica5/acpi_thermal.c b/sys/dev/acpica5/acpi_thermal.c index cd99b9dbed..6d758e4047 100644 --- a/sys/dev/acpica5/acpi_thermal.c +++ b/sys/dev/acpica5/acpi_thermal.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_thermal.c,v 1.47 2004/05/30 20:08:23 phk Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_thermal.c,v 1.5 2005/06/04 14:25:45 corecode Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_thermal.c,v 1.6 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_acpi.h" @@ -231,7 +231,7 @@ acpi_tz_attach(device_t dev) &acpi_tz_polling_rate, 0, "monitor polling rate"); } sysctl_ctx_init(&sc->tz_sysctl_ctx); - sprintf(oidname, "tz%d", device_get_unit(dev)); + ksprintf(oidname, "tz%d", device_get_unit(dev)); sc->tz_sysctl_tree = SYSCTL_ADD_NODE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(acpi_tz_sysctl_tree), OID_AUTO, oidname, CTLFLAG_RD, 0, ""); @@ -318,9 +318,9 @@ acpi_tz_establish(struct acpi_tz_softc *sc) /* Evaluate thermal zone parameters. */ for (i = 0; i < TZ_NUMLEVELS; i++) { - sprintf(nbuf, "_AC%d", i); + ksprintf(nbuf, "_AC%d", i); acpi_tz_getparam(sc, nbuf, &sc->tz_zone.ac[i]); - sprintf(nbuf, "_AL%d", i); + ksprintf(nbuf, "_AL%d", i); sc->tz_zone.al[i].Length = ACPI_ALLOCATE_BUFFER; sc->tz_zone.al[i].Pointer = NULL; AcpiEvaluateObject(sc->tz_handle, nbuf, NULL, &sc->tz_zone.al[i]); diff --git a/sys/dev/acpica5/acpi_timer.c b/sys/dev/acpica5/acpi_timer.c index f7d772fab8..6246fdd8d8 100644 --- a/sys/dev/acpica5/acpi_timer.c +++ b/sys/dev/acpica5/acpi_timer.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_timer.c,v 1.33 2004/05/30 20:08:23 phk Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_timer.c,v 1.9 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_timer.c,v 1.10 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_acpi.h" #include @@ -181,7 +181,7 @@ acpi_timer_identify(driver_t *driver, device_t parent) acpi_cputimer.count = acpi_timer_get_timecount_safe; } - sprintf(desc, "%d-bit timer at 3.579545MHz", + ksprintf(desc, "%d-bit timer at 3.579545MHz", AcpiGbl_FADT->TmrValExt ? 32 : 24); device_set_desc_copy(dev, desc); diff --git a/sys/dev/atm/hea/eni.c b/sys/dev/atm/hea/eni.c index 583f9dc324..95f3988bbd 100644 --- a/sys/dev/atm/hea/eni.c +++ b/sys/dev/atm/hea/eni.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/dev/hea/eni.c,v 1.10 1999/08/28 00:41:42 peter Exp $ - * @(#) $DragonFly: src/sys/dev/atm/hea/eni.c,v 1.8 2005/06/16 21:12:27 dillon Exp $ + * @(#) $DragonFly: src/sys/dev/atm/hea/eni.c,v 1.9 2006/12/20 18:14:38 dillon Exp $ */ /* @@ -486,7 +486,7 @@ eni_pci_attach ( pcici_t config_id, int unit ) * Make a hw version number from the ID register values. * Format: {Midway ID}.{Mother board ID}.{Daughter board ID} */ - snprintf ( eup->eu_config.ac_hard_vers, + ksnprintf ( eup->eu_config.ac_hard_vers, sizeof ( eup->eu_config.ac_hard_vers ), "%ld/%ld/%ld", (val >> ID_SHIFT) & ID_MASK, diff --git a/sys/dev/atm/hea/eni_if.c b/sys/dev/atm/hea/eni_if.c index 3bea49f23e..443c8c1375 100644 --- a/sys/dev/atm/hea/eni_if.c +++ b/sys/dev/atm/hea/eni_if.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/dev/hea/eni_if.c,v 1.5 1999/08/28 00:41:44 peter Exp $ - * @(#) $DragonFly: src/sys/dev/atm/hea/eni_if.c,v 1.5 2003/08/27 10:35:15 rob Exp $ + * @(#) $DragonFly: src/sys/dev/atm/hea/eni_if.c,v 1.6 2006/12/20 18:14:38 dillon Exp $ */ /* @@ -190,7 +190,7 @@ eni_atm_ioctl ( code, data, arg ) */ if ( eup == NULL ) return ( ENXIO ); - snprintf ( ifname, sizeof(ifname), + ksnprintf ( ifname, sizeof(ifname), "%s%d", pip->pif_name, pip->pif_unit ); /* diff --git a/sys/dev/atm/hfa/fore_command.c b/sys/dev/atm/hfa/fore_command.c index bbcbab85c0..610c41a325 100644 --- a/sys/dev/atm/hfa/fore_command.c +++ b/sys/dev/atm/hfa/fore_command.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/dev/hfa/fore_command.c,v 1.6 1999/08/28 00:41:49 peter Exp $ - * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_command.c,v 1.4 2005/02/01 00:51:50 joerg Exp $ + * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_command.c,v 1.5 2006/12/20 18:14:38 dillon Exp $ */ /* @@ -334,7 +334,7 @@ fore_cmd_drain(fup) sizeof(struct mac_addr)); fup->fu_config.ac_macaddr = fup->fu_pif.pif_macaddr; - snprintf(fup->fu_config.ac_hard_vers, + ksnprintf(fup->fu_config.ac_hard_vers, sizeof(fup->fu_config.ac_hard_vers), "%ld.%ld.%ld", (fp->pr_hwver >> 16) & 0xff, diff --git a/sys/dev/atm/hfa/fore_if.c b/sys/dev/atm/hfa/fore_if.c index d2ce02a311..b3ce30ea51 100644 --- a/sys/dev/atm/hfa/fore_if.c +++ b/sys/dev/atm/hfa/fore_if.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/dev/hfa/fore_if.c,v 1.5 1999/08/28 00:41:49 peter Exp $ - * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_if.c,v 1.3 2003/08/07 21:16:49 dillon Exp $ + * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_if.c,v 1.4 2006/12/20 18:14:38 dillon Exp $ */ /* @@ -80,7 +80,7 @@ fore_atm_ioctl(code, data, arg) fup = (Fore_unit *)pip; if ( pip == NULL ) return ( ENXIO ); - snprintf ( ifname, sizeof(ifname), + ksnprintf ( ifname, sizeof(ifname), "%s%d", pip->pif_name, pip->pif_unit ); /* diff --git a/sys/dev/atm/hfa/fore_init.c b/sys/dev/atm/hfa/fore_init.c index 00446a90a8..71156fa592 100644 --- a/sys/dev/atm/hfa/fore_init.c +++ b/sys/dev/atm/hfa/fore_init.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/dev/hfa/fore_init.c,v 1.6 1999/08/29 10:28:09 bde Exp $ - * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_init.c,v 1.6 2005/02/01 00:51:50 joerg Exp $ + * @(#) $DragonFly: src/sys/dev/atm/hfa/fore_init.c,v 1.7 2006/12/20 18:14:38 dillon Exp $ */ /* @@ -111,7 +111,7 @@ fore_initialize(void *xfup) errmsg = "unsupported microcode version"; goto failed; } - snprintf(fup->fu_config.ac_firm_vers, + ksnprintf(fup->fu_config.ac_firm_vers, sizeof(fup->fu_config.ac_firm_vers), "%ld.%ld.%ld", (vers >> 16) & 0xff, (vers >> 8) & 0xff, vers & 0xff); diff --git a/sys/dev/disk/advansys/advansys.c b/sys/dev/disk/advansys/advansys.c index 1ce1255f27..a004f4b0af 100644 --- a/sys/dev/disk/advansys/advansys.c +++ b/sys/dev/disk/advansys/advansys.c @@ -33,7 +33,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/advansys/advansys.c,v 1.14.2.4 2002/01/06 21:21:42 dwmalone Exp $ - * $DragonFly: src/sys/dev/disk/advansys/advansys.c,v 1.9 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/dev/disk/advansys/advansys.c,v 1.10 2006/12/20 18:14:38 dillon Exp $ */ /* * Ported from: @@ -184,7 +184,7 @@ adv_name(struct adv_softc *adv) { static char name[10]; - snprintf(name, sizeof(name), "adv%d", adv->unit); + ksnprintf(name, sizeof(name), "adv%d", adv->unit); return (name); } diff --git a/sys/dev/disk/advansys/adwcam.c b/sys/dev/disk/advansys/adwcam.c index 03f2ef9298..59511707bf 100644 --- a/sys/dev/disk/advansys/adwcam.c +++ b/sys/dev/disk/advansys/adwcam.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/advansys/adwcam.c,v 1.7.2.2 2001/03/05 13:08:55 obrien Exp $ - * $DragonFly: src/sys/dev/disk/advansys/adwcam.c,v 1.13 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/dev/disk/advansys/adwcam.c,v 1.14 2006/12/20 18:14:38 dillon Exp $ */ /* * Ported from: @@ -822,7 +822,7 @@ adw_alloc(device_t dev, struct resource *regs, int regs_type, int regs_id) KKASSERT(adw->unit >= 0 && adw->unit < 100); i = adw->unit / 10; adw->name = kmalloc(sizeof("adw") + i + 1, M_DEVBUF, M_INTWAIT); - sprintf(adw->name, "adw%d", adw->unit); + ksprintf(adw->name, "adw%d", adw->unit); return(adw); } diff --git a/sys/dev/disk/aha/aha.c b/sys/dev/disk/aha/aha.c index e430034b41..4bd3c0d5a3 100644 --- a/sys/dev/disk/aha/aha.c +++ b/sys/dev/disk/aha/aha.c @@ -56,7 +56,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aha/aha.c,v 1.34.2.1 2000/08/02 22:24:39 peter Exp $ - * $DragonFly: src/sys/dev/disk/aha/aha.c,v 1.14 2006/10/25 20:55:53 dillon Exp $ + * $DragonFly: src/sys/dev/disk/aha/aha.c,v 1.15 2006/12/20 18:14:38 dillon Exp $ */ #include @@ -403,31 +403,31 @@ aha_fetch_adapter_info(struct aha_softc *aha) switch (aha->boardid) { case BOARD_1540_16HEAD_BIOS: - snprintf(aha->model, sizeof(aha->model), "1540 16 head BIOS"); + ksnprintf(aha->model, sizeof(aha->model), "1540 16 head BIOS"); break; case BOARD_1540_64HEAD_BIOS: - snprintf(aha->model, sizeof(aha->model), "1540 64 head BIOS"); + ksnprintf(aha->model, sizeof(aha->model), "1540 64 head BIOS"); break; case BOARD_1542: - snprintf(aha->model, sizeof(aha->model), "1540/1542 64 head BIOS"); + ksnprintf(aha->model, sizeof(aha->model), "1540/1542 64 head BIOS"); break; case BOARD_1640: - snprintf(aha->model, sizeof(aha->model), "1640"); + ksnprintf(aha->model, sizeof(aha->model), "1640"); break; case BOARD_1740: - snprintf(aha->model, sizeof(aha->model), "1740A/1742A/1744"); + ksnprintf(aha->model, sizeof(aha->model), "1740A/1742A/1744"); break; case BOARD_1542C: - snprintf(aha->model, sizeof(aha->model), "1542C"); + ksnprintf(aha->model, sizeof(aha->model), "1542C"); break; case BOARD_1542CF: - snprintf(aha->model, sizeof(aha->model), "1542CF"); + ksnprintf(aha->model, sizeof(aha->model), "1542CF"); break; case BOARD_1542CP: - snprintf(aha->model, sizeof(aha->model), "1542CP"); + ksnprintf(aha->model, sizeof(aha->model), "1542CP"); break; default: - snprintf(aha->model, sizeof(aha->model), "Unknown"); + ksnprintf(aha->model, sizeof(aha->model), "Unknown"); break; } /* diff --git a/sys/dev/disk/aic7xxx/aic79xx.c b/sys/dev/disk/aic7xxx/aic79xx.c index 0af9f1652d..4c2d1b2e35 100644 --- a/sys/dev/disk/aic7xxx/aic79xx.c +++ b/sys/dev/disk/aic7xxx/aic79xx.c @@ -40,7 +40,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic79xx.c#198 $ * * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.c,v 1.3.2.5 2003/06/10 03:26:07 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.10 2006/12/05 23:31:54 dillon Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.c,v 1.11 2006/12/20 18:14:38 dillon Exp $ */ #include "aic79xx_osm.h" @@ -5749,7 +5749,8 @@ ahd_controller_info(struct ahd_softc *ahd, char *buf) const char *type; int len; - len = sprintf(buf, "%s: ", ahd_chip_names[ahd->chip & AHD_CHIPID_MASK]); + len = ksprintf(buf, "%s: ", + ahd_chip_names[ahd->chip & AHD_CHIPID_MASK]); buf += len; speed = "Ultra320 "; @@ -5758,12 +5759,12 @@ ahd_controller_info(struct ahd_softc *ahd, char *buf) } else { type = "Single "; } - len = sprintf(buf, "%s%sChannel %c, SCSI Id=%d, ", - speed, type, ahd->channel, ahd->our_id); + len = ksprintf(buf, "%s%sChannel %c, SCSI Id=%d, ", + speed, type, ahd->channel, ahd->our_id); buf += len; - sprintf(buf, "%s, %d SCBs", ahd->bus_description, - ahd->scb_data.maxhscbs); + ksprintf(buf, "%s, %d SCBs", ahd->bus_description, + ahd->scb_data.maxhscbs); } static const char *channel_strings[] = { diff --git a/sys/dev/disk/aic7xxx/aic7xxx.c b/sys/dev/disk/aic7xxx/aic7xxx.c index 941c6177c8..fec35efbae 100644 --- a/sys/dev/disk/aic7xxx/aic7xxx.c +++ b/sys/dev/disk/aic7xxx/aic7xxx.c @@ -40,7 +40,7 @@ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#134 $ * * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.c,v 1.41.2.27 2003/06/10 03:26:08 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.9 2006/09/05 03:48:09 dillon Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx.c,v 1.10 2006/12/20 18:14:38 dillon Exp $ */ #include "aic7xxx_osm.h" @@ -4500,14 +4500,15 @@ ahc_controller_info(struct ahc_softc *ahc, char *buf) { int len; - len = sprintf(buf, "%s: ", ahc_chip_names[ahc->chip & AHC_CHIPID_MASK]); + len = ksprintf(buf, "%s: ", + ahc_chip_names[ahc->chip & AHC_CHIPID_MASK]); buf += len; - if ((ahc->features & AHC_TWIN) != 0) - len = sprintf(buf, "Twin Channel, A SCSI Id=%d, " - "B SCSI Id=%d, primary %c, ", - ahc->our_id, ahc->our_id_b, - (ahc->flags & AHC_PRIMARY_CHANNEL) + 'A'); - else { + if ((ahc->features & AHC_TWIN) != 0) { + len = ksprintf(buf, "Twin Channel, A SCSI Id=%d, " + "B SCSI Id=%d, primary %c, ", + ahc->our_id, ahc->our_id_b, + (ahc->flags & AHC_PRIMARY_CHANNEL) + 'A'); + } else { const char *speed; const char *type; @@ -4524,16 +4525,16 @@ ahc_controller_info(struct ahc_softc *ahc, char *buf) } else { type = "Single"; } - len = sprintf(buf, "%s%s Channel %c, SCSI Id=%d, ", - speed, type, ahc->channel, ahc->our_id); + len = ksprintf(buf, "%s%s Channel %c, SCSI Id=%d, ", + speed, type, ahc->channel, ahc->our_id); } buf += len; if ((ahc->flags & AHC_PAGESCBS) != 0) - sprintf(buf, "%d/%d SCBs", - ahc->scb_data->maxhscbs, AHC_MAX_QUEUE); + ksprintf(buf, "%d/%d SCBs", + ahc->scb_data->maxhscbs, AHC_MAX_QUEUE); else - sprintf(buf, "%d SCBs", ahc->scb_data->maxhscbs); + ksprintf(buf, "%d SCBs", ahc->scb_data->maxhscbs); } int diff --git a/sys/dev/disk/ata/ata-all.c b/sys/dev/disk/ata/ata-all.c index be931ae546..448ef2dd33 100644 --- a/sys/dev/disk/ata/ata-all.c +++ b/sys/dev/disk/ata/ata-all.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.50.2.45 2003/03/12 14:47:12 sos Exp $ - * $DragonFly: src/sys/dev/disk/ata/ata-all.c,v 1.33 2006/12/18 20:41:01 dillon Exp $ + * $DragonFly: src/sys/dev/disk/ata/ata-all.c,v 1.34 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -1446,7 +1446,7 @@ void ata_set_name(struct ata_device *atadev, char *name, int lun) { atadev->name = kmalloc(strlen(name) + 4, M_ATA, M_INTWAIT); - sprintf(atadev->name, "%s%d", name, lun); + ksprintf(atadev->name, "%s%d", name, lun); } void diff --git a/sys/dev/disk/ata/atapi-all.c b/sys/dev/disk/ata/atapi-all.c index abcc3315c6..936998c29c 100644 --- a/sys/dev/disk/ata/atapi-all.c +++ b/sys/dev/disk/ata/atapi-all.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/atapi-all.c,v 1.46.2.18 2002/10/31 23:10:33 thomas Exp $ - * $DragonFly: src/sys/dev/disk/ata/atapi-all.c,v 1.18 2006/10/25 20:55:53 dillon Exp $ + * $DragonFly: src/sys/dev/disk/ata/atapi-all.c,v 1.19 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -710,7 +710,7 @@ atapi_cmd2str(u_int8_t cmd) case 0xff: return ("POLL_DSC"); default: { static char buffer[20]; - sprintf(buffer, "unknown CMD (0x%02x)", cmd); + ksprintf(buffer, "unknown CMD (0x%02x)", cmd); return buffer; } } diff --git a/sys/dev/disk/ata/atapi-cd.c b/sys/dev/disk/ata/atapi-cd.c index 4c7e9c2000..ef0234cbcc 100644 --- a/sys/dev/disk/ata/atapi-cd.c +++ b/sys/dev/disk/ata/atapi-cd.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.48.2.20 2002/11/25 05:30:31 njl Exp $ - * $DragonFly: src/sys/dev/disk/ata/atapi-cd.c,v 1.26 2006/10/25 20:55:53 dillon Exp $ + * $DragonFly: src/sys/dev/disk/ata/atapi-cd.c,v 1.27 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -1328,7 +1328,7 @@ acd_read_toc(struct acd_softc *cdp) for (track = 1; track <= ntracks; track ++) { char name[16]; - sprintf(name, "acd%dt%d", cdp->lun, track); + ksprintf(name, "acd%dt%d", cdp->lun, track); entry = kmalloc(sizeof(struct acd_devlist), M_ACD, M_WAITOK | M_ZERO); entry->dev = make_dev(&acd_ops, (cdp->lun << 3) | (track << 16), 0, 0, 0644, name, NULL); diff --git a/sys/dev/disk/buslogic/bt.c b/sys/dev/disk/buslogic/bt.c index 2a5f3251d9..043b2cbcd2 100644 --- a/sys/dev/disk/buslogic/bt.c +++ b/sys/dev/disk/buslogic/bt.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/buslogic/bt.c,v 1.25.2.1 2000/08/02 22:32:26 peter Exp $ - * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.13 2006/10/25 20:55:53 dillon Exp $ + * $DragonFly: src/sys/dev/disk/buslogic/bt.c,v 1.14 2006/12/20 18:14:38 dillon Exp $ */ /* @@ -480,15 +480,15 @@ bt_fetch_adapter_info(device_t dev) if (esetup_info.bus_type == 'A' && bt->firmware_ver[0] == '2') { - snprintf(bt->model, sizeof(bt->model), "542B"); + ksnprintf(bt->model, sizeof(bt->model), "542B"); } else if (esetup_info.bus_type == 'E' && (strncmp(bt->firmware_ver, "2.1", 3) == 0 || strncmp(bt->firmware_ver, "2.20", 4) == 0)) { - snprintf(bt->model, sizeof(bt->model), "742A"); + ksnprintf(bt->model, sizeof(bt->model), "742A"); } else if (esetup_info.bus_type == 'E' && bt->firmware_ver[0] == '0') { /* AMI FastDisk EISA Series 441 0.x */ - snprintf(bt->model, sizeof(bt->model), "747A"); + ksnprintf(bt->model, sizeof(bt->model), "747A"); } else { ha_model_data_t model_data; int i; diff --git a/sys/dev/disk/fd/fd.c b/sys/dev/disk/fd/fd.c index 3769a1e3af..18af9c97b4 100644 --- a/sys/dev/disk/fd/fd.c +++ b/sys/dev/disk/fd/fd.c @@ -51,7 +51,7 @@ * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 * $FreeBSD: src/sys/isa/fd.c,v 1.176.2.8 2002/05/15 21:56:14 joerg Exp $ - * $DragonFly: src/sys/dev/disk/fd/fd.c,v 1.34 2006/10/25 20:55:53 dillon Exp $ + * $DragonFly: src/sys/dev/disk/fd/fd.c,v 1.35 2006/12/20 18:14:38 dillon Exp $ * */ @@ -373,7 +373,7 @@ fd_cmd(struct fdc_data *fdc, int n_out, ...) if (out_fdc(fdc, __va_arg(ap, int)) < 0) { char msg[50]; - snprintf(msg, sizeof(msg), + ksnprintf(msg, sizeof(msg), "cmd %x failed at out byte %d of %d\n", cmd, n + 1, n_out); return fdc_err(fdc, msg); @@ -386,7 +386,7 @@ fd_cmd(struct fdc_data *fdc, int n_out, ...) if (fd_in(fdc, ptr) < 0) { char msg[50]; - snprintf(msg, sizeof(msg), + ksnprintf(msg, sizeof(msg), "cmd %02x failed at in byte %d of %d\n", cmd, n + 1, n_in); return fdc_err(fdc, msg); diff --git a/sys/dev/disk/isp/isp_freebsd.h b/sys/dev/disk/isp/isp_freebsd.h index 896e8360ef..f68afd5462 100644 --- a/sys/dev/disk/isp/isp_freebsd.h +++ b/sys/dev/disk/isp/isp_freebsd.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.26.2.17 2002/10/11 17:35:11 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/isp/isp_freebsd.h,v 1.7 2006/10/25 20:55:53 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/isp/isp_freebsd.h,v 1.8 2006/12/20 18:14:38 dillon Exp $ */ /* * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions * Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 by Matthew Jacob @@ -167,7 +167,7 @@ struct isposinfo { #define MEMZERO bzero #define MEMCPY(dst, src, amt) bcopy((src), (dst), (amt)) -#define SNPRINTF snprintf +#define SNPRINTF ksnprintf #define USEC_DELAY DELAY #define USEC_SLEEP(isp, x) \ if (isp->isp_osinfo.intsok) \ diff --git a/sys/dev/disk/isp/ispvar.h b/sys/dev/disk/isp/ispvar.h index eaabb4436d..eb018c3100 100644 --- a/sys/dev/disk/isp/ispvar.h +++ b/sys/dev/disk/isp/ispvar.h @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/isp/ispvar.h,v 1.25.2.17 2002/10/11 18:51:49 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/isp/ispvar.h,v 1.4 2004/02/13 01:04:15 joerg Exp $ */ +/* $DragonFly: src/sys/dev/disk/isp/ispvar.h,v 1.5 2006/12/20 18:14:38 dillon Exp $ */ /* * Soft Definitions for for Qlogic ISP SCSI adapters. * @@ -792,7 +792,7 @@ void isp_prt(struct ispsoftc *, int level, const char *, ...); * * MEMZERO(dst, src) platform zeroing function * MEMCPY(dst, src, count) platform copying function - * SNPRINTF(buf, bufsize, fmt, ...) snprintf + * SNPRINTF(buf, bufsize, fmt, ...) ksnprintf * USEC_DELAY(usecs) microsecond spindelay function * USEC_SLEEP(isp, usecs) microsecond sleep function * diff --git a/sys/dev/disk/mpt/mpt_debug.c b/sys/dev/disk/mpt/mpt_debug.c index 90f355b8c7..0d186f2cdf 100644 --- a/sys/dev/disk/mpt/mpt_debug.c +++ b/sys/dev/disk/mpt/mpt_debug.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/mpt/mpt_debug.c,v 1.2.2.1 2002/08/23 06:59:05 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/mpt/mpt_debug.c,v 1.3 2003/08/07 21:16:53 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/mpt/mpt_debug.c,v 1.4 2006/12/20 18:14:38 dillon Exp $ */ /* * Debug routines for LSI '909 FC adapters. * FreeBSD Version. @@ -174,7 +174,7 @@ mpt_ioc_status(int code) return status->Error_String; status++; } - snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); + ksnprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } @@ -186,10 +186,10 @@ mpt_ioc_diag(u_int32_t code) char *ptr = buf; char *end = &buf[128]; buf[0] = '\0'; - ptr += snprintf(buf, sizeof buf, "(0x%08x)", code); + ptr += ksnprintf(buf, sizeof buf, "(0x%08x)", code); while (status->Error_Code >= 0) { if ((status->Error_Code & code) != 0) - ptr += snprintf(ptr, (size_t)(end-ptr), "%s ", + ptr += ksnprintf(ptr, (size_t)(end-ptr), "%s ", status->Error_String); status++; } @@ -206,7 +206,7 @@ mpt_ioc_function(int code) return status->Error_String; status++; } - snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); + ksnprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } static char * @@ -219,7 +219,7 @@ mpt_ioc_event(int code) return status->Error_String; status++; } - snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); + ksnprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } static char * @@ -230,10 +230,10 @@ mpt_scsi_state(int code) char *ptr = buf; char *end = &buf[128]; buf[0] = '\0'; - ptr += snprintf(buf, sizeof buf, "(0x%08x)", code); + ptr += ksnprintf(buf, sizeof buf, "(0x%08x)", code); while (status->Error_Code >= 0) { if ((status->Error_Code & code) != 0) - ptr += snprintf(ptr, (size_t)(end-ptr), "%s ", + ptr += ksnprintf(ptr, (size_t)(end-ptr), "%s ", status->Error_String); status++; } @@ -249,7 +249,7 @@ mpt_scsi_status(int code) return status->Error_String; status++; } - snprintf(buf, sizeof buf, "Unknown (0x%08x)", code); + ksnprintf(buf, sizeof buf, "Unknown (0x%08x)", code); return buf; } static char * diff --git a/sys/dev/disk/nata/ata-all.c b/sys/dev/disk/nata/ata-all.c index d950c50ed3..8e03c3d4a3 100644 --- a/sys/dev/disk/nata/ata-all.c +++ b/sys/dev/disk/nata/ata-all.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-all.c,v 1.273 2006/05/12 05:04:40 jhb Exp $ - * $DragonFly: src/sys/dev/disk/nata/ata-all.c,v 1.4 2006/12/17 19:28:28 dillon Exp $ + * $DragonFly: src/sys/dev/disk/nata/ata-all.c,v 1.5 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -637,7 +637,7 @@ ata_getparam(struct ata_device *atadev, int init) (atacap->hwres & ATA_CABLE_ID) ? "80":"40"); if (init) { - sprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision); + ksprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision); device_set_desc_copy(atadev->dev, buffer); if (atadev->param.config & ATA_PROTO_ATAPI) { if (atapi_dma && ch->dma && diff --git a/sys/dev/disk/nata/ata-chipset.c b/sys/dev/disk/nata/ata-chipset.c index b9638a8a47..4be2eaad92 100644 --- a/sys/dev/disk/nata/ata-chipset.c +++ b/sys/dev/disk/nata/ata-chipset.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.166 2006/07/24 10:44:50 sos Exp $ - * $DragonFly: src/sys/dev/disk/nata/ata-chipset.c,v 1.1 2006/12/04 14:40:37 tgen Exp $ + * $DragonFly: src/sys/dev/disk/nata/ata-chipset.c,v 1.2 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -815,7 +815,7 @@ ata_acard_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "Acard %s %s controller", + ksprintf(buffer, "Acard %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -982,7 +982,7 @@ ata_ali_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "AcerLabs %s %s controller", + ksprintf(buffer, "AcerLabs %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -1234,7 +1234,7 @@ ata_amd_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "AMD %s %s controller", + ksprintf(buffer, "AMD %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -1282,7 +1282,7 @@ ata_ati_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "ATI %s %s controller", + ksprintf(buffer, "ATI %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -1537,7 +1537,7 @@ ata_highpoint_ident(device_t dev) if (pci_get_function(dev) == 1) strcat(buffer, " (channel 2+3)"); } - sprintf(buffer, "%s %s controller", buffer, ata_mode2str(idx->max_dma)); + ksprintf(buffer, "%s %s controller", buffer, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_highpoint_chipinit; @@ -1714,7 +1714,7 @@ ata_intel_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "Intel %s %s controller", + ksprintf(buffer, "Intel %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -2064,7 +2064,7 @@ ata_ite_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "ITE %s %s controller", + ksprintf(buffer, "ITE %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -2173,7 +2173,7 @@ ata_jmicron_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "JMicron %s %s controller", + ksprintf(buffer, "JMicron %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -2337,7 +2337,7 @@ ata_marvell_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "Marvell %s %s controller", + ksprintf(buffer, "Marvell %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -2851,7 +2851,7 @@ ata_nvidia_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "nVidia %s %s controller", + ksprintf(buffer, "nVidia %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -3106,7 +3106,7 @@ ata_promise_ident(device_t dev) start = end = 0; } } - sprintf(buffer, "%s %s controller", buffer, ata_mode2str(idx->max_dma)); + ksprintf(buffer, "%s %s controller", buffer, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_promise_chipinit; @@ -3987,7 +3987,7 @@ ata_serverworks_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "ServerWorks %s %s controller", + ksprintf(buffer, "ServerWorks %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; @@ -4170,7 +4170,7 @@ ata_sii_ident(device_t dev) if (!(idx = ata_match_chip(dev, ids))) return ENXIO; - sprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma)); + ksprintf(buffer, "%s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_sii_chipinit; @@ -4558,7 +4558,7 @@ ata_sis_ident(device_t dev) found = 1; idx->cfg1 = SIS133NEW; idx->max_dma = ATA_UDMA6; - sprintf(buffer, "SiS 962/963 %s controller", + ksprintf(buffer, "SiS 962/963 %s controller", ata_mode2str(idx->max_dma)); } pci_write_config(dev, 0x57, reg57, 1); @@ -4580,12 +4580,12 @@ ata_sis_ident(device_t dev) idx->cfg1 = SIS100NEW; idx->max_dma = ATA_UDMA5; } - sprintf(buffer, "SiS 961 %s controller",ata_mode2str(idx->max_dma)); + ksprintf(buffer, "SiS 961 %s controller",ata_mode2str(idx->max_dma)); } pci_write_config(dev, 0x4a, reg4a, 1); } if (!found) - sprintf(buffer,"SiS %s %s controller", + ksprintf(buffer,"SiS %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); @@ -4792,7 +4792,7 @@ ata_via_ident(device_t dev) return ENXIO; } - sprintf(buffer, "VIA %s %s controller", + ksprintf(buffer, "VIA %s %s controller", idx->text, ata_mode2str(idx->max_dma)); device_set_desc_copy(dev, buffer); ctlr->chip = idx; diff --git a/sys/dev/disk/nata/ata-pci.c b/sys/dev/disk/nata/ata-pci.c index d823665055..42a8f1c2f3 100644 --- a/sys/dev/disk/nata/ata-pci.c +++ b/sys/dev/disk/nata/ata-pci.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.117 2006/05/12 05:04:40 jhb Exp $ - * $DragonFly: src/sys/dev/disk/nata/ata-pci.c,v 1.1 2006/12/04 14:40:37 tgen Exp $ + * $DragonFly: src/sys/dev/disk/nata/ata-pci.c,v 1.2 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -573,7 +573,7 @@ ata_pcichannel_probe(device_t dev) } kfree(children, M_TEMP); - sprintf(buffer, "ATA channel %d", ch->unit); + ksprintf(buffer, "ATA channel %d", ch->unit); device_set_desc_copy(dev, buffer); return ata_probe(dev); diff --git a/sys/dev/disk/nata/ata-queue.c b/sys/dev/disk/nata/ata-queue.c index 2971d47736..5463f31609 100644 --- a/sys/dev/disk/nata/ata-queue.c +++ b/sys/dev/disk/nata/ata-queue.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.65 2006/07/21 19:13:05 imp Exp $ - * $DragonFly: src/sys/dev/disk/nata/ata-queue.c,v 1.2 2006/12/10 23:36:13 tgen Exp $ + * $DragonFly: src/sys/dev/disk/nata/ata-queue.c,v 1.3 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -732,11 +732,11 @@ ata_cmd2str(struct ata_request *request) case 0xaa: return ("SETFEATURES ENABLE RCACHE"); case 0x55: return ("SETFEATURES DISABLE RCACHE"); } - sprintf(buffer, "SETFEATURES 0x%02x", request->u.ata.feature); + ksprintf(buffer, "SETFEATURES 0x%02x", request->u.ata.feature); return buffer; } } - sprintf(buffer, "unknown CMD (0x%02x)", request->u.ata.command); + ksprintf(buffer, "unknown CMD (0x%02x)", request->u.ata.command); return buffer; } diff --git a/sys/dev/disk/nata/ata-raid.c b/sys/dev/disk/nata/ata-raid.c index 555683b241..d24e23eef5 100644 --- a/sys/dev/disk/nata/ata-raid.c +++ b/sys/dev/disk/nata/ata-raid.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-raid.c,v 1.120 2006/04/15 10:27:41 maxim Exp $ - * $DragonFly: src/sys/dev/disk/nata/ata-raid.c,v 1.1 2006/12/04 14:40:37 tgen Exp $ + * $DragonFly: src/sys/dev/disk/nata/ata-raid.c,v 1.2 2006/12/20 18:14:38 dillon Exp $ */ #include @@ -142,7 +142,7 @@ ata_raid_attach(struct ar_softc *rdp, int writeback) rdp->type == AR_T_RAID5) { rdp->total_sectors = (rdp->total_sectors/(rdp->interleave*rdp->width))* (rdp->interleave * rdp->width); - sprintf(buffer, " (stripe %d KB)", + ksprintf(buffer, " (stripe %d KB)", (rdp->interleave * DEV_BSIZE) / 1024); } else @@ -4350,7 +4350,7 @@ ata_raid_adaptec_type(int type) switch (type) { case ADP_T_RAID0: return "RAID0"; case ADP_T_RAID1: return "RAID1"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4433,7 +4433,7 @@ ata_raid_hptv2_type(int type) case HPTV2_T_RAID_5: return "RAID5"; case HPTV2_T_JBOD: return "JBOD"; case HPTV2_T_RAID01_RAID1: return "RAID01_RAID1"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4490,7 +4490,7 @@ ata_raid_hptv3_type(int type) case HPTV3_T_RAID1: return "RAID1"; case HPTV3_T_RAID3: return "RAID3"; case HPTV3_T_RAID5: return "RAID5"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4545,7 +4545,7 @@ ata_raid_intel_type(int type) case INTEL_T_RAID0: return "RAID0"; case INTEL_T_RAID1: return "RAID1"; case INTEL_T_RAID5: return "RAID5"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4605,7 +4605,7 @@ ata_raid_ite_type(int type) case ITE_T_RAID1: return "RAID1"; case ITE_T_RAID01: return "RAID0+1"; case ITE_T_SPAN: return "SPAN"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4644,7 +4644,7 @@ ata_raid_jmicron_type(int type) case JM_T_RAID01: return "RAID0+1"; case JM_T_JBOD: return "JBOD"; case JM_T_RAID5: return "RAID5"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4684,7 +4684,7 @@ ata_raid_lsiv2_type(int type) case LSIV2_T_RAID0: return "RAID0"; case LSIV2_T_RAID1: return "RAID1"; case LSIV2_T_SPARE: return "SPARE"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4734,7 +4734,7 @@ ata_raid_lsiv3_type(int type) switch (type) { case LSIV3_T_RAID0: return "RAID0"; case LSIV3_T_RAID1: return "RAID1"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4792,7 +4792,7 @@ ata_raid_nvidia_type(int type) case NV_T_RAID3: return "RAID3"; case NV_T_RAID5: return "RAID5"; case NV_T_RAID01: return "RAID0+1"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4845,7 +4845,7 @@ ata_raid_promise_type(int type) case PR_T_RAID3: return "RAID3"; case PR_T_RAID5: return "RAID5"; case PR_T_SPAN: return "SPAN"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4911,7 +4911,7 @@ ata_raid_sii_type(int type) case SII_T_RAID1: return "RAID1"; case SII_T_RAID01: return "RAID0+1"; case SII_T_SPARE: return "SPARE"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4961,7 +4961,7 @@ ata_raid_sis_type(int type) case SIS_T_JBOD: return "JBOD"; case SIS_T_RAID0: return "RAID0"; case SIS_T_RAID1: return "RAID1"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } @@ -4998,7 +4998,7 @@ ata_raid_via_type(int type) case VIA_T_RAID5: return "RAID5"; case VIA_T_RAID01: return "RAID0+1"; case VIA_T_SPAN: return "SPAN"; - default: sprintf(buffer, "UNKNOWN 0x%02x", type); + default: ksprintf(buffer, "UNKNOWN 0x%02x", type); return buffer; } } diff --git a/sys/dev/disk/nata/ata-usb.c b/sys/dev/disk/nata/ata-usb.c index bd62c172ec..90aa2fa763 100644 --- a/sys/dev/disk/nata/ata-usb.c +++ b/sys/dev/disk/nata/ata-usb.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/ata-usb.c,v 1.4 2006/03/31 08:09:05 sos Exp $ - * $DragonFly: src/sys/dev/disk/nata/ata-usb.c,v 1.2 2006/12/06 20:20:51 tgen Exp $ + * $DragonFly: src/sys/dev/disk/nata/ata-usb.c,v 1.3 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -844,7 +844,7 @@ ata_usbchannel_probe(device_t dev) } kfree(children, M_TEMP); - sprintf(buffer, "USB lun %d", ch->unit); + ksprintf(buffer, "USB lun %d", ch->unit); device_set_desc_copy(dev, buffer); return 0; diff --git a/sys/dev/disk/nata/atapi-cd.c b/sys/dev/disk/nata/atapi-cd.c index 064a9c71d0..429ccffa6b 100644 --- a/sys/dev/disk/nata/atapi-cd.c +++ b/sys/dev/disk/nata/atapi-cd.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.189 2006/06/28 15:04:10 sos Exp $ - * $DragonFly: src/sys/dev/disk/nata/atapi-cd.c,v 1.1 2006/12/04 14:40:37 tgen Exp $ + * $DragonFly: src/sys/dev/disk/nata/atapi-cd.c,v 1.2 2006/12/20 18:14:38 dillon Exp $ */ #include "opt_ata.h" @@ -1044,7 +1044,7 @@ acd_make_tracknode(device_t dev, int track) struct acd_tracknode *tracknode; char name[16]; - sprintf(name, "acd%dt%d", device_get_unit(dev), track); + ksprintf(name, "acd%dt%d", device_get_unit(dev), track); tracknode = kmalloc(sizeof(struct acd_tracknode), M_ACD, M_WAITOK | M_ZERO); tracknode->cdev = make_dev(&acd_ops, (device_get_unit(dev) << 3) | (track << 16), UID_ROOT, GID_OPERATOR, 0644, diff --git a/sys/dev/disk/nata/atapi-fd.c b/sys/dev/disk/nata/atapi-fd.c index c03b62057b..90fff049cb 100644 --- a/sys/dev/disk/nata/atapi-fd.c +++ b/sys/dev/disk/nata/atapi-fd.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.109 2006/03/30 05:29:57 marcel Exp $ - * $DragonFly: src/sys/dev/disk/nata/atapi-fd.c,v 1.1 2006/12/04 14:40:37 tgen Exp $ + * $DragonFly: src/sys/dev/disk/nata/atapi-fd.c,v 1.2 2006/12/20 18:14:38 dillon Exp $ */ #include @@ -436,10 +436,10 @@ afd_describe(device_t dev) char sizestring[16]; if (fdp->mediasize > 1048576 * 5) - sprintf(sizestring, "%lluMB", (unsigned long long) + ksprintf(sizestring, "%lluMB", (unsigned long long) (fdp->mediasize / 1048576)); else if (fdp->mediasize) - sprintf(sizestring, "%lluKB", (unsigned long long) + ksprintf(sizestring, "%lluKB", (unsigned long long) (fdp->mediasize / 1024)); else strcpy(sizestring, "(no media)"); diff --git a/sys/dev/disk/ncr/ncr.c b/sys/dev/disk/ncr/ncr.c index dd921c7d90..642c0afa43 100644 --- a/sys/dev/disk/ncr/ncr.c +++ b/sys/dev/disk/ncr/ncr.c @@ -1,7 +1,7 @@ /************************************************************************** ** ** $FreeBSD: src/sys/pci/ncr.c,v 1.155.2.3 2001/03/05 13:09:10 obrien Exp $ -** $DragonFly: src/sys/dev/disk/ncr/ncr.c,v 1.15 2006/10/25 20:55:53 dillon Exp $ +** $DragonFly: src/sys/dev/disk/ncr/ncr.c,v 1.16 2006/12/20 18:14:39 dillon Exp $ ** ** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family. ** @@ -1342,7 +1342,7 @@ static int ncr_cache; /* to be aligned _NOT_ static */ static char *ncr_name (ncb_p np) { static char name[10]; - snprintf(name, sizeof(name), "ncr%d", np->unit); + ksnprintf(name, sizeof(name), "ncr%d", np->unit); return (name); } diff --git a/sys/dev/disk/sbp/sbp.c b/sys/dev/disk/sbp/sbp.c index 51b80c8032..dd84c9f142 100644 --- a/sys/dev/disk/sbp/sbp.c +++ b/sys/dev/disk/sbp/sbp.c @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/sbp.c,v 1.74 2004/01/08 14:58:09 simokawa Exp $ - * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.20 2006/10/25 20:55:54 dillon Exp $ + * $DragonFly: src/sys/dev/disk/sbp/sbp.c,v 1.21 2006/12/20 18:14:39 dillon Exp $ * */ @@ -615,7 +615,7 @@ sbp_probe_lun(struct sbp_dev *sdev) /* get firmware revision */ reg = crom_search_key(cc, CSRKEY_FIRM_VER); if (reg != NULL) - snprintf(sdev->revision, sizeof(sdev->revision), + ksnprintf(sdev->revision, sizeof(sdev->revision), "%06x", reg->val); /* get product string */ crom_search_key(cc, CSRKEY_MODEL); diff --git a/sys/dev/disk/sym/sym_hipd.c b/sys/dev/disk/sym/sym_hipd.c index 643241c069..ef7ba62544 100644 --- a/sys/dev/disk/sym/sym_hipd.c +++ b/sys/dev/disk/sym/sym_hipd.c @@ -56,7 +56,7 @@ */ /* $FreeBSD: src/sys/dev/sym/sym_hipd.c,v 1.6.2.12 2001/12/02 19:01:10 groudier Exp $ */ -/* $DragonFly: src/sys/dev/disk/sym/sym_hipd.c,v 1.18 2006/10/25 20:55:54 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/sym/sym_hipd.c,v 1.19 2006/12/20 18:14:39 dillon Exp $ */ #define SYM_DRIVER_NAME "sym-1.6.5-20000902" @@ -9094,7 +9094,7 @@ sym_pci_attach2(pcici_t pci_tag, int unit) /* * Edit its name. */ - snprintf(np->inst_name, sizeof(np->inst_name), "sym%d", np->unit); + ksnprintf(np->inst_name, sizeof(np->inst_name), "sym%d", np->unit); /* * Initialyze the CCB free and busy queues. diff --git a/sys/dev/drm/drm_os_freebsd.h b/sys/dev/drm/drm_os_freebsd.h index a71f8b5c35..bc4e56f89d 100644 --- a/sys/dev/drm/drm_os_freebsd.h +++ b/sys/dev/drm/drm_os_freebsd.h @@ -1,6 +1,6 @@ /* * $FreeBSD: src/sys/dev/drm/drm_os_freebsd.h,v 1.10.2.1 2003/04/26 07:05:28 anholt Exp $ - * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.21 2006/10/25 20:55:54 dillon Exp $ + * $DragonFly: src/sys/dev/drm/Attic/drm_os_freebsd.h,v 1.22 2006/12/20 18:14:39 dillon Exp $ */ #include #include @@ -341,12 +341,12 @@ find_first_zero_bit(volatile void *p, int max) #endif #define DRM_SYSCTL_PRINT(fmt, arg...) \ - snprintf(buf, sizeof(buf), fmt, ##arg); \ + ksnprintf(buf, sizeof(buf), fmt, ##arg); \ error = SYSCTL_OUT(req, buf, strlen(buf)); \ if (error) return error; #define DRM_SYSCTL_PRINT_RET(ret, fmt, arg...) \ - snprintf(buf, sizeof(buf), fmt, ##arg); \ + ksnprintf(buf, sizeof(buf), fmt, ##arg); \ error = SYSCTL_OUT(req, buf, strlen(buf)); \ if (error) { ret; return error; } diff --git a/sys/dev/misc/dcons/dcons_os.c b/sys/dev/misc/dcons/dcons_os.c index 0bf531d673..187b2a2938 100644 --- a/sys/dev/misc/dcons/dcons_os.c +++ b/sys/dev/misc/dcons/dcons_os.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/dcons/dcons_os.c,v 1.4 2004/10/24 12:41:04 simokawa Exp $ - * $DragonFly: src/sys/dev/misc/dcons/dcons_os.c,v 1.7 2006/10/25 20:55:54 dillon Exp $ + * $DragonFly: src/sys/dev/misc/dcons/dcons_os.c,v 1.8 2006/12/20 18:14:39 dillon Exp $ */ #include @@ -398,7 +398,7 @@ dcons_cnprobe(struct consdev *cp) cp->cn_dev = make_dev(&dcons_ops, DCONS_CON, UID_ROOT, GID_WHEEL, 0600, "dcons"); #elif __FreeBSD_version >= 501109 - sprintf(cp->cn_name, "dcons"); + ksprintf(cp->cn_name, "dcons"); #else cp->cn_dev = makedev(CDEV_MAJOR, DCONS_CON); #endif @@ -528,7 +528,7 @@ ok: #if CONS_NODEV gdbconsdev.cn_arg = (void *)&sc[DCONS_GDB]; #if __FreeBSD_version >= 501109 - sprintf(gdbconsdev.cn_name, "dgdb"); + ksprintf(gdbconsdev.cn_name, "dgdb"); #endif gdb_arg = &gdbconsdev; #elif defined(__DragonFly__) diff --git a/sys/dev/misc/musycc/musycc.c b/sys/dev/misc/musycc/musycc.c index ab171f474d..e0d7905cb8 100644 --- a/sys/dev/misc/musycc/musycc.c +++ b/sys/dev/misc/musycc/musycc.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/dev/musycc/musycc.c,v 1.17.2.3 2001/03/13 22:05:36 phk Exp $ - * $DragonFly: src/sys/dev/misc/musycc/musycc.c,v 1.8 2006/10/25 20:55:54 dillon Exp $ + * $DragonFly: src/sys/dev/misc/musycc/musycc.c,v 1.9 2006/12/20 18:14:39 dillon Exp $ * * * @@ -445,24 +445,24 @@ status_chans(struct softc *sc, char *s) scp = sc->chan[i]; if (scp == NULL) continue; - sprintf(s + strlen(s), "c%2d:", i); - sprintf(s + strlen(s), " ts %08x", scp->ts); - sprintf(s + strlen(s), " RX %lus/%lus", + ksprintf(s + strlen(s), "c%2d:", i); + ksprintf(s + strlen(s), " ts %08x", scp->ts); + ksprintf(s + strlen(s), " RX %lus/%lus", time_second - scp->last_recv, time_second - scp->last_rxerr); - sprintf(s + strlen(s), " TX %lus/%lus/%lus", + ksprintf(s + strlen(s), " TX %lus/%lus/%lus", time_second - scp->last_xmit, time_second - scp->last_txerr, time_second - scp->last_txdrop); - sprintf(s + strlen(s), " TXdrop %lu Pend %lu", + ksprintf(s + strlen(s), " TXdrop %lu Pend %lu", scp->tx_drop, scp->tx_pending); - sprintf(s + strlen(s), " CRC %lu Dribble %lu Long %lu Short %lu Abort %lu", + ksprintf(s + strlen(s), " CRC %lu Dribble %lu Long %lu Short %lu Abort %lu", scp->crc_error, scp->dribble_error, scp->long_error, scp->short_error, scp->abort_error); - sprintf(s + strlen(s), "\n TX: %lu RX: %lu\n", + ksprintf(s + strlen(s), "\n TX: %lu RX: %lu\n", scp->txn, scp->rxn); } } @@ -478,42 +478,42 @@ status_8370(struct softc *sc, char *s) u_int32_t *p = sc->ds8370; s += strlen(s); - sprintf(s, "Framer: "); s += strlen(s); + ksprintf(s, "Framer: "); s += strlen(s); switch (sc->framing) { - case WHOKNOWS: sprintf(s, "(unconfigured)\n"); break; - case E1: sprintf(s, "(e1)\n"); break; - case E1U: sprintf(s, "(e1u)\n"); break; - case T1: sprintf(s, "(t1)\n"); break; - case T1U: sprintf(s, "(t1u)\n"); break; - default: sprintf(s, "(mode %d XXX?)\n", sc->framing); break; + case WHOKNOWS: ksprintf(s, "(unconfigured)\n"); break; + case E1: ksprintf(s, "(e1)\n"); break; + case E1U: ksprintf(s, "(e1u)\n"); break; + case T1: ksprintf(s, "(t1)\n"); break; + case T1U: ksprintf(s, "(t1u)\n"); break; + default: ksprintf(s, "(mode %d XXX?)\n", sc->framing); break; } s += strlen(s); - sprintf(s, " Red alarms:"); s += strlen(s); - if (p[0x47] & 0x08) { sprintf(s, " ALOS"); s += strlen(s); } - if (p[0x47] & 0x04) { sprintf(s, " LOS"); s += strlen(s); } + ksprintf(s, " Red alarms:"); s += strlen(s); + if (p[0x47] & 0x08) { ksprintf(s, " ALOS"); s += strlen(s); } + if (p[0x47] & 0x04) { ksprintf(s, " LOS"); s += strlen(s); } if (sc->framing == E1 || sc->framing == T1) { - if (p[0x47] & 0x02) { sprintf(s, " LOF"); s += strlen(s); } + if (p[0x47] & 0x02) { ksprintf(s, " LOF"); s += strlen(s); } } - sprintf(s, "\n Yellow alarms:"); s += strlen(s); - if (p[0x47] & 0x80) { sprintf(s, " RMYEL"); s += strlen(s); } - if (p[0x47] & 0x40) { sprintf(s, " RYEL"); s += strlen(s); } - sprintf(s, "\n Blue alarms:"); s += strlen(s); - if (p[0x47] & 0x10) { sprintf(s, " AIS"); s += strlen(s); } - sprintf(s, "\n"); s += strlen(s); - sprintf(s, "\n Various alarms:"); s += strlen(s); - if (p[0x48] & 0x10) { sprintf(s, " TSHORT"); s += strlen(s); } - sprintf(s, "\n Counters:"); s += strlen(s); + ksprintf(s, "\n Yellow alarms:"); s += strlen(s); + if (p[0x47] & 0x80) { ksprintf(s, " RMYEL"); s += strlen(s); } + if (p[0x47] & 0x40) { ksprintf(s, " RYEL"); s += strlen(s); } + ksprintf(s, "\n Blue alarms:"); s += strlen(s); + if (p[0x47] & 0x10) { ksprintf(s, " AIS"); s += strlen(s); } + ksprintf(s, "\n"); s += strlen(s); + ksprintf(s, "\n Various alarms:"); s += strlen(s); + if (p[0x48] & 0x10) { ksprintf(s, " TSHORT"); s += strlen(s); } + ksprintf(s, "\n Counters:"); s += strlen(s); if (sc->framing == E1) { - sprintf(s, " FERR=%lu", sc->cnt_ferr); s += strlen(s); + ksprintf(s, " FERR=%lu", sc->cnt_ferr); s += strlen(s); } - sprintf(s, " CERR=%lu", sc->cnt_cerr); s += strlen(s); - sprintf(s, " LCV=%lu", sc->cnt_lcv); s += strlen(s); - sprintf(s, " FEBE=%lu", sc->cnt_febe); s += strlen(s); - sprintf(s, " BERR=%lu", sc->cnt_berr); s += strlen(s); - sprintf(s, " FRED=%lu", sc->cnt_fred); s += strlen(s); - sprintf(s, " COFA=%lu", sc->cnt_cofa); s += strlen(s); - sprintf(s, " SEF=%lu", sc->cnt_sef); s += strlen(s); - sprintf(s, "\n"); s += strlen(s); + ksprintf(s, " CERR=%lu", sc->cnt_cerr); s += strlen(s); + ksprintf(s, " LCV=%lu", sc->cnt_lcv); s += strlen(s); + ksprintf(s, " FEBE=%lu", sc->cnt_febe); s += strlen(s); + ksprintf(s, " BERR=%lu", sc->cnt_berr); s += strlen(s); + ksprintf(s, " FRED=%lu", sc->cnt_fred); s += strlen(s); + ksprintf(s, " COFA=%lu", sc->cnt_cofa); s += strlen(s); + ksprintf(s, " SEF=%lu", sc->cnt_sef); s += strlen(s); + ksprintf(s, "\n"); s += strlen(s); } static void @@ -524,13 +524,13 @@ dump_8370(struct softc *sc, char *s, int offset) s += strlen(s); for (i = 0; i < 0x100; i += 16) { - sprintf(s, "%03x: ", i + offset); + ksprintf(s, "%03x: ", i + offset); s += strlen(s); for (j = 0; j < 0x10; j ++) { - sprintf(s, " %02x", p[i + j + offset] & 0xff); + ksprintf(s, " %02x", p[i + j + offset] & 0xff); s += strlen(s); } - sprintf(s, "\n"); + ksprintf(s, "\n"); s += strlen(s); } } @@ -924,7 +924,7 @@ musycc_config(node_p node, char *set, char *ret) if (wframing == sc->framing) return; if (sc->nhooks > 0) { - sprintf(ret, "Cannot change line when %d hooks open\n", sc->nhooks); + ksprintf(ret, "Cannot change line when %d hooks open\n", sc->nhooks); return; } sc->framing = wframing; @@ -1068,7 +1068,7 @@ musycc_newhook(node_p node, hook_p hook, const char *name) sch->sc = sc; sch->state = DOWN; sch->chan = chan; - sprintf(sch->hookname, name); /* XXX overflow ? */ + ksprintf(sch->hookname, name); /* XXX overflow ? */ sc->chan[chan] = sch; } else if (sc->chan[chan]->state == UP) { return (EBUSY); @@ -1532,7 +1532,7 @@ musycc_attach(device_t self) continue; } sc->node->private = sc; - sprintf(sc->nodename, "sync-%d-%d-%d", + ksprintf(sc->nodename, "sync-%d-%d-%d", csc->bus, csc->slot, i); diff --git a/sys/dev/misc/syscons/daemon/daemon_saver.c b/sys/dev/misc/syscons/daemon/daemon_saver.c index 3c7751744e..7eb7d8efb8 100644 --- a/sys/dev/misc/syscons/daemon/daemon_saver.c +++ b/sys/dev/misc/syscons/daemon/daemon_saver.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/modules/syscons/daemon/daemon_saver.c,v 1.18.2.2 2001/05/06 05:44:29 nyan Exp $ - * $DragonFly: src/sys/dev/misc/syscons/daemon/Attic/daemon_saver.c,v 1.6 2006/09/05 00:55:38 dillon Exp $ + * $DragonFly: src/sys/dev/misc/syscons/daemon/Attic/daemon_saver.c,v 1.7 2006/12/20 18:14:39 dillon Exp $ */ #include @@ -352,7 +352,7 @@ daemon_init(video_adapter_t *adp) messagelen = strlen(hostname) + 3 + strlen(ostype) + 1 + strlen(osrelease); message = kmalloc(messagelen + 1, M_SYSCONS, M_WAITOK); - sprintf(message, "%s - %s %s", hostname, ostype, osrelease); + ksprintf(message, "%s - %s %s", hostname, ostype, osrelease); blanked = 0; return 0; } diff --git a/sys/dev/misc/syscons/fred/fred_saver.c b/sys/dev/misc/syscons/fred/fred_saver.c index c21779f9ff..d38321929e 100644 --- a/sys/dev/misc/syscons/fred/fred_saver.c +++ b/sys/dev/misc/syscons/fred/fred_saver.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/modules/syscons/daemon/daemon_saver.c,v 1.18.2.2 2001/05/06 05:44:29 nyan Exp $ - * $DragonFly: src/sys/dev/misc/syscons/fred/fred_saver.c,v 1.6 2006/09/05 00:55:38 dillon Exp $ + * $DragonFly: src/sys/dev/misc/syscons/fred/fred_saver.c,v 1.7 2006/12/20 18:14:39 dillon Exp $ */ #include @@ -352,7 +352,7 @@ daemon_init(video_adapter_t *adp) messagelen = strlen(hostname) + 3 + strlen(ostype) + 1 + strlen(osrelease); message = kmalloc(messagelen + 1, M_SYSCONS, M_WAITOK); - sprintf(message, "%s - %s %s", hostname, ostype, osrelease); + ksprintf(message, "%s - %s %s", hostname, ostype, osrelease); blanked = 0; return 0; } diff --git a/sys/dev/misc/syscons/snake/snake_saver.c b/sys/dev/misc/syscons/snake/snake_saver.c index 3823b57961..4438ccb00b 100644 --- a/sys/dev/misc/syscons/snake/snake_saver.c +++ b/sys/dev/misc/syscons/snake/snake_saver.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/modules/syscons/snake/snake_saver.c,v 1.26.2.2 2001/05/06 05:44:29 nyan Exp $ - * $DragonFly: src/sys/dev/misc/syscons/snake/snake_saver.c,v 1.7 2006/09/05 00:55:39 dillon Exp $ + * $DragonFly: src/sys/dev/misc/syscons/snake/snake_saver.c,v 1.8 2006/12/20 18:14:39 dillon Exp $ */ #include @@ -114,7 +114,7 @@ snake_init(video_adapter_t *adp) { messagelen = strlen(ostype) + 1 + strlen(osrelease); message = kmalloc(messagelen + 1, M_SYSCONS, M_WAITOK); - sprintf(message, "%s %s", ostype, osrelease); + ksprintf(message, "%s %s", ostype, osrelease); messagep = kmalloc(messagelen * sizeof *messagep, M_SYSCONS, M_WAITOK); return 0; } diff --git a/sys/dev/netif/an/if_an.c b/sys/dev/netif/an/if_an.c index ef37a1149f..12ffc8da09 100644 --- a/sys/dev/netif/an/if_an.c +++ b/sys/dev/netif/an/if_an.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/an/if_an.c,v 1.2.2.13 2003/02/11 03:32:48 ambrisko Exp $ - * $DragonFly: src/sys/dev/netif/an/if_an.c,v 1.39 2006/10/25 20:55:55 dillon Exp $ + * $DragonFly: src/sys/dev/netif/an/if_an.c,v 1.40 2006/12/20 18:14:39 dillon Exp $ */ /* @@ -226,7 +226,7 @@ sysctl_an_dump(SYSCTL_HANDLER_ARGS) strcpy(an_conf, "dump"); break; default: - snprintf(an_conf, 5, "%x", an_dump); + ksnprintf(an_conf, 5, "%x", an_dump); break; } diff --git a/sys/dev/netif/ar/if_ar.c b/sys/dev/netif/ar/if_ar.c index 6174d868d4..e330924204 100644 --- a/sys/dev/netif/ar/if_ar.c +++ b/sys/dev/netif/ar/if_ar.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ar/if_ar.c,v 1.66 2005/01/06 01:42:28 imp Exp $ - * $DragonFly: src/sys/dev/netif/ar/if_ar.c,v 1.19 2006/10/25 20:55:55 dillon Exp $ + * $DragonFly: src/sys/dev/netif/ar/if_ar.c,v 1.20 2006/12/20 18:14:39 dillon Exp $ */ /* @@ -333,7 +333,7 @@ ar_attach(device_t device) if (ngar_done_init == 0) ngar_init(NULL); if (ng_make_node_common(&typestruct, &sc->node) != 0) return (1); - sprintf(sc->nodename, "%s%d", NG_AR_NODE_TYPE, sc->unit); + ksprintf(sc->nodename, "%s%d", NG_AR_NODE_TYPE, sc->unit); if (ng_name_node(sc->node, sc->nodename)) { NG_NODE_UNREF(sc->node); /* drop it again */ return (1); @@ -2180,14 +2180,14 @@ ngar_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, break; } arg = (resp)->data; - pos = sprintf(arg, "%ld bytes in, %ld bytes out\n" + pos = ksprintf(arg, "%ld bytes in, %ld bytes out\n" "highest rate seen: %ld B/S in, %ld B/S out\n", sc->inbytes, sc->outbytes, sc->inrate, sc->outrate); - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "%ld output errors\n", sc->oerrors); - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "ierrors = %ld, %ld, %ld, %ld\n", sc->ierrors[0], sc->ierrors[1], @@ -2276,7 +2276,7 @@ ngar_shutdown(node_p node) /* stolen from the attach routine */ if (ng_make_node_common(&typestruct, &sc->node) != 0) return (0); - sprintf(sc->nodename, "%s%d", NG_AR_NODE_TYPE, sc->unit); + ksprintf(sc->nodename, "%s%d", NG_AR_NODE_TYPE, sc->unit); if (ng_name_node(sc->node, sc->nodename)) { sc->node = NULL; printf("node naming failed\n"); diff --git a/sys/dev/netif/ath/hal/ah_osdep.c.patch b/sys/dev/netif/ath/hal/ah_osdep.c.patch index b42663958d..773ef6d03f 100644 --- a/sys/dev/netif/ath/hal/ah_osdep.c.patch +++ b/sys/dev/netif/ath/hal/ah_osdep.c.patch @@ -1,4 +1,4 @@ -# $DragonFly: src/sys/dev/netif/ath/hal/Attic/ah_osdep.c.patch,v 1.1 2006/07/13 09:15:22 sephe Exp $ +# $DragonFly: src/sys/dev/netif/ath/hal/Attic/ah_osdep.c.patch,v 1.2 2006/12/20 18:14:39 dillon Exp $ --- ah_osdep.c 2006-04-22 17:06:43.000000000 +0800 +++ ah_osdep.c 2006-04-22 22:31:56.000000000 +0800 @@ -110,7 +110,7 @@ ath_hal_free(void* p) @@ -29,7 +29,7 @@ - return ether_sprintf(mac); + static char etherbuf[18]; + -+ snprintf(etherbuf, sizeof(etherbuf), "%6D", mac, ":"); ++ ksnprintf(etherbuf, sizeof(etherbuf), "%6D", mac, ":"); + return etherbuf; } diff --git a/sys/dev/netif/bge/if_bge.c b/sys/dev/netif/bge/if_bge.c index 2d86f82a33..75137da7bc 100644 --- a/sys/dev/netif/bge/if_bge.c +++ b/sys/dev/netif/bge/if_bge.c @@ -31,7 +31,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bge/if_bge.c,v 1.3.2.29 2003/12/01 21:06:59 ambrisko Exp $ - * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.58 2006/11/26 07:30:06 sephe Exp $ + * $DragonFly: src/sys/dev/netif/bge/if_bge.c,v 1.59 2006/12/20 18:14:39 dillon Exp $ * */ @@ -1500,7 +1500,7 @@ bge_probe(device_t dev) device_set_desc(dev, sc->bge_vpd_prodname); #endif descbuf = kmalloc(BGE_DEVDESC_MAX, M_TEMP, M_WAITOK); - snprintf(descbuf, BGE_DEVDESC_MAX, "%s, ASIC rev. %#04x", t->bge_name, + ksnprintf(descbuf, BGE_DEVDESC_MAX, "%s, ASIC rev. %#04x", t->bge_name, pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> 16); device_set_desc_copy(dev, descbuf); if (pci_get_subvendor(dev) == PCI_VENDOR_DELL) diff --git a/sys/dev/netif/em/if_em.c b/sys/dev/netif/em/if_em.c index c4ccc74fd9..e95ac26e2d 100644 --- a/sys/dev/netif/em/if_em.c +++ b/sys/dev/netif/em/if_em.c @@ -64,7 +64,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.51 2006/12/09 01:44:23 swildner Exp $ + * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.52 2006/12/20 18:14:39 dillon Exp $ * $FreeBSD$ */ /* @@ -380,7 +380,7 @@ em_probe(device_t dev) ((pci_subdevice_id == ent->subdevice_id) || (ent->subdevice_id == PCI_ANY_ID))) { - snprintf(adapter_name, sizeof(adapter_name), + ksnprintf(adapter_name, sizeof(adapter_name), "%s, Version - %s", em_strings[ent->index], em_driver_version); device_set_desc_copy(dev, adapter_name); diff --git a/sys/dev/netif/en_pci/if_en_pci.c b/sys/dev/netif/en_pci/if_en_pci.c index 8c00214798..3f64dc68d7 100644 --- a/sys/dev/netif/en_pci/if_en_pci.c +++ b/sys/dev/netif/en_pci/if_en_pci.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pci/if_en_pci.c,v 1.12 1999/08/21 22:10:49 msmith Exp $ - * $DragonFly: src/sys/dev/netif/en_pci/if_en_pci.c,v 1.13 2006/09/05 00:55:40 dillon Exp $ + * $DragonFly: src/sys/dev/netif/en_pci/if_en_pci.c,v 1.14 2006/12/20 18:14:39 dillon Exp $ */ /* @@ -236,7 +236,7 @@ en_pci_attach(pcici_t config_id, int unit) en_cd.cd_devs[unit] = sc; /* fake a cfdriver structure */ en_cd.cd_ndevs = NEN; if_initname(&(sc->enif), "en", unit); - snprintf(sc->sc_dev.dv_xname, sizeof(sc->sc_dev.dv_xname), sc->enif.if_xname); + ksnprintf(sc->sc_dev.dv_xname, sizeof(sc->sc_dev.dv_xname), sc->enif.if_xname); scp->en_confid = config_id; /* diff --git a/sys/dev/netif/fwe/if_fwe.c b/sys/dev/netif/fwe/if_fwe.c index 1b5a2a782c..8fa7a63f99 100644 --- a/sys/dev/netif/fwe/if_fwe.c +++ b/sys/dev/netif/fwe/if_fwe.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/if_fwe.c,v 1.27 2004/01/08 14:58:09 simokawa Exp $ - * $DragonFly: src/sys/dev/netif/fwe/if_fwe.c,v 1.27 2006/10/25 20:55:57 dillon Exp $ + * $DragonFly: src/sys/dev/netif/fwe/if_fwe.c,v 1.28 2006/12/20 18:14:39 dillon Exp $ */ #include "opt_inet.h" @@ -377,7 +377,7 @@ fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) ifs = (struct ifstat *)data; len = strlen(ifs->ascii); if (len < sizeof(ifs->ascii)) - snprintf(ifs->ascii + len, + ksnprintf(ifs->ascii + len, sizeof(ifs->ascii) - len, "\tch %d dma %d\n", fwe->stream_ch, fwe->dma_ch); diff --git a/sys/dev/netif/mn/if_mn.c b/sys/dev/netif/mn/if_mn.c index 6c43a412a8..aa1be18301 100644 --- a/sys/dev/netif/mn/if_mn.c +++ b/sys/dev/netif/mn/if_mn.c @@ -22,7 +22,7 @@ * this gadget. * * $FreeBSD: src/sys/pci/if_mn.c,v 1.11.2.3 2001/01/23 12:47:09 phk Exp $ - * $DragonFly: src/sys/dev/netif/mn/if_mn.c,v 1.14 2006/10/25 20:55:57 dillon Exp $ + * $DragonFly: src/sys/dev/netif/mn/if_mn.c,v 1.15 2006/12/20 18:14:39 dillon Exp $ */ /* @@ -307,7 +307,7 @@ ngmn_config(node_p node, char *set, char *ret) if (wframing == sc->framing) return; if (sc->nhooks > 0) { - sprintf(ret, "Cannot change line when %d hooks open\n", sc->nhooks); + ksprintf(ret, "Cannot change line when %d hooks open\n", sc->nhooks); return; } sc->framing = wframing; @@ -372,7 +372,7 @@ ngmn_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, struct ng_mes } pos = 0; - pos += sprintf(pos + r,"Framer status %b;\n", sc->framer_state, "\20" + pos += ksprintf(pos + r,"Framer status %b;\n", sc->framer_state, "\20" "\40LOS\37AIS\36LFA\35RRA" "\34AUXP\33NMF\32LMFA\31frs0.0" "\30frs1.7\27TS16RA\26TS16LOS\25TS16AIS" @@ -381,10 +381,10 @@ ngmn_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, struct ng_mes "\14RY1\13RY2\12RY3\11RY4" "\10SI1\7SI2\6rsp.5\5rsp.4" "\4rsp.3\3RSIF\2RS13\1RS15"); - pos += sprintf(pos + r," Framing errors: %lu", sc->cnt_fec); - pos += sprintf(pos + r," Code Violations: %lu\n", sc->cnt_cvc); + pos += ksprintf(pos + r," Framing errors: %lu", sc->cnt_fec); + pos += ksprintf(pos + r," Code Violations: %lu\n", sc->cnt_cvc); - pos += sprintf(pos + r," Falc State %b;\n", sc->falc_state, "\20" + pos += ksprintf(pos + r," Falc State %b;\n", sc->falc_state, "\20" "\40LOS\37AIS\36LFA\35RRA" "\34AUXP\33NMF\32LMFA\31frs0.0" "\30frs1.7\27TS16RA\26TS16LOS\25TS16AIS" @@ -393,7 +393,7 @@ ngmn_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, struct ng_mes "\14RY1\13RY2\12RY3\11RY4" "\10SI1\7SI2\6rsp.5\5rsp.4" "\4rsp.3\3RSIF\2RS13\1RS15"); - pos += sprintf(pos + r, " Falc IRQ %b\n", sc->falc_irq, "\20" + pos += ksprintf(pos + r, " Falc IRQ %b\n", sc->falc_irq, "\20" "\40RME\37RFS\36T8MS\35RMB\34CASC\33CRC4\32SA6SC\31RPF" "\30b27\27RDO\26ALLS\25XDU\24XMB\23b22\22XLSC\21XPR" "\20FAR\17LFA\16MFAR\15T400MS\14AIS\13LOS\12RAR\11RA" @@ -403,39 +403,39 @@ ngmn_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, struct ng_mes continue; sch = sc->ch[i]; - pos += sprintf(r + pos, " Chan %d <%s> ", + pos += ksprintf(r + pos, " Chan %d <%s> ", i, sch->hook->name); - pos += sprintf(r + pos, " Last Rx: "); + pos += ksprintf(r + pos, " Last Rx: "); if (sch->last_recv) - pos += sprintf(r + pos, "%lu s", time_second - sch->last_recv); + pos += ksprintf(r + pos, "%lu s", time_second - sch->last_recv); else - pos += sprintf(r + pos, "never"); + pos += ksprintf(r + pos, "never"); - pos += sprintf(r + pos, ", last RxErr: "); + pos += ksprintf(r + pos, ", last RxErr: "); if (sch->last_rxerr) - pos += sprintf(r + pos, "%lu s", time_second - sch->last_rxerr); + pos += ksprintf(r + pos, "%lu s", time_second - sch->last_rxerr); else - pos += sprintf(r + pos, "never"); + pos += ksprintf(r + pos, "never"); - pos += sprintf(r + pos, ", last Tx: "); + pos += ksprintf(r + pos, ", last Tx: "); if (sch->last_xmit) - pos += sprintf(r + pos, "%lu s\n", time_second - sch->last_xmit); + pos += ksprintf(r + pos, "%lu s\n", time_second - sch->last_xmit); else - pos += sprintf(r + pos, "never\n"); + pos += ksprintf(r + pos, "never\n"); - pos += sprintf(r + pos, " RX error(s) %lu", sch->rx_error); - pos += sprintf(r + pos, " Short: %lu", sch->short_error); - pos += sprintf(r + pos, " CRC: %lu", sch->crc_error); - pos += sprintf(r + pos, " Mod8: %lu", sch->dribble_error); - pos += sprintf(r + pos, " Long: %lu", sch->long_error); - pos += sprintf(r + pos, " Abort: %lu", sch->abort_error); - pos += sprintf(r + pos, " Overflow: %lu\n", sch->overflow_error); + pos += ksprintf(r + pos, " RX error(s) %lu", sch->rx_error); + pos += ksprintf(r + pos, " Short: %lu", sch->short_error); + pos += ksprintf(r + pos, " CRC: %lu", sch->crc_error); + pos += ksprintf(r + pos, " Mod8: %lu", sch->dribble_error); + pos += ksprintf(r + pos, " Long: %lu", sch->long_error); + pos += ksprintf(r + pos, " Abort: %lu", sch->abort_error); + pos += ksprintf(r + pos, " Overflow: %lu\n", sch->overflow_error); - pos += sprintf(r + pos, " Last error: %b Prev error: %b\n", + pos += ksprintf(r + pos, " Last error: %b Prev error: %b\n", sch->last_error, "\20\7SHORT\5CRC\4MOD8\3LONG\2ABORT\1OVERRUN", sch->prev_error, "\20\7SHORT\5CRC\4MOD8\3LONG\2ABORT\1OVERRUN"); - pos += sprintf(r + pos, " Xmit bytes pending %ld\n", + pos += ksprintf(r + pos, " Xmit bytes pending %ld\n", sch->tx_pending); } (*resp)->header.arglen = pos + 1; @@ -551,7 +551,7 @@ mn_fmt_ts(char *p, u_int32_t ts) for (j = 0; j < 32; j++) { if (!(ts & (1 << j))) continue; - sprintf(p, "%s%d", s, j); + ksprintf(p, "%s%d", s, j); p += strlen(p); s = ","; if (!(ts & (1 << (j+1)))) @@ -559,7 +559,7 @@ mn_fmt_ts(char *p, u_int32_t ts) for (; j < 32; j++) if (!(ts & (1 << (j+1)))) break; - sprintf(p, "-%d", j); + ksprintf(p, "-%d", j); p += strlen(p); s = ","; } @@ -830,7 +830,7 @@ mn_create_channel(struct softc *sc, int chan) sch->sc = sc; sch->state = DOWN; sch->chan = chan; - sprintf(sch->name, "%s%d", sc->name, chan); + ksprintf(sch->name, "%s%d", sc->name, chan); return; } @@ -1315,7 +1315,7 @@ mn_attach (device_t self) sc->dev = self; sc->unit = device_get_unit(self); sc->framing = E1; - sprintf(sc->name, "mn%d", sc->unit); + ksprintf(sc->name, "mn%d", sc->unit); rid = PCIR_MAPS; res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1407,7 +1407,7 @@ mn_attach (device_t self) return (0); } sc->node->private = sc; - sprintf(sc->nodename, "%s%d", NG_MN_NODE_TYPE, sc->unit); + ksprintf(sc->nodename, "%s%d", NG_MN_NODE_TYPE, sc->unit); if (ng_name_node(sc->node, sc->nodename)) { ng_rmnode(sc->node); ng_unref(sc->node); diff --git a/sys/dev/netif/rtw/rtw.c b/sys/dev/netif/rtw/rtw.c index d7270f15ca..cd70ae0560 100644 --- a/sys/dev/netif/rtw/rtw.c +++ b/sys/dev/netif/rtw/rtw.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $NetBSD: rtw.c,v 1.72 2006/03/28 00:48:10 dyoung Exp $ - * $DragonFly: src/sys/dev/netif/rtw/rtw.c,v 1.3 2006/10/25 20:55:58 dillon Exp $ + * $DragonFly: src/sys/dev/netif/rtw/rtw.c,v 1.4 2006/12/20 18:14:39 dillon Exp $ */ /* @@ -858,7 +858,7 @@ rtw_srom_parse(struct rtw_softc *sc) rfname = paname = "reserved"; break; default: - snprintf(scratch, sizeof(scratch), "unknown 0x%02x", + ksnprintf(scratch, sizeof(scratch), "unknown 0x%02x", sc->sc_rfchipid); rfname = paname = scratch; } diff --git a/sys/dev/netif/sk/if_sk.c b/sys/dev/netif/sk/if_sk.c index 6f38f9d5de..5fb271d2e5 100644 --- a/sys/dev/netif/sk/if_sk.c +++ b/sys/dev/netif/sk/if_sk.c @@ -31,7 +31,7 @@ * * $OpenBSD: if_sk.c,v 1.129 2006/10/16 12:30:08 tom Exp $ * $FreeBSD: /c/ncvs/src/sys/pci/if_sk.c,v 1.20 2000/04/22 02:16:37 wpaul Exp $ - * $DragonFly: src/sys/dev/netif/sk/if_sk.c,v 1.49 2006/11/14 12:52:31 sephe Exp $ + * $DragonFly: src/sys/dev/netif/sk/if_sk.c,v 1.50 2006/12/20 18:14:39 dillon Exp $ */ /* @@ -1074,7 +1074,7 @@ sk_probe(device_t dev) return ENXIO; } - snprintf(devname, sizeof(devname), "%s%s (0x%x)", + ksnprintf(devname, sizeof(devname), "%s%s (0x%x)", name, revstr, sc->sk_rev); device_set_desc_copy(dev, devname); return 0; diff --git a/sys/dev/netif/sr/if_sr.c b/sys/dev/netif/sr/if_sr.c index 4c659e78b0..16ea202743 100644 --- a/sys/dev/netif/sr/if_sr.c +++ b/sys/dev/netif/sr/if_sr.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sr/if_sr.c,v 1.48.2.1 2002/06/17 15:10:58 jhay Exp $ - * $DragonFly: src/sys/dev/netif/sr/if_sr.c,v 1.19 2006/10/25 20:55:59 dillon Exp $ + * $DragonFly: src/sys/dev/netif/sr/if_sr.c,v 1.20 2006/12/20 18:14:39 dillon Exp $ */ /* @@ -443,7 +443,7 @@ sr_attach(device_t device) callout_init(&sc->sr_timer); sc->xmitq.ifq_maxlen = IFQ_MAXLEN; sc->xmitq_hipri.ifq_maxlen = IFQ_MAXLEN; - sprintf(sc->nodename, "%s%d", NG_SR_NODE_TYPE, sc->unit); + ksprintf(sc->nodename, "%s%d", NG_SR_NODE_TYPE, sc->unit); if (ng_name_node(sc->node, sc->nodename)) { ng_rmnode(sc->node); ng_unref(sc->node); @@ -2831,14 +2831,14 @@ ngsr_rcvmsg(node_p node, /* * Put in the throughput information. */ - pos = sprintf(arg, "%ld bytes in, %ld bytes out\n" + pos = ksprintf(arg, "%ld bytes in, %ld bytes out\n" "highest rate seen: %ld B/S in, %ld B/S out\n", sc->inbytes, sc->outbytes, sc->inrate, sc->outrate); - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "%ld output errors\n", sc->oerrors); - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "ierrors = %ld, %ld, %ld, %ld, %ld, %ld\n", sc->ierrors[0], sc->ierrors[1], diff --git a/sys/dev/pccard/cardbus/cardbus.c b/sys/dev/pccard/cardbus/cardbus.c index c8b57904e6..a618c107c1 100644 --- a/sys/dev/pccard/cardbus/cardbus.c +++ b/sys/dev/pccard/cardbus/cardbus.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.28 2002/11/27 17:30:41 imp Exp $ - * $DragonFly: src/sys/dev/pccard/cardbus/cardbus.c,v 1.8 2006/10/25 20:56:00 dillon Exp $ + * $DragonFly: src/sys/dev/pccard/cardbus/cardbus.c,v 1.9 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -917,7 +917,7 @@ cardbus_child_location_str(device_t cbdev, device_t child, char *buf, dinfo = device_get_ivars(child); cfg = &dinfo->pci.cfg; - snprintf(buf, buflen, "slot=%d function=%d", pci_get_slot(child), + ksnprintf(buf, buflen, "slot=%d function=%d", pci_get_slot(child), pci_get_function(child)); return (0); } @@ -931,7 +931,7 @@ cardbus_child_pnpinfo_str(device_t cbdev, device_t child, char *buf, dinfo = device_get_ivars(child); cfg = &dinfo->pci.cfg; - snprintf(buf, buflen, "vendor=0x%04x device=0x%04x subvendor=0x%04x " + ksnprintf(buf, buflen, "vendor=0x%04x device=0x%04x subvendor=0x%04x " "subdevice=0x%04x", cfg->vendor, cfg->device, cfg->subvendor, cfg->subdevice); return (0); diff --git a/sys/dev/raid/ciss/ciss.c b/sys/dev/raid/ciss/ciss.c index ceb87633d7..83c458990f 100644 --- a/sys/dev/raid/ciss/ciss.c +++ b/sys/dev/raid/ciss/ciss.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ciss/ciss.c,v 1.2.2.6 2003/02/18 22:27:41 ps Exp $ - * $DragonFly: src/sys/dev/raid/ciss/ciss.c,v 1.20 2006/10/25 20:56:01 dillon Exp $ + * $DragonFly: src/sys/dev/raid/ciss/ciss.c,v 1.21 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -2572,7 +2572,7 @@ ciss_name_device(struct ciss_softc *sc, int target) struct cam_periph *periph; if ((periph = ciss_find_periph(sc, target)) != NULL) { - sprintf(sc->ciss_logical[target].cl_name, "%s%d", periph->periph_name, periph->unit_number); + ksprintf(sc->ciss_logical[target].cl_name, "%s%d", periph->periph_name, periph->unit_number); return(0); } sc->ciss_logical[target].cl_name[0] = 0; diff --git a/sys/dev/raid/dpt/dpt_control.c b/sys/dev/raid/dpt/dpt_control.c index 2731f5a272..c395cf3533 100644 --- a/sys/dev/raid/dpt/dpt_control.c +++ b/sys/dev/raid/dpt/dpt_control.c @@ -37,7 +37,7 @@ */ #ident "$FreeBSD: src/sys/dev/dpt/dpt_control.c,v 1.16 1999/09/25 18:23:48 phk Exp $" -#ident "$DragonFly: src/sys/dev/raid/dpt/dpt_control.c,v 1.11 2006/10/23 21:50:32 dillon Exp $" +#ident "$DragonFly: src/sys/dev/raid/dpt/dpt_control.c,v 1.12 2006/12/20 18:14:40 dillon Exp $" #include "opt_dpt.h" @@ -567,7 +567,7 @@ dpt_read(cdev_t dev, struct uio * uio, int ioflag) command = dpt_rw_command[dpt->unit]; if (strcmp(command, DPT_RW_CMD_DUMP_SOFTC) == 0) { - x = sprintf(wbp, "dpt%d:%s:%s:%s:%s:%x\n", + x = ksprintf(wbp, "dpt%d:%s:%s:%s:%s:%x\n", dpt->unit, dpt->board_data.vendor, dpt->board_data.modelNum, @@ -578,7 +578,7 @@ dpt_read(cdev_t dev, struct uio * uio, int ioflag) wbp += x; } else if (strcmp(command, DPT_RW_CMD_DUMP_SYSINFO) == 0) { - x = sprintf(wbp, "dpt%d:%d:%d:%d:%d:%d:%d:%d:%d:%s:" + x = ksprintf(wbp, "dpt%d:%d:%d:%d:%d:%d:%d:%d:%d:%s:" "%d:%d:%d:%d:%d:%d:%d:%d\n", dpt->unit, dpt_sysinfo.drive0CMOS, @@ -601,7 +601,7 @@ dpt_read(cdev_t dev, struct uio * uio, int ioflag) for (ndx = 0; ndx < 16; ndx++) { if (dpt_sysinfo.drives[ndx].cylinders != 0) { - x = sprintf(wbp, "dpt%d:d%dc%dh%ds%d\n", + x = ksprintf(wbp, "dpt%d:d%dc%dh%ds%d\n", dpt->unit, ndx, dpt_sysinfo.drives[ndx].cylinders, @@ -612,7 +612,7 @@ dpt_read(cdev_t dev, struct uio * uio, int ioflag) } } } else if (strcmp(command, DPT_RW_CMD_DUMP_METRICS) == 0) { - x = sprintf(wbp, + x = ksprintf(wbp, "dpt%d: No metrics available.\n" "Run the dpt_dm command, or use the\n" "DPT_IOCTL_INTERNAL_METRICS ioctl system call\n", @@ -624,13 +624,13 @@ dpt_read(cdev_t dev, struct uio * uio, int ioflag) dpt_reset_performance(dpt); #endif /* DPT_MEASURE_PERFORMANCE */ - x = sprintf(wbp, "dpt%d: Metrics have been cleared\n", + x = ksprintf(wbp, "dpt%d: Metrics have been cleared\n", dpt->unit); work_size += x; wbp += x; } else if (strcmp(command, DPT_RW_CMD_SHOW_LED) == 0) { - x = sprintf(wbp, "dpt%d:%s\n", + x = ksprintf(wbp, "dpt%d:%s\n", dpt->unit, i2bin(dpt_blinking_led(dpt), 8)); work_size += x; wbp += x; diff --git a/sys/dev/raid/iir/iir.c b/sys/dev/raid/iir/iir.c index 09285351ae..fd3ac803fa 100644 --- a/sys/dev/raid/iir/iir.c +++ b/sys/dev/raid/iir/iir.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/iir/iir.c,v 1.2.2.3 2002/05/05 08:18:12 asmodai Exp $ */ -/* $DragonFly: src/sys/dev/raid/iir/iir.c,v 1.14 2006/12/18 20:41:01 dillon Exp $ */ +/* $DragonFly: src/sys/dev/raid/iir/iir.c,v 1.15 2006/12/20 18:14:40 dillon Exp $ */ /* * Copyright (c) 2000-01 Intel Corporation * All Rights Reserved @@ -1174,7 +1174,7 @@ gdt_internal_cache_cmd(struct gdt_softc *gdt,union ccb *ccb) inq->additional_length = 32; inq->flags = SID_CmdQue | SID_Sync; strcpy(inq->vendor, "IIR "); - sprintf(inq->product, "Host Drive #%02d", t); + ksprintf(inq->product, "Host Drive #%02d", t); strcpy(inq->revision, " "); break; } diff --git a/sys/dev/raid/ips/ips.c b/sys/dev/raid/ips/ips.c index f2269d2bb6..18b3e9ebc2 100644 --- a/sys/dev/raid/ips/ips.c +++ b/sys/dev/raid/ips/ips.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/ips/ips.c,v 1.12 2004/05/30 04:01:29 scottl Exp $ - * $DragonFly: src/sys/dev/raid/ips/ips.c,v 1.17 2006/09/10 01:26:35 dillon Exp $ + * $DragonFly: src/sys/dev/raid/ips/ips.c,v 1.18 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -271,7 +271,7 @@ ips_diskdev_statename(u_int8_t state) return("CRS"); break; } - sprintf(statebuf, "UNKNOWN(0x%02x)", state); + ksprintf(statebuf, "UNKNOWN(0x%02x)", state); return (statebuf); } diff --git a/sys/dev/raid/mlx/mlx.c b/sys/dev/raid/mlx/mlx.c index a0c5a8825f..0adbfea2fb 100644 --- a/sys/dev/raid/mlx/mlx.c +++ b/sys/dev/raid/mlx/mlx.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/mlx/mlx.c,v 1.14.2.5 2001/09/11 09:49:53 kris Exp $ - * $DragonFly: src/sys/dev/raid/mlx/mlx.c,v 1.22 2006/10/25 20:56:01 dillon Exp $ + * $DragonFly: src/sys/dev/raid/mlx/mlx.c,v 1.23 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -2752,7 +2752,7 @@ mlx_diagnose_command(struct mlx_command *mc) (mc->mc_status == mlx_messages[i].status)) return(mlx_status_messages[mlx_messages[i].msg]); - sprintf(unkmsg, "unknown response 0x%x for command 0x%x", (int)mc->mc_status, (int)mc->mc_mailbox[0]); + ksprintf(unkmsg, "unknown response 0x%x for command 0x%x", (int)mc->mc_status, (int)mc->mc_mailbox[0]); return(unkmsg); } @@ -2791,7 +2791,7 @@ mlx_describe_controller(struct mlx_softc *sc) } } if (model == NULL) { - sprintf(buf, " model 0x%x", sc->mlx_enq2->me_hardware_id & 0xff); + ksprintf(buf, " model 0x%x", sc->mlx_enq2->me_hardware_id & 0xff); model = buf; } device_printf(sc->mlx_dev, "DAC%s, %d channel%s, firmware %d.%02d-%c-%02d, %dMB RAM\n", diff --git a/sys/dev/raid/mly/mly_cam.c b/sys/dev/raid/mly/mly_cam.c index 98be69f533..380f38b8c3 100644 --- a/sys/dev/raid/mly/mly_cam.c +++ b/sys/dev/raid/mly/mly_cam.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/mly/mly_cam.c,v 1.1.2.3 2001/04/21 04:09:06 msmith Exp $ - * $DragonFly: src/sys/dev/raid/mly/Attic/mly_cam.c,v 1.6 2006/10/25 20:56:01 dillon Exp $ + * $DragonFly: src/sys/dev/raid/mly/Attic/mly_cam.c,v 1.7 2006/12/20 18:14:40 dillon Exp $ */ /* * CAM interface for FreeBSD @@ -582,7 +582,7 @@ mly_name_device(struct mly_softc *sc, int bus, int target) struct cam_periph *periph; if ((periph = mly_find_periph(sc, bus, target)) != NULL) { - sprintf(sc->mly_btl[bus][target].mb_name, "%s%d", periph->periph_name, periph->unit_number); + ksprintf(sc->mly_btl[bus][target].mb_name, "%s%d", periph->periph_name, periph->unit_number); return(0); } sc->mly_btl[bus][target].mb_name[0] = 0; diff --git a/sys/dev/raid/pst/pst-raid.c b/sys/dev/raid/pst/pst-raid.c index 6a2061f6c9..bb64c3cf15 100644 --- a/sys/dev/raid/pst/pst-raid.c +++ b/sys/dev/raid/pst/pst-raid.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/pst/pst-raid.c,v 1.2.2.1 2002/08/18 12:32:36 sos Exp $ - * $DragonFly: src/sys/dev/raid/pst/pst-raid.c,v 1.20 2006/10/25 20:56:01 dillon Exp $ + * $DragonFly: src/sys/dev/raid/pst/pst-raid.c,v 1.21 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -154,7 +154,7 @@ pst_attach(device_t dev) #endif bpack(ident->vendor, ident->vendor, 16); bpack(ident->product, ident->product, 16); - sprintf(name, "%s %s", ident->vendor, ident->product); + ksprintf(name, "%s %s", ident->vendor, ident->product); contigfree(reply, PAGE_SIZE, M_PSTRAID); bioq_init(&psc->bio_queue); diff --git a/sys/dev/raid/twe/twe.c b/sys/dev/raid/twe/twe.c index 05d0a62dfd..c8a2c4e79a 100644 --- a/sys/dev/raid/twe/twe.c +++ b/sys/dev/raid/twe/twe.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/twe/twe.c,v 1.1.2.10 2004/06/11 18:57:31 vkashyap Exp $ - * $DragonFly: src/sys/dev/raid/twe/twe.c,v 1.16 2006/09/05 00:55:42 dillon Exp $ + * $DragonFly: src/sys/dev/raid/twe/twe.c,v 1.17 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -1714,15 +1714,15 @@ twe_format_aen(struct twe_softc *sc, u_int16_t aen) case 'c': if ((child = sc->twe_drive[TWE_AEN_UNIT(aen)].td_disk) != NULL) { - sprintf(buf, "twed%d: %s", device_get_unit(child), msg); + ksprintf(buf, "twed%d: %s", device_get_unit(child), msg); } else { - sprintf(buf, "twe%d: %s for unknown unit %d", device_get_unit(sc->twe_dev), + ksprintf(buf, "twe%d: %s for unknown unit %d", device_get_unit(sc->twe_dev), msg, TWE_AEN_UNIT(aen)); } return(buf); case 'p': - sprintf(buf, "twe%d: port %d: %s", device_get_unit(sc->twe_dev), TWE_AEN_UNIT(aen), + ksprintf(buf, "twe%d: port %d: %s", device_get_unit(sc->twe_dev), TWE_AEN_UNIT(aen), msg); return(buf); @@ -1731,7 +1731,7 @@ twe_format_aen(struct twe_softc *sc, u_int16_t aen) default: break; } - sprintf(buf, "unknown AEN 0x%x", aen); + ksprintf(buf, "unknown AEN 0x%x", aen); return(buf); } diff --git a/sys/dev/raid/twe/twe_freebsd.c b/sys/dev/raid/twe/twe_freebsd.c index 4962fd27ef..1dbeff8e51 100644 --- a/sys/dev/raid/twe/twe_freebsd.c +++ b/sys/dev/raid/twe/twe_freebsd.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/twe/twe_freebsd.c,v 1.2.2.9 2004/06/11 18:57:31 vkashyap Exp $ - * $DragonFly: src/sys/dev/raid/twe/twe_freebsd.c,v 1.23 2006/09/10 01:26:36 dillon Exp $ + * $DragonFly: src/sys/dev/raid/twe/twe_freebsd.c,v 1.24 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -511,7 +511,7 @@ twe_attach_drive(struct twe_softc *sc, struct twe_drive *dr) * XXX It would make sense to test the online/initialising bits, but they seem to be * always set... */ - sprintf(buf, "Unit %d, %s, %s", + ksprintf(buf, "Unit %d, %s, %s", dr->td_twe_unit, twe_describe_code(twe_table_unittype, dr->td_type), twe_describe_code(twe_table_unitstate, dr->td_state & TWE_PARAM_UNITSTATUS_MASK)); diff --git a/sys/dev/raid/vinum/vinumconfig.c b/sys/dev/raid/vinum/vinumconfig.c index 250180030e..3d08375723 100644 --- a/sys/dev/raid/vinum/vinumconfig.c +++ b/sys/dev/raid/vinum/vinumconfig.c @@ -47,7 +47,7 @@ * * $Id: vinumconfig.c,v 1.30 2000/05/01 09:45:50 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumconfig.c,v 1.32.2.6 2002/02/03 00:43:35 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumconfig.c,v 1.8 2006/12/18 20:41:01 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumconfig.c,v 1.9 2006/12/20 18:14:40 dillon Exp $ */ #define STATIC static @@ -1219,7 +1219,7 @@ config_subdisk(int update) strcpy(sd->name, PLEX[sd->plexno].name); /* take it from there */ else /* no way */ throw_rude_remark(EINVAL, "Unnamed sd is not associated with a plex"); - sprintf(sdsuffix, ".s%d", sdindex); /* form the suffix */ + ksprintf(sdsuffix, ".s%d", sdindex); /* form the suffix */ strcat(sd->name, sdsuffix); /* and add it to the name */ } /* do we have complete info for this subdisk? */ @@ -1399,7 +1399,7 @@ config_plex(int update) VOL[plex->volno].name); else /* no way */ throw_rude_remark(EINVAL, "Unnamed plex is not associated with a volume"); - sprintf(plexsuffix, ".p%d", pindex); /* form the suffix */ + ksprintf(plexsuffix, ".p%d", pindex); /* form the suffix */ strcat(plex->name, plexsuffix); /* and add it to the name */ } if (isstriped(plex)) { diff --git a/sys/dev/raid/vinum/vinumio.c b/sys/dev/raid/vinum/vinumio.c index 05867dc482..ebd74e9f37 100644 --- a/sys/dev/raid/vinum/vinumio.c +++ b/sys/dev/raid/vinum/vinumio.c @@ -35,7 +35,7 @@ * * $Id: vinumio.c,v 1.30 2000/05/10 23:23:30 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumio.c,v 1.52.2.6 2002/05/02 08:43:44 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumio.c,v 1.18 2006/12/13 21:58:49 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumio.c,v 1.19 2006/12/20 18:14:40 dillon Exp $ */ #include "vinumhdr.h" @@ -480,7 +480,7 @@ format_config(char *config, int len) vol = &vinum_conf.volume[i]; if ((vol->state > volume_uninit) && (vol->name[0] != '\0')) { /* paranoia */ - snprintf(s, + ksnprintf(s, configend - s, "volume %s state %s", vol->name, @@ -488,7 +488,7 @@ format_config(char *config, int len) while (*s) s++; /* find the end */ if (vol->preferred_plex >= 0) /* preferences, */ - snprintf(s, + ksnprintf(s, configend - s, " readpol prefer %s", vinum_conf.plex[vol->preferred_plex].name); @@ -505,7 +505,7 @@ format_config(char *config, int len) plex = &vinum_conf.plex[i]; if ((plex->state > plex_referenced) && (plex->name[0] != '\0')) { /* paranoia */ - snprintf(s, + ksnprintf(s, configend - s, "plex name %s state %s org %s ", plex->name, @@ -514,7 +514,7 @@ format_config(char *config, int len) while (*s) s++; /* find the end */ if (isstriped(plex)) { - snprintf(s, + ksnprintf(s, configend - s, "%ds ", (int) plex->stripesize); @@ -522,14 +522,14 @@ format_config(char *config, int len) s++; /* find the end */ } if (plex->volno >= 0) /* we have a volume */ - snprintf(s, + ksnprintf(s, configend - s, "vol %s ", vinum_conf.volume[plex->volno].name); while (*s) s++; /* find the end */ for (j = 0; j < plex->subdisks; j++) { - snprintf(s, + ksnprintf(s, configend - s, " sd %s", vinum_conf.sd[plex->sdnos[j]].name); @@ -558,7 +558,7 @@ format_config(char *config, int len) */ if (drivename[0] == '\0') drivename = "*invalid*"; - snprintf(s, + ksnprintf(s, configend - s, "sd name %s drive %s plex %s len %llus driveoffset %llus state %s", sd->name, @@ -570,20 +570,20 @@ format_config(char *config, int len) while (*s) s++; /* find the end */ if (sd->plexno >= 0) - snprintf(s, + ksnprintf(s, configend - s, " plexoffset %llds", (long long) sd->plexoffset); else - snprintf(s, configend - s, " detached"); + ksnprintf(s, configend - s, " detached"); while (*s) s++; /* find the end */ if (sd->flags & VF_RETRYERRORS) { - snprintf(s, configend - s, " retryerrors"); + ksnprintf(s, configend - s, " retryerrors"); while (*s) s++; /* find the end */ } - snprintf(s, configend - s, " \n"); + ksnprintf(s, configend - s, " \n"); while (*s) s++; /* find the end */ } @@ -892,7 +892,7 @@ vinum_scandisk(char *devicename[], int drives) continue; if (part == 'c') continue; - snprintf(partname, DRIVENAMELEN, + ksnprintf(partname, DRIVENAMELEN, "%ss%d%c", devicename[driveno], slice, part); drive = check_drive(partname); /* try to open it */ if ((drive->lasterror != 0) /* didn't work, */ @@ -917,10 +917,10 @@ vinum_scandisk(char *devicename[], int drives) if (part == 'c') continue; if (has_part) { - snprintf(partname, DRIVENAMELEN, + ksnprintf(partname, DRIVENAMELEN, "%s", devicename[driveno]); } else { - snprintf(partname, DRIVENAMELEN, + ksnprintf(partname, DRIVENAMELEN, "%s%c", devicename[driveno], part); } drive = check_drive(partname); /* try to open it */ diff --git a/sys/dev/raid/vinum/vinumrevive.c b/sys/dev/raid/vinum/vinumrevive.c index 9a9cd24be2..defcc75a17 100644 --- a/sys/dev/raid/vinum/vinumrevive.c +++ b/sys/dev/raid/vinum/vinumrevive.c @@ -39,7 +39,7 @@ * * $Id: vinumrevive.c,v 1.14 2000/12/21 01:55:11 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumrevive.c,v 1.22.2.5 2001/03/13 02:59:43 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumrevive.c,v 1.13 2006/09/10 01:26:36 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumrevive.c,v 1.14 2006/12/20 18:14:40 dillon Exp $ */ #include "vinumhdr.h" @@ -300,7 +300,7 @@ parityops(struct vinum_ioctl_msg *data) && (errorloc != -1)) { if (op == checkparity) reply->error = EIO; - sprintf(reply->msg, + ksprintf(reply->msg, "Parity incorrect at offset 0x%llx\n", errorloc); } diff --git a/sys/dev/raid/vinum/vinumstate.c b/sys/dev/raid/vinum/vinumstate.c index 8dfe462c50..ac8c21f603 100644 --- a/sys/dev/raid/vinum/vinumstate.c +++ b/sys/dev/raid/vinum/vinumstate.c @@ -39,7 +39,7 @@ * * $Id: vinumstate.c,v 2.18 2000/05/10 07:30:50 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumstate.c,v 1.28.2.2 2000/06/08 02:00:23 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumstate.c,v 1.6 2006/04/30 17:22:17 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumstate.c,v 1.7 2006/12/20 18:14:40 dillon Exp $ */ #include "vinumhdr.h" @@ -988,7 +988,7 @@ setstate(struct vinum_ioctl_msg *msg) sd = &SD[msg->index]; if ((msg->index >= vinum_conf.subdisks_allocated) || (sd->state <= sd_referenced)) { - sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index); + ksprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index); ioctl_reply->error = EFAULT; return; } @@ -1004,7 +1004,7 @@ setstate(struct vinum_ioctl_msg *msg) plex = &PLEX[msg->index]; if ((msg->index >= vinum_conf.plexes_allocated) || (plex->state <= plex_unallocated)) { - sprintf(ioctl_reply->msg, "Invalid plex %d", msg->index); + ksprintf(ioctl_reply->msg, "Invalid plex %d", msg->index); ioctl_reply->error = EFAULT; return; } @@ -1037,7 +1037,7 @@ setstate(struct vinum_ioctl_msg *msg) sd = &SD[msg->index]; if ((msg->index >= vinum_conf.subdisks_allocated) || (sd->state <= sd_referenced)) { - sprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index); + ksprintf(ioctl_reply->msg, "Invalid subdisk %d", msg->index); ioctl_reply->error = EFAULT; return; } diff --git a/sys/dev/raid/vinum/vinumutil.c b/sys/dev/raid/vinum/vinumutil.c index b9095d5c9c..38f2018947 100644 --- a/sys/dev/raid/vinum/vinumutil.c +++ b/sys/dev/raid/vinum/vinumutil.c @@ -37,7 +37,7 @@ * * $Id: vinumutil.c,v 1.14 1999/12/30 07:04:02 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinumutil.c,v 1.15 2000/02/29 06:16:44 grog Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinumutil.c,v 1.5 2006/09/10 01:26:36 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinumutil.c,v 1.6 2006/12/20 18:14:40 dillon Exp $ */ /* This file contains utility routines used both in kernel and user context */ @@ -45,6 +45,10 @@ #include "vinumhdr.h" #include "statetexts.h" +#ifdef _KERNEL +#define sprintf ksprintf +#endif + static char numeric_state[32]; /* temporary buffer for ASCII conversions */ #define STATECOUNT(x) (sizeof (x##statetext) / sizeof (char *)) /* Return drive state as a string */ diff --git a/sys/dev/sound/isa/ad1816.c b/sys/dev/sound/isa/ad1816.c index 8c7d2a37b2..6cc651d2b4 100644 --- a/sys/dev/sound/isa/ad1816.c +++ b/sys/dev/sound/isa/ad1816.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/ad1816.c,v 1.7.2.9 2002/12/24 21:17:41 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.4 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.5 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.4 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ad1816.c,v 1.5 2006/12/20 18:14:40 dillon Exp $"); struct ad1816_info; @@ -615,11 +615,11 @@ ad1816_attach(device_t dev) goto no; } if (ad1816->drq2) - snprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(ad1816->drq2)); + ksnprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(ad1816->drq2)); else status2[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u", rman_get_start(ad1816->io_base), rman_get_start(ad1816->irq), rman_get_start(ad1816->drq1), diff --git a/sys/dev/sound/isa/ess.c b/sys/dev/sound/isa/ess.c index a5c5f4e252..79627939fc 100644 --- a/sys/dev/sound/isa/ess.c +++ b/sys/dev/sound/isa/ess.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/ess.c,v 1.3.2.8 2002/12/24 21:17:41 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/ess.c,v 1.4 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/ess.c,v 1.5 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ess.c,v 1.4 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/ess.c,v 1.5 2006/12/20 18:14:40 dillon Exp $"); #define ESS_BUFFSIZE (4096) #define ABS(x) (((x) < 0)? -(x) : (x)) @@ -823,7 +823,7 @@ ess_attach(device_t dev) sc->duplex = 0; sc->newspeed = 0; ver = (ess_getmixer(sc, 0x40) << 8) | ess_rd(sc, SB_MIX_DATA); - snprintf(buf, sizeof buf, "ESS %x DSP", ver); + ksnprintf(buf, sizeof buf, "ESS %x DSP", ver); device_set_desc_copy(dev, buf); if (bootverbose) device_printf(dev, "ESS%x detected", ver); @@ -862,11 +862,11 @@ ess_attach(device_t dev) } if (sc->drq2) - snprintf(buf, SND_STATUSLEN, ":%ld", rman_get_start(sc->drq2)); + ksnprintf(buf, SND_STATUSLEN, ":%ld", rman_get_start(sc->drq2)); else buf[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u", rman_get_start(sc->io_base), rman_get_start(sc->irq), rman_get_start(sc->drq1), buf, sc->bufsize); diff --git a/sys/dev/sound/isa/mss.c b/sys/dev/sound/isa/mss.c index 4d29cf1801..e04b53e977 100644 --- a/sys/dev/sound/isa/mss.c +++ b/sys/dev/sound/isa/mss.c @@ -27,12 +27,12 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.48.2.11 2002/12/24 21:17:41 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/mss.c,v 1.7 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/mss.c,v 1.8 2006/12/20 18:14:40 dillon Exp $ */ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/mss.c,v 1.7 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/mss.c,v 1.8 2006/12/20 18:14:40 dillon Exp $"); /* board-specific include files */ #include @@ -1712,11 +1712,11 @@ mss_doattach(device_t dev, struct mss_info *mss) } if (pdma != rdma) - snprintf(status2, SND_STATUSLEN, ":%d", rdma); + ksnprintf(status2, SND_STATUSLEN, ":%d", rdma); else status2[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %d%s bufsz %u", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %d%s bufsz %u", rman_get_start(mss->io_base), rman_get_start(mss->irq), pdma, status2, mss->bufsize); if (pcm_register(dev, mss, 1, 1)) goto no; diff --git a/sys/dev/sound/isa/sb16.c b/sys/dev/sound/isa/sb16.c index e43263ba15..32b8fab7ac 100644 --- a/sys/dev/sound/isa/sb16.c +++ b/sys/dev/sound/isa/sb16.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/sb16.c,v 1.64.2.7 2002/12/24 21:17:42 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.5 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.6 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.5 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb16.c,v 1.6 2006/12/20 18:14:40 dillon Exp $"); #define SB16_BUFFSIZE 4096 #define PLAIN_SB16(x) ((((x)->bd_flags) & (BD_F_SB16|BD_F_SB16X)) == BD_F_SB16) @@ -769,7 +769,7 @@ sb16_probe(device_t dev) f = (ver & 0xffff0000) >> 16; ver &= 0x0000ffff; if (f & BD_F_SB16) { - snprintf(buf, sizeof buf, "SB16 DSP %d.%02d%s", (int) ver >> 8, (int) ver & 0xff, + ksnprintf(buf, sizeof buf, "SB16 DSP %d.%02d%s", (int) ver >> 8, (int) ver & 0xff, (f & BD_F_SB16X)? " (ViBRA16X)" : ""); device_set_desc_copy(dev, buf); return 0; @@ -820,11 +820,11 @@ sb16_attach(device_t dev) } if (!(pcm_getflags(dev) & SD_F_SIMPLEX)) - snprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(sb->drq2)); + ksnprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(sb->drq2)); else status2[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %ud", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %ud", rman_get_start(sb->io_base), rman_get_start(sb->irq), rman_get_start(sb->drq1), status2, sb->bufsize); diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c index 1ec158e925..f44b00ba42 100644 --- a/sys/dev/sound/isa/sb8.c +++ b/sys/dev/sound/isa/sb8.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/isa/sb8.c,v 1.62.2.5 2002/12/24 21:17:42 semenu Exp $ - * $DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.4 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.5 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.4 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/isa/sb8.c,v 1.5 2006/12/20 18:14:40 dillon Exp $"); #define SB_DEFAULT_BUFSZ 4096 @@ -684,7 +684,7 @@ sb_probe(device_t dev) if ((f & BD_F_ESS) || (ver >= 0x400)) return (ENXIO); - snprintf(buf, sizeof buf, "SB DSP %d.%02d", (int) ver >> 8, (int) ver & 0xff); + ksnprintf(buf, sizeof buf, "SB DSP %d.%02d", (int) ver >> 8, (int) ver & 0xff); device_set_desc_copy(dev, buf); @@ -730,7 +730,7 @@ sb_attach(device_t dev) goto no; } - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld bufsz %u", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld bufsz %u", rman_get_start(sb->io_base), rman_get_start(sb->irq), rman_get_start(sb->drq), sb->bufsize); if (pcm_register(dev, sb, 1, 1)) diff --git a/sys/dev/sound/pci/als4000.c b/sys/dev/sound/pci/als4000.c index edeae743cf..a84ea680ad 100644 --- a/sys/dev/sound/pci/als4000.c +++ b/sys/dev/sound/pci/als4000.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/als4000.c,v 1.2.2.5 2002/04/22 15:49:31 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.7 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.8 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -45,7 +45,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.7 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/als4000.c,v 1.8 2006/12/20 18:14:40 dillon Exp $"); /* Debugging macro's */ #undef DEB @@ -819,7 +819,7 @@ als_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &alspchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &alsrchan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq)); pcm_setstatus(dev, status); return 0; diff --git a/sys/dev/sound/pci/aureal.c b/sys/dev/sound/pci/aureal.c index d5e76d522f..88fe4710e0 100644 --- a/sys/dev/sound/pci/aureal.c +++ b/sys/dev/sound/pci/aureal.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/aureal.c,v 1.8.2.7 2002/04/22 15:49:31 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.7 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.8 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.7 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/aureal.c,v 1.8 2006/12/20 18:14:40 dillon Exp $"); /* PCI IDs of supported chips */ #define AU8820_PCI_ID 0x000112eb @@ -649,7 +649,7 @@ au_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", (type[0] == SYS_RES_IOPORT)? "io" : "memory", rman_get_start(reg[0]), rman_get_start(irq)); diff --git a/sys/dev/sound/pci/cmi.c b/sys/dev/sound/pci/cmi.c index 39da88f596..4337003283 100644 --- a/sys/dev/sound/pci/cmi.c +++ b/sys/dev/sound/pci/cmi.c @@ -40,7 +40,7 @@ * those that don't. * * $FreeBSD: src/sys/dev/sound/pci/cmi.c,v 1.1.2.8 2002/08/27 00:17:34 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.6 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.7 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -54,7 +54,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.6 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cmi.c,v 1.7 2006/12/20 18:14:40 dillon Exp $"); /* Supported chip ID's */ #define CMI8338A_PCI_ID 0x010013f6 @@ -899,7 +899,7 @@ cmi_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cmichan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cmichan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq)); pcm_setstatus(dev, status); diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index 6f67f01fa4..561525180f 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -29,7 +29,7 @@ * contributed towards power management. * * $FreeBSD: src/sys/dev/sound/pci/cs4281.c,v 1.2.2.8 2002/08/27 00:25:55 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.7 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.8 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -40,7 +40,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.7 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/cs4281.c,v 1.8 2006/12/20 18:14:40 dillon Exp $"); #define CS4281_DEFAULT_BUFSZ 16384 @@ -860,7 +860,7 @@ cs4281_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cs4281chan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cs4281chan_class, sc); - snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", (sc->regtype == SYS_RES_IOPORT)? "io" : "memory", rman_get_start(sc->reg), rman_get_start(sc->irq)); pcm_setstatus(dev, status); diff --git a/sys/dev/sound/pci/csapcm.c b/sys/dev/sound/pci/csapcm.c index 840deb6ff6..746788e9d2 100644 --- a/sys/dev/sound/pci/csapcm.c +++ b/sys/dev/sound/pci/csapcm.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/csapcm.c,v 1.8.2.7 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.5 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.6 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -41,7 +41,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.5 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/csapcm.c,v 1.6 2006/12/20 18:14:40 dillon Exp $"); /* Buffer size on dma transfer. Fixed for CS416x. */ #define CS461x_BUFFSIZE (4 * 1024) @@ -790,7 +790,7 @@ pcmcsa_attach(device_t dev) return (ENXIO); } - snprintf(status, SND_STATUSLEN, "at irq %ld", rman_get_start(resp->irq)); + ksnprintf(status, SND_STATUSLEN, "at irq %ld", rman_get_start(resp->irq)); /* Enable interrupt. */ if (snd_setup_intr(dev, resp->irq, INTR_MPSAFE, csa_intr, csa, &csa->ih, NULL)) { diff --git a/sys/dev/sound/pci/ds1.c b/sys/dev/sound/pci/ds1.c index 770b8cc629..5350730947 100644 --- a/sys/dev/sound/pci/ds1.c +++ b/sys/dev/sound/pci/ds1.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.8.2.9 2003/04/28 03:59:03 simokawa Exp $ - * $DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.5 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.6 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -36,7 +36,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.5 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ds1.c,v 1.6 2006/12/20 18:14:40 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -995,7 +995,7 @@ ds_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq)); if (pcm_register(dev, sc, DS1_CHANS, 2)) diff --git a/sys/dev/sound/pci/emu10k1.c b/sys/dev/sound/pci/emu10k1.c index 34ff991012..680ffff221 100644 --- a/sys/dev/sound/pci/emu10k1.c +++ b/sys/dev/sound/pci/emu10k1.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.6.2.9 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.9 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.10 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -35,7 +35,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.9 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/emu10k1.c,v 1.10 2006/12/20 18:14:40 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -1891,7 +1891,7 @@ emu_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq)); + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->reg), rman_get_start(sc->irq)); if (pcm_register(dev, sc, sc->nchans, gotmic? 3 : 2)) goto bad; for (i = 0; i < sc->nchans; i++) diff --git a/sys/dev/sound/pci/es137x.c b/sys/dev/sound/pci/es137x.c index 9be4a6aeca..e48b986a40 100644 --- a/sys/dev/sound/pci/es137x.c +++ b/sys/dev/sound/pci/es137x.c @@ -39,7 +39,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/es137x.c,v 1.13.2.10 2002/05/07 17:02:25 greid Exp $ - * $DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.6 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.7 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -62,7 +62,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.6 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/es137x.c,v 1.7 2006/12/20 18:14:40 dillon Exp $"); static int debug = 0; SYSCTL_INT(_debug, OID_AUTO, es_debug, CTLFLAG_RW, &debug, 0, ""); @@ -908,7 +908,7 @@ es_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", (es->regtype == SYS_RES_IOPORT)? "io" : "memory", rman_get_start(es->reg), rman_get_start(es->irq)); diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index 8b3dd60506..69084b64f7 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/fm801.c,v 1.3.2.8 2002/12/24 21:17:42 semenu Exp $ - * $DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.7 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.8 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -32,7 +32,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.7 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.8 2006/12/20 18:14:40 dillon Exp $"); #define PCI_VENDOR_FORTEMEDIA 0x1319 #define PCI_DEVICE_FORTEMEDIA1 0x08011319 @@ -640,7 +640,7 @@ fm801_pci_attach(device_t dev) goto oops; } - snprintf(status, 64, "at %s 0x%lx irq %ld", + ksnprintf(status, 64, "at %s 0x%lx irq %ld", (fm801->regtype == SYS_RES_IOPORT)? "io" : "memory", rman_get_start(fm801->reg), rman_get_start(fm801->irq)); diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 3ddb6a9ed3..896433ad84 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/ich.c,v 1.3.2.12 2003/01/20 03:59:42 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/ich.c,v 1.10 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/ich.c,v 1.11 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -35,7 +35,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ich.c,v 1.10 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/ich.c,v 1.11 2006/12/20 18:14:40 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -784,7 +784,7 @@ ich_pci_attach(device_t dev) if (sc->hasmic) pcm_addchan(dev, PCMDIR_REC, &ichchan_class, sc); /* record mic */ - snprintf(status, SND_STATUSLEN, "at io 0x%lx, 0x%lx irq %ld bufsz %u", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx, 0x%lx irq %ld bufsz %u", rman_get_start(sc->nambar), rman_get_start(sc->nabmbar), rman_get_start(sc->irq), sc->bufsz); pcm_setstatus(dev, status); diff --git a/sys/dev/sound/pci/maestro.c b/sys/dev/sound/pci/maestro.c index 0c5374a872..374dcc66da 100644 --- a/sys/dev/sound/pci/maestro.c +++ b/sys/dev/sound/pci/maestro.c @@ -25,7 +25,7 @@ * * $Id: maestro.c,v 1.12 2000/09/06 03:32:34 taku Exp $ * $FreeBSD: src/sys/dev/sound/pci/maestro.c,v 1.2.2.5 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.6 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.7 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -53,7 +53,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.6 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro.c,v 1.7 2006/12/20 18:14:40 dillon Exp $"); #define inline __inline @@ -1034,7 +1034,7 @@ agg_attach(device_t dev) ess->irqid = irqid; ess->ih = ih; - snprintf(status, SND_STATUSLEN, "at I/O port 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at I/O port 0x%lx irq %ld", rman_get_start(reg), rman_get_start(irq)); if (pcm_register(dev, ess, AGG_MAXPLAYCH, 1)) diff --git a/sys/dev/sound/pci/maestro3.c b/sys/dev/sound/pci/maestro3.c index 76d5fb2e9a..f835a3fdaf 100644 --- a/sys/dev/sound/pci/maestro3.c +++ b/sys/dev/sound/pci/maestro3.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/maestro3.c,v 1.2.2.11 2002/09/16 19:52:33 scottl Exp $ - * $DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.7 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.8 2006/12/20 18:14:40 dillon Exp $ */ /* @@ -64,7 +64,7 @@ #include "gnu/maestro3_reg.h" #include "gnu/maestro3_dsp.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.7 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/maestro3.c,v 1.8 2006/12/20 18:14:40 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -1191,7 +1191,7 @@ m3_pci_attach(device_t dev) goto bad; } } - snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld", (sc->regtype == SYS_RES_IOPORT)? "io" : "memory", rman_get_start(sc->reg), rman_get_start(sc->irq)); if (pcm_setstatus(dev, status)) { diff --git a/sys/dev/sound/pci/neomagic.c b/sys/dev/sound/pci/neomagic.c index bf8dfee4ce..a4a21a59fd 100644 --- a/sys/dev/sound/pci/neomagic.c +++ b/sys/dev/sound/pci/neomagic.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/neomagic.c,v 1.7.2.11 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.5 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.6 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -37,7 +37,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.5 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/neomagic.c,v 1.6 2006/12/20 18:14:40 dillon Exp $"); /* -------------------------------------------------------------------- */ @@ -707,7 +707,7 @@ nm_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at memory 0x%lx, 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at memory 0x%lx, 0x%lx irq %ld", rman_get_start(sc->buf), rman_get_start(sc->reg), rman_get_start(sc->irq)); diff --git a/sys/dev/sound/pci/solo.c b/sys/dev/sound/pci/solo.c index 15c8d3ea75..1cab3625c5 100644 --- a/sys/dev/sound/pci/solo.c +++ b/sys/dev/sound/pci/solo.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/solo.c,v 1.9.2.8 2002/04/22 15:49:32 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/solo.c,v 1.6 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/solo.c,v 1.7 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -36,7 +36,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/solo.c,v 1.6 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/solo.c,v 1.7 2006/12/20 18:14:40 dillon Exp $"); #define SOLO_DEFAULT_BUFSZ 16384 #define ABS(x) (((x) < 0)? -(x) : (x)) @@ -958,7 +958,7 @@ ess_attach(device_t dev) goto no; } - snprintf(status, SND_STATUSLEN, "at io 0x%lx,0x%lx,0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx,0x%lx,0x%lx irq %ld", rman_get_start(sc->io), rman_get_start(sc->sb), rman_get_start(sc->vc), rman_get_start(sc->irq)); diff --git a/sys/dev/sound/pci/t4dwave.c b/sys/dev/sound/pci/t4dwave.c index 59853953d5..cc436141a3 100644 --- a/sys/dev/sound/pci/t4dwave.c +++ b/sys/dev/sound/pci/t4dwave.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/t4dwave.c,v 1.9.2.11 2002/10/22 08:27:13 cognet Exp $ - * $DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.6 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.7 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.6 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/t4dwave.c,v 1.7 2006/12/20 18:14:40 dillon Exp $"); /* -------------------------------------------------------------------- */ #define TDX_PCI_ID 0x20001023 @@ -871,7 +871,7 @@ tr_pci_attach(device_t dev) goto bad; } - snprintf(status, 64, "at io 0x%lx irq %ld", + ksnprintf(status, 64, "at io 0x%lx irq %ld", rman_get_start(tr->reg), rman_get_start(tr->irq)); if (pcm_register(dev, tr, TR_MAXPLAYCH, 1)) goto bad; diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 3d250f0a7b..9b03528471 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/via8233.c,v 1.2.2.2 2003/02/06 17:35:56 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.5 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.6 2006/12/20 18:14:40 dillon Exp $ */ /* Some Credits: @@ -46,7 +46,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.5 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via8233.c,v 1.6 2006/12/20 18:14:40 dillon Exp $"); #define VIA8233_PCI_ID 0x30591106 @@ -607,7 +607,7 @@ via_attach(device_t dev) ac97_setextmode(via->codec, ext); } - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(via->reg), rman_get_start(via->irq)); /* Register */ diff --git a/sys/dev/sound/pci/via82c686.c b/sys/dev/sound/pci/via82c686.c index 3022529a89..b439e7a3b8 100644 --- a/sys/dev/sound/pci/via82c686.c +++ b/sys/dev/sound/pci/via82c686.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pci/via82c686.c,v 1.4.2.10 2003/05/11 01:45:53 orion Exp $ - * $DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.5 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.6 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -36,7 +36,7 @@ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.5 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/via82c686.c,v 1.6 2006/12/20 18:14:40 dillon Exp $"); #define VIA_PCI_ID 0x30581106 #define NSEGS 4 /* Number of segments in SGD table */ @@ -561,7 +561,7 @@ via_attach(device_t dev) if (bus_dmamap_load(via->sgd_dmat, via->sgd_dmamap, via->sgd_table, NSEGS * sizeof(struct via_dma_op), dma_cb, 0, 0)) goto bad; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(via->reg), rman_get_start(via->irq)); + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(via->reg), rman_get_start(via->irq)); /* Register */ if (pcm_register(dev, via, 1, 1)) goto bad; diff --git a/sys/dev/sound/pci/vibes.c b/sys/dev/sound/pci/vibes.c index 1b96cecf14..128a16ffd6 100644 --- a/sys/dev/sound/pci/vibes.c +++ b/sys/dev/sound/pci/vibes.c @@ -28,7 +28,7 @@ * muting. * * $FreeBSD: src/sys/dev/sound/pci/vibes.c,v 1.4.2.6 2002/04/22 15:49:33 cg Exp $ - * $DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.7 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.8 2006/12/20 18:14:40 dillon Exp $ */ #include @@ -39,7 +39,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.7 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/vibes.c,v 1.8 2006/12/20 18:14:40 dillon Exp $"); /* ------------------------------------------------------------------------- */ /* Constants */ @@ -880,7 +880,7 @@ sv_attach(device_t dev) { pcm_addchan(dev, PCMDIR_PLAY, &svpchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &svrchan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", + ksnprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld", rman_get_start(sc->enh_reg), rman_get_start(sc->irq)); pcm_setstatus(dev, status); diff --git a/sys/dev/sound/pcm/ac97.c b/sys/dev/sound/pcm/ac97.c index d1fb646c1b..13d284e3f4 100644 --- a/sys/dev/sound/pcm/ac97.c +++ b/sys/dev/sound/pcm/ac97.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.49 2003/11/11 22:15:17 kuriyama Exp $ - * $DragonFly: src/sys/dev/sound/pcm/ac97.c,v 1.20 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pcm/ac97.c,v 1.21 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -33,7 +33,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/ac97.c,v 1.20 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/ac97.c,v 1.21 2006/12/20 18:14:41 dillon Exp $"); MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec"); @@ -519,16 +519,16 @@ static const char* ac97_hw_desc(u_int32_t id, const char* vname, const char* cname, char* buf) { if (cname == NULL) { - sprintf(buf, "Unknown AC97 Codec (id = 0x%08x)", id); + ksprintf(buf, "Unknown AC97 Codec (id = 0x%08x)", id); return buf; } if (vname == NULL) vname = "Unknown"; if (bootverbose) { - sprintf(buf, "%s %s AC97 Codec (id = 0x%08x)", vname, cname, id); + ksprintf(buf, "%s %s AC97 Codec (id = 0x%08x)", vname, cname, id); } else { - sprintf(buf, "%s %s AC97 Codec", vname, cname); + ksprintf(buf, "%s %s AC97 Codec", vname, cname); } return buf; } @@ -695,7 +695,7 @@ ac97_create(device_t dev, void *devinfo, kobj_class_t cls) if (codec == NULL) return NULL; - snprintf(codec->name, AC97_NAMELEN, "%s:ac97", device_get_nameunit(dev)); + ksnprintf(codec->name, AC97_NAMELEN, "%s:ac97", device_get_nameunit(dev)); codec->lock = snd_mtxcreate(codec->name, "ac97 codec"); codec->methods = kobj_create(cls, M_AC97, 0); if (codec->methods == NULL) { diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 9f2fed8c1e..0fe144795b 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -24,14 +24,14 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.1.2.4 2002/04/22 15:49:35 cg Exp $ - * $DragonFly: src/sys/dev/sound/pcm/buffer.c,v 1.5 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pcm/buffer.c,v 1.6 2006/12/20 18:14:41 dillon Exp $ */ #include #include "feeder_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/buffer.c,v 1.5 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/buffer.c,v 1.6 2006/12/20 18:14:41 dillon Exp $"); #define SNDBUF_NAMELEN 48 struct snd_dbuf { @@ -61,7 +61,7 @@ sndbuf_create(device_t dev, char *drv, char *desc) struct snd_dbuf *b; b = kmalloc(sizeof(*b), M_DEVBUF, M_WAITOK | M_ZERO); - snprintf(b->name, SNDBUF_NAMELEN, "%s:%s", drv, desc); + ksnprintf(b->name, SNDBUF_NAMELEN, "%s:%s", drv, desc); b->dev = dev; return b; diff --git a/sys/dev/sound/pcm/fake.c b/sys/dev/sound/pcm/fake.c index 0927b2650c..ecf1db0cf1 100644 --- a/sys/dev/sound/pcm/fake.c +++ b/sys/dev/sound/pcm/fake.c @@ -24,12 +24,12 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/fake.c,v 1.4.2.5 2002/04/22 15:49:36 cg Exp $ - * $DragonFly: src/sys/dev/sound/pcm/fake.c,v 1.3 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pcm/fake.c,v 1.4 2006/12/20 18:14:41 dillon Exp $ */ #include -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/fake.c,v 1.3 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/fake.c,v 1.4 2006/12/20 18:14:41 dillon Exp $"); static u_int32_t fk_fmt[] = { AFMT_U8, @@ -123,7 +123,7 @@ fkchan_setup(device_t dev) c = kmalloc(sizeof(*c), M_DEVBUF, M_WAITOK); c->methods = kobj_create(&fkchan_class, M_DEVBUF, M_WAITOK); c->parentsnddev = d; - snprintf(c->name, CHN_NAMELEN, "%s:fake", device_get_nameunit(dev)); + ksnprintf(c->name, CHN_NAMELEN, "%s:fake", device_get_nameunit(dev)); return c; } diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 8e134c2a91..1fa801250f 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -24,14 +24,14 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.4.2.8 2002/04/22 15:49:36 cg Exp $ - * $DragonFly: src/sys/dev/sound/pcm/mixer.c,v 1.12 2006/09/10 01:26:37 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pcm/mixer.c,v 1.13 2006/12/20 18:14:41 dillon Exp $ */ #include #include "mixer_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/mixer.c,v 1.12 2006/09/10 01:26:37 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/mixer.c,v 1.13 2006/12/20 18:14:41 dillon Exp $"); MALLOC_DEFINE(M_MIXER, "mixer", "mixer"); @@ -195,7 +195,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo) int i, unit; m = (struct snd_mixer *)kobj_create(cls, M_MIXER, M_WAITOK | M_ZERO); - snprintf(m->name, MIXER_NAMELEN, "%s:mixer", device_get_nameunit(dev)); + ksnprintf(m->name, MIXER_NAMELEN, "%s:mixer", device_get_nameunit(dev)); m->lock = snd_mtxcreate(m->name, "pcm mixer"); m->type = cls->name; m->devinfo = devinfo; diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 6e542e9d05..ac536c71c0 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.17.2.14 2002/11/07 23:17:18 cognet Exp $ - * $DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.6 2006/09/05 00:55:43 dillon Exp $ + * $DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.7 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -34,7 +34,7 @@ #include "feeder_if.h" -SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.6 2006/09/05 00:55:43 dillon Exp $"); +SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pcm/sound.c,v 1.7 2006/12/20 18:14:41 dillon Exp $"); struct snddev_channel { SLIST_ENTRY(snddev_channel) link; @@ -389,7 +389,7 @@ pcm_chn_create(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t c ch->parentsnddev = d; ch->parentchannel = parent; ch->dev = d->dev; - snprintf(ch->name, 32, "%s:%s:%d", device_get_nameunit(d->dev), dirs, ch->num); + ksnprintf(ch->name, 32, "%s:%s:%d", device_get_nameunit(d->dev), dirs, ch->num); err = chn_init(ch, devinfo, dir); if (err) { diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index d0e7ddfb42..b70acfdd40 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1,6 +1,6 @@ /* $NetBSD: uaudio.c,v 1.41 2001/01/23 14:04:13 augustss Exp $ */ /* $FreeBSD: src/sys/dev/sound/usb/uaudio.c,v 1.6.2.2 2002/11/06 21:18:17 joe Exp $: */ -/* $DragonFly: src/sys/dev/sound/usb/uaudio.c,v 1.8 2006/09/05 00:55:43 dillon Exp $: */ +/* $DragonFly: src/sys/dev/sound/usb/uaudio.c,v 1.9 2006/12/20 18:14:41 dillon Exp $: */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -719,7 +719,7 @@ char * uaudio_id_name(struct uaudio_softc *sc, usb_descriptor_t **dps, int id) { static char buf[32]; - sprintf(buf, "i%d", id); + ksprintf(buf, "i%d", id); return (buf); } #endif @@ -877,7 +877,7 @@ uaudio_add_mixer(struct uaudio_softc *sc, usb_descriptor_t *v, MAKE(p+c+1, o+1); } #if !defined(__DragonFly__) - sprintf(mix.ctlname, "mix%d-%s", d->bUnitId, + ksprintf(mix.ctlname, "mix%d-%s", d->bUnitId, uaudio_id_name(sc, dps, d->baSourceId[i])); #endif mix.nchan = chs; @@ -970,7 +970,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_NRDEVICES; #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNmute); mix.ctlunit = ""; @@ -982,7 +982,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, /* mix.ctl = SOUND_MIXER_VOLUME; */ mix.ctl = SOUND_MIXER_PCM; #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNmaster); mix.ctlunit = AudioNvolume; @@ -993,7 +993,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_BASS; #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNbass); mix.ctlunit = AudioNbass; @@ -1004,7 +1004,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNmid); mix.ctlunit = AudioNmid; @@ -1015,7 +1015,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_TREBLE; #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNtreble); mix.ctlunit = AudioNtreble; @@ -1029,7 +1029,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNagc); mix.ctlunit = ""; @@ -1040,7 +1040,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNdelay); mix.ctlunit = "4 ms"; @@ -1051,7 +1051,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNbassboost); mix.ctlunit = ""; @@ -1062,7 +1062,7 @@ uaudio_add_feature(struct uaudio_softc *sc, usb_descriptor_t *v, #if defined(__DragonFly__) mix.ctl = SOUND_MIXER_LOUD; /* Is this correct ? */ #else - sprintf(mix.ctlname, "fea%d-%s-%s", unit, + ksprintf(mix.ctlname, "fea%d-%s-%s", unit, uaudio_id_name(sc, dps, srcId), AudioNloudness); mix.ctlunit = ""; @@ -1104,7 +1104,7 @@ uaudio_add_processing_updown(struct uaudio_softc *sc, usb_descriptor_t *v, mix.type = MIX_ON_OFF; /* XXX */ #if !defined(__DragonFly__) mix.ctlunit = ""; - sprintf(mix.ctlname, "pro%d-mode", d->bUnitId); + ksprintf(mix.ctlname, "pro%d-mode", d->bUnitId); #endif for (i = 0; i < ud->bNrModes; i++) { @@ -1139,7 +1139,7 @@ uaudio_add_processing(struct uaudio_softc *sc, usb_descriptor_t *v, mix.type = MIX_ON_OFF; #if !defined(__DragonFly__) mix.ctlunit = ""; - sprintf(mix.ctlname, "pro%d.%d-enable", d->bUnitId, ptype); + ksprintf(mix.ctlname, "pro%d.%d-enable", d->bUnitId, ptype); #endif uaudio_mixer_add_ctl(sc, &mix); } @@ -1188,7 +1188,7 @@ uaudio_add_extension(struct uaudio_softc *sc, usb_descriptor_t *v, mix.type = MIX_ON_OFF; #if !defined(__DragonFly__) mix.ctlunit = ""; - sprintf(mix.ctlname, "ext%d-enable", d->bUnitId); + ksprintf(mix.ctlname, "ext%d-enable", d->bUnitId); #endif uaudio_mixer_add_ctl(sc, &mix); } diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c index 12bc4a82b2..e779ba597d 100644 --- a/sys/dev/sound/usb/uaudio_pcm.c +++ b/sys/dev/sound/usb/uaudio_pcm.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/sound/usb/uaudio_pcm.c,v 1.1.2.1 2002/08/24 08:03:07 nsayer Exp $ */ -/* $DragonFly: src/sys/dev/sound/usb/uaudio_pcm.c,v 1.4 2006/09/30 21:10:19 swildner Exp $ */ +/* $DragonFly: src/sys/dev/sound/usb/uaudio_pcm.c,v 1.5 2006/12/20 18:14:41 dillon Exp $ */ /* * Copyright (c) 2000-2002 Hiroyuki Aizu @@ -313,7 +313,7 @@ ua_attach(device_t dev) return(ENXIO); } - snprintf(status, SND_STATUSLEN, "at addr ?"); + ksnprintf(status, SND_STATUSLEN, "at addr ?"); if (pcm_register(dev, ua, 1, 0)) { return(ENXIO); diff --git a/sys/dev/usbmisc/udbp/udbp.c b/sys/dev/usbmisc/udbp/udbp.c index 64ed96327a..34f4078352 100644 --- a/sys/dev/usbmisc/udbp/udbp.c +++ b/sys/dev/usbmisc/udbp/udbp.c @@ -27,7 +27,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/usb/udbp.c,v 1.24 2003/08/24 17:55:55 obrien Exp $ - * $DragonFly: src/sys/dev/usbmisc/udbp/Attic/udbp.c,v 1.8 2006/10/25 20:56:02 dillon Exp $ + * $DragonFly: src/sys/dev/usbmisc/udbp/Attic/udbp.c,v 1.9 2006/12/20 18:14:41 dillon Exp $ */ /* Driver for arbitrary double bulk pipe devices. @@ -366,7 +366,7 @@ USB_ATTACH(udbp) if ((err = ng_make_node_common(&ng_udbp_typestruct, &sc->node)) == 0) { char nodename[128]; - sprintf(nodename, "%s", USBDEVNAME(sc->sc_dev)); + ksprintf(nodename, "%s", USBDEVNAME(sc->sc_dev)); if ((err = ng_name_node(sc->node, nodename))) { NG_NODE_UNREF(sc->node); sc->node = NULL; @@ -794,7 +794,7 @@ ng_udbp_rmnode(node_p node) if ((err = ng_make_node_common(&ng_udbp_typestruct, &sc->node)) == 0) { char nodename[128]; - sprintf(nodename, "%s", USBDEVNAME(sc->sc_dev)); + ksprintf(nodename, "%s", USBDEVNAME(sc->sc_dev)); if ((err = ng_name_node(sc->node, nodename))) { NG_NODE_UNREF(sc->node); /* out damned spot! */ sc->flags &= ~NETGRAPH_INITIALISED; diff --git a/sys/dev/usbmisc/umass/umass.c b/sys/dev/usbmisc/umass/umass.c index 47f12496c9..98a6208ee6 100644 --- a/sys/dev/usbmisc/umass/umass.c +++ b/sys/dev/usbmisc/umass/umass.c @@ -26,7 +26,7 @@ * * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ * $FreeBSD: src/sys/dev/usb/umass.c,v 1.96 2003/12/19 12:19:11 sanpei Exp $ - * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.18 2006/09/05 00:55:44 dillon Exp $ + * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.19 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -3062,7 +3062,7 @@ umass_dump_buffer(struct umass_softc *sc, u_int8_t *buffer, int buflen, s1[0] = '\0'; s3[0] = '\0'; - sprintf(s2, " buffer=%p, buflen=%d", buffer, buflen); + ksprintf(s2, " buffer=%p, buflen=%d", buffer, buflen); for (i = 0; i < buflen && i < printlen; i++) { j = i % 16; if (j == 0 && i != 0) { @@ -3070,10 +3070,10 @@ umass_dump_buffer(struct umass_softc *sc, u_int8_t *buffer, int buflen, USBDEVNAME(sc->sc_dev), s1, s2)); s2[0] = '\0'; } - sprintf(&s1[j*2], "%02x", buffer[i] & 0xff); + ksprintf(&s1[j*2], "%02x", buffer[i] & 0xff); } if (buflen > printlen) - sprintf(s3, " ..."); + ksprintf(s3, " ..."); DPRINTF(UDMASS_GEN, ("%s: 0x %s%s%s\n", USBDEVNAME(sc->sc_dev), s1, s2, s3)); } diff --git a/sys/dev/video/bktr/bktr_audio.c b/sys/dev/video/bktr/bktr_audio.c index c0aed93cc5..ac26f65f25 100644 --- a/sys/dev/video/bktr/bktr_audio.c +++ b/sys/dev/video/bktr/bktr_audio.c @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bktr/bktr_audio.c,v 1.13 2003/12/08 07:59:18 obrien Exp $ - * $DragonFly: src/sys/dev/video/bktr/bktr_audio.c,v 1.7 2006/10/25 20:56:02 dillon Exp $ + * $DragonFly: src/sys/dev/video/bktr/bktr_audio.c,v 1.8 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -439,7 +439,7 @@ void msp_read_id( bktr_ptr_t bktr ){ rev1 = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x001e); rev2 = msp_dpl_read(bktr, bktr->msp_addr, 0x12, 0x001f); - sprintf(bktr->msp_version_string, "34%02d%c-%c%d", + ksprintf(bktr->msp_version_string, "34%02d%c-%c%d", (rev2>>8)&0xff, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@', rev2&0x1f); } @@ -595,7 +595,7 @@ void dpl_read_id( bktr_ptr_t bktr ){ rev1 = msp_dpl_read(bktr, bktr->dpl_addr, 0x12, 0x001e); rev2 = msp_dpl_read(bktr, bktr->dpl_addr, 0x12, 0x001f); - sprintf(bktr->dpl_version_string, "34%02d%c-%c%d", + ksprintf(bktr->dpl_version_string, "34%02d%c-%c%d", ((rev2>>8)&0xff)-1, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@', rev2&0x1f); } diff --git a/sys/dev/video/bktr/bktr_os.c b/sys/dev/video/bktr/bktr_os.c index 51ab5b5f5f..78c519b9d7 100644 --- a/sys/dev/video/bktr/bktr_os.c +++ b/sys/dev/video/bktr/bktr_os.c @@ -31,7 +31,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.45 2004/03/17 17:50:28 njl Exp $ - * $DragonFly: src/sys/dev/video/bktr/bktr_os.c,v 1.16 2006/10/25 20:56:02 dillon Exp $ + * $DragonFly: src/sys/dev/video/bktr/bktr_os.c,v 1.17 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -236,7 +236,7 @@ bktr_attach( device_t dev ) unit = device_get_unit(dev); /* build the device name for bktr_name() */ - snprintf(bktr->bktr_xname, sizeof(bktr->bktr_xname), "bktr%d",unit); + ksnprintf(bktr->bktr_xname, sizeof(bktr->bktr_xname), "bktr%d",unit); /* * Enable bus mastering and Memory Mapped device diff --git a/sys/dev/video/bktr/msp34xx.c b/sys/dev/video/bktr/msp34xx.c index 182d6d74fa..b658d5ca8a 100644 --- a/sys/dev/video/bktr/msp34xx.c +++ b/sys/dev/video/bktr/msp34xx.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bktr/msp34xx.c,v 1.5 2004/12/16 23:19:57 julian Exp - * $DragonFly: src/sys/dev/video/bktr/msp34xx.c,v 1.5 2006/10/25 20:56:02 dillon Exp $ + * $DragonFly: src/sys/dev/video/bktr/msp34xx.c,v 1.6 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -1147,7 +1147,7 @@ int msp_attach(bktr_ptr_t bktr) kfree(msp, M_DEVBUF); return ENOMEM; } - snprintf(msp->threaddesc, 14, "%s_msp34xx_thread", bktr->bktr_xname); + ksnprintf(msp->threaddesc, 14, "%s_msp34xx_thread", bktr->bktr_xname); for (i = 0; i < DFP_COUNT; i++) msp->dfp_regs[i] = -1; @@ -1170,7 +1170,7 @@ int msp_attach(bktr_ptr_t bktr) msp3400c_write(bktr,I2C_MSP3400C_DFP, 0x0014, 0x1040); #endif - sprintf(buf,"MSP34%02d%c-%c%d", + ksprintf(buf,"MSP34%02d%c-%c%d", (rev2>>8)&0xff, (rev1&0xff)+'@', ((rev1>>8)&0xff)+'@', rev2&0x1f); msp->nicam = (((rev2>>8)&0xff) != 00) ? 1 : 0; diff --git a/sys/dev/video/gsc/gsc.c b/sys/dev/video/gsc/gsc.c index d029d5d7c0..a65377826d 100644 --- a/sys/dev/video/gsc/gsc.c +++ b/sys/dev/video/gsc/gsc.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/gsc.c,v 1.35.2.1 2000/08/08 19:49:53 peter Exp $ - * $DragonFly: src/sys/dev/video/gsc/gsc.c,v 1.13 2006/09/10 01:26:38 dillon Exp $ + * $DragonFly: src/sys/dev/video/gsc/gsc.c,v 1.14 2006/12/20 18:14:41 dillon Exp $ * */ @@ -676,7 +676,7 @@ gscread (struct dev_read_args *ap) char *p; int width = geomtab[scu->geometry].dpl; - sprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height); + ksprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height); scu->bcount = scu->height * width / 8; lprintf(("gsc%d.read: initializing pbm mode: `%s', bcount: 0x%x\n", diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c b/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c index f9c03ff962..761dc993ce 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c @@ -39,7 +39,7 @@ * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 * * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_misc.c,v 1.3.2.8 2001/06/25 19:46:47 pirzyk Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c,v 1.14 2006/01/06 15:01:38 joerg Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_misc.c,v 1.15 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -137,7 +137,7 @@ linprocfs_domeminfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, cached = vmstats.v_cache_count * PAGE_SIZE; ps = psbuf; - ps += sprintf(ps, + ps += ksprintf(ps, " total: used: free: shared: buffers: cached:\n" "Mem: %lu %lu %lu %lu %lu %lu\n" "Swap: %llu %llu %llu\n" @@ -208,7 +208,7 @@ linprocfs_docpuinfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, } ps = psbuf; - ps += sprintf(ps, + ps += ksprintf(ps, "processor\t: %d\n" "vendor_id\t: %.20s\n" "cpu family\t: %d\n" @@ -216,7 +216,7 @@ linprocfs_docpuinfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, "stepping\t: %d\n", 0, cpu_vendor, class, cpu, cpu_id & 0xf); - ps += sprintf(ps, + ps += ksprintf(ps, "flags\t\t:"); if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) { @@ -227,10 +227,10 @@ linprocfs_docpuinfo(struct proc *curp, struct proc *p, struct pfsnode *pfs, for (i = 0; i < 32; i++) if (cpu_feature & (1 << i)) - ps += sprintf(ps, " %s", flags[i]); - ps += sprintf(ps, "\n"); + ps += ksprintf(ps, " %s", flags[i]); + ps += ksprintf(ps, "\n"); if (class >= 5) { - ps += sprintf(ps, + ps += ksprintf(ps, "cpu MHz\t\t: %d.%02d\n" "bogomips\t: %d.%02d\n", (tsc_freq + 4999) / 1000000, @@ -263,7 +263,7 @@ linprocfs_dostat(struct proc *curp, struct proc *p, struct pfsnode *pfs, char psbuf[512]; ps = psbuf; - ps += sprintf(ps, + ps += ksprintf(ps, "cpu %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64"\n" "disk 0 0 0 0\n" "page %u %u\n" @@ -295,7 +295,7 @@ linprocfs_douptime(struct proc *curp, struct proc *p, struct pfsnode *pfs, getmicrouptime(&tv); ps = psbuf; - ps += sprintf(ps, "%ld.%02ld %"PRIu64".%02"PRIu64"\n", + ps += ksprintf(ps, "%ld.%02ld %"PRIu64".%02"PRIu64"\n", tv.tv_sec, tv.tv_usec / 10000, T2S(cpu_time.cp_idle), T2J(cpu_time.cp_idle) % 100); return (uiomove_frombuf(psbuf, ps - psbuf, uio)); @@ -322,8 +322,8 @@ linprocfs_doprocstat(struct proc *curp, struct proc *p, struct pfsnode *pfs, char *ps, psbuf[1024]; ps = psbuf; - ps += sprintf(ps, "%d", p->p_pid); -#define PS_ADD(name, fmt, arg) ps += sprintf(ps, " " fmt, arg) + ps += ksprintf(ps, "%d", p->p_pid); +#define PS_ADD(name, fmt, arg) ps += ksprintf(ps, " " fmt, arg) PS_ADD("comm", "(%s)", p->p_comm); PS_ADD("statr", "%c", '0'); /* XXX */ PS_ADD("ppid", "%d", p->p_pptr ? p->p_pptr->p_pid : 0); @@ -359,7 +359,7 @@ linprocfs_doprocstat(struct proc *curp, struct proc *p, struct pfsnode *pfs, PS_ADD("sigcatch", "%d", 0); /* XXX */ PS_ADD("wchan", "%u", 0); /* XXX */ #undef PS_ADD - ps += sprintf(ps, "\n"); + ps += ksprintf(ps, "\n"); return (uiomove_frombuf(psbuf, ps - psbuf, uio)); } @@ -394,7 +394,7 @@ linprocfs_doprocstatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, else state = state_str[(int)p->p_stat]; -#define PS_ADD ps += sprintf +#define PS_ADD ps += ksprintf PS_ADD(ps, "Name:\t%s\n", p->p_comm); /* XXX escape */ PS_ADD(ps, "State:\t%s\n", state); @@ -466,7 +466,7 @@ linprocfs_doloadavg(struct proc *curp, struct proc *p, char *ps, psbuf[512]; ps = psbuf; - ps += sprintf(ps, "%d.%02d %d.%02d %d.%02d %d/%d %d\n", + ps += ksprintf(ps, "%d.%02d %d.%02d %d.%02d %d/%d %d\n", (int)(averunnable.ldavg[0] / averunnable.fscale), (int)(averunnable.ldavg[0] * 100 / averunnable.fscale % 100), (int)(averunnable.ldavg[1] / averunnable.fscale), diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c index d9f446d7df..d7f0fe34cd 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c @@ -39,7 +39,7 @@ * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_vnops.c,v 1.3.2.5 2001/08/12 14:29:19 rwatson Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.37 2006/11/07 20:48:13 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.38 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -481,7 +481,7 @@ linprocfs_getattr(struct vop_getattr_args *ap) vap->va_uid = 0; vap->va_gid = 0; vap->va_size = vap->va_bytes = - snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); + ksnprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); break; } @@ -990,7 +990,7 @@ linprocfs_readdir_root_callback(struct proc *p, void *data) return(0); } d_ino = PROCFS_FILENO(p->p_pid, Pproc); - d_namlen = snprintf(d_name_pid, sizeof(d_name_pid), + d_namlen = ksnprintf(d_name_pid, sizeof(d_name_pid), "%ld", (long)p->p_pid); d_name = d_name_pid; d_type = DT_DIR; @@ -1033,7 +1033,7 @@ linprocfs_readlink(struct vop_readlink_args *ap) if (pfs->pfs_fileno != PROCFS_FILENO(0, Pself)) return (EINVAL); - len = snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); + len = ksnprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); return (uiomove(buf, len, ap->a_uio)); /* diff --git a/sys/emulation/linux/linux_ioctl.c b/sys/emulation/linux/linux_ioctl.c index 4a2effc00d..3a6dd62e95 100644 --- a/sys/emulation/linux/linux_ioctl.c +++ b/sys/emulation/linux/linux_ioctl.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.55.2.11 2003/05/01 20:16:09 anholt Exp $ - * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.20 2006/06/05 07:26:09 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.21 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -923,7 +923,7 @@ linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen) ethno = 0; TAILQ_FOREACH(ifscan, &ifnet, if_link) { if (ifscan == ifp) - return (snprintf(buffer, buflen, "eth%d", ethno)); + return (ksnprintf(buffer, buflen, "eth%d", ethno)); if (IFP_IS_ETH(ifscan)) ethno++; } @@ -1004,7 +1004,7 @@ linux_ioctl_SIOCGIFCONF(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, bzero(&ifr, sizeof ifr); if (IFP_IS_ETH(ifp)) - snprintf(ifr.ifr_name, LINUX_IFNAMSIZ, "eth%d", + ksnprintf(ifr.ifr_name, LINUX_IFNAMSIZ, "eth%d", ethno++); else strlcpy(ifr.ifr_name, ifp->if_xname, LINUX_IFNAMSIZ); diff --git a/sys/emulation/ndis/kern_ndis.c b/sys/emulation/ndis/kern_ndis.c index 2678b405cc..4c66292d5e 100644 --- a/sys/emulation/ndis/kern_ndis.c +++ b/sys/emulation/ndis/kern_ndis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.57 2004/07/11 00:19:30 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/kern_ndis.c,v 1.13 2006/10/25 20:56:02 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/kern_ndis.c,v 1.14 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -626,17 +626,17 @@ ndis_create_sysctls(void *arg) "NDIS API Version", "0x00050001", CTLFLAG_RD); /* Bus type (PCI, PCMCIA, etc...) */ - sprintf(buf, "%d", (int)sc->ndis_iftype); + ksprintf(buf, "%d", (int)sc->ndis_iftype); ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD); if (sc->ndis_res_io != NULL) { - sprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io)); + ksprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io)); ndis_add_sysctl(sc, "IOBaseAddress", "Base I/O Address", buf, CTLFLAG_RD); } if (sc->ndis_irq != NULL) { - sprintf(buf, "%lu", rman_get_start(sc->ndis_irq)); + ksprintf(buf, "%lu", rman_get_start(sc->ndis_irq)); ndis_add_sysctl(sc, "InterruptNumber", "Interrupt Number", buf, CTLFLAG_RD); } @@ -656,7 +656,7 @@ ndis_add_sysctl(void *arg, char *key, char *desc, char *val, int flag) cfg = kmalloc(sizeof(struct ndis_cfglist), M_DEVBUF, M_WAITOK|M_ZERO); cfg->ndis_cfg.nc_cfgkey = kstrdup(key, M_DEVBUF); if (desc == NULL) { - snprintf(descstr, sizeof(descstr), "%s (dynamic)", key); + ksnprintf(descstr, sizeof(descstr), "%s (dynamic)", key); cfg->ndis_cfg.nc_cfgdesc = kstrdup(descstr, M_DEVBUF); } else cfg->ndis_cfg.nc_cfgdesc = kstrdup(desc, M_DEVBUF); diff --git a/sys/emulation/ndis/subr_ndis.c b/sys/emulation/ndis/subr_ndis.c index 59b6767e39..ec9abde9bb 100644 --- a/sys/emulation/ndis/subr_ndis.c +++ b/sys/emulation/ndis/subr_ndis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.62 2004/07/11 00:19:30 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.17 2006/10/25 20:56:02 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.18 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -612,10 +612,10 @@ ndis_decode_parm(ndis_miniport_block *block, ndis_config_parm *parm, kfree(astr, M_DEVBUF); break; case ndis_parm_int: - sprintf(val, "%d", parm->ncp_parmdata.ncp_intdata); + ksprintf(val, "%d", parm->ncp_parmdata.ncp_intdata); break; case ndis_parm_hexint: - sprintf(val, "%xu", parm->ncp_parmdata.ncp_intdata); + ksprintf(val, "%xu", parm->ncp_parmdata.ncp_intdata); break; default: return(NDIS_STATUS_FAILURE); @@ -2288,7 +2288,7 @@ ndis_open_file(ndis_status *status, ndis_handle *filehandle, uint32_t *filelengt ndis_unicode_to_ascii(filename->nus_buf, filename->nus_len, &afilename); - sprintf(path, "%s/%s", ndis_filepath, afilename); + ksprintf(path, "%s/%s", ndis_filepath, afilename); kfree(afilename, M_DEVBUF); fh = kmalloc(sizeof(ndis_fh), M_TEMP, M_WAITOK); diff --git a/sys/emulation/ndis/subr_ntoskrnl.c b/sys/emulation/ndis/subr_ntoskrnl.c index 494665862a..10bd503e46 100644 --- a/sys/emulation/ndis/subr_ntoskrnl.c +++ b/sys/emulation/ndis/subr_ntoskrnl.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.40 2004/07/20 20:28:57 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/subr_ntoskrnl.c,v 1.11 2006/12/18 20:41:01 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_ntoskrnl.c,v 1.12 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -1409,7 +1409,7 @@ ntoskrnl_create_thread(ndis_handle *handle, uint32_t reqaccess, tc->tc_thrctx = thrctx; tc->tc_thrfunc = thrfunc; - sprintf(tname, "windows kthread %d", ntoskrnl_kth); + ksprintf(tname, "windows kthread %d", ntoskrnl_kth); error = kthread_create_stk(ntoskrnl_thrfunc, tc, &td, NDIS_KSTACK_PAGES * PAGE_SIZE, tname); *handle = td; @@ -1689,9 +1689,9 @@ image_patch_table ntoskrnl_functbl[] = { { "RtlFreeAnsiString", (FUNC)ntoskrnl_free_ansi_string }, { "RtlFreeUnicodeString", (FUNC)ntoskrnl_free_unicode_string }, { "RtlUnicodeStringToInteger", (FUNC)ntoskrnl_unicode_to_int }, - { "sprintf", (FUNC)sprintf }, + { "sprintf", (FUNC)ksprintf }, { "vsprintf", (FUNC)kvsprintf }, - { "_snprintf", (FUNC)snprintf }, + { "_snprintf", (FUNC)ksnprintf }, { "_vsnprintf", (FUNC)kvsnprintf }, { "DbgPrint", (FUNC)ntoskrnl_dbgprint }, { "DbgBreakPoint", (FUNC)ntoskrnl_debugger }, diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 5b8dcaa2df..98c8cedb4c 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/kern/imgact_elf.c,v 1.73.2.13 2002/12/28 19:49:41 dillon Exp $ - * $DragonFly: src/sys/kern/imgact_elf.c,v 1.43 2006/10/27 04:56:31 dillon Exp $ + * $DragonFly: src/sys/kern/imgact_elf.c,v 1.44 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -795,7 +795,7 @@ exec_elf_imgact(struct image_params *imgp) imgp->proc->p_sysent = brand_info->sysvec; if (interp != NULL) { path = kmalloc(MAXPATHLEN, M_TEMP, M_WAITOK); - snprintf(path, MAXPATHLEN, "%s%s", + ksnprintf(path, MAXPATHLEN, "%s%s", brand_info->emul_path, interp); if ((error = elf_load_file(imgp->proc, path, &addr, &imgp->entry_addr)) != 0) { diff --git a/sys/kern/kern_checkpoint.c b/sys/kern/kern_checkpoint.c index 09c7b87b7b..4a01537898 100644 --- a/sys/kern/kern_checkpoint.c +++ b/sys/kern/kern_checkpoint.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_checkpoint.c,v 1.12 2006/11/07 17:51:23 dillon Exp $ + * $DragonFly: src/sys/kern/kern_checkpoint.c,v 1.13 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -851,7 +851,7 @@ ckpt_expand_name(const char *name, uid_t uid, pid_t pid) n += namelen; break; case 'P': /* process id */ - l = sprintf(buf, "%u", pid); + l = ksprintf(buf, "%u", pid); if ((n + l) > MAXPATHLEN) { log(LOG_ERR, "pid %d (%s), uid (%u): Path `%s%s' is too long\n", pid, name, uid, temp, name); @@ -862,7 +862,7 @@ ckpt_expand_name(const char *name, uid_t uid, pid_t pid) n += l; break; case 'U': /* user id */ - l = sprintf(buf, "%u", uid); + l = ksprintf(buf, "%u", uid); if ((n + l) > MAXPATHLEN) { log(LOG_ERR, "pid %d (%s), uid (%u): Path `%s%s' is too long\n", pid, name, uid, temp, name); diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 8de4e14474..071296526d 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_conf.c,v 1.73.2.3 2003/03/10 02:18:25 imp Exp $ - * $DragonFly: src/sys/kern/kern_conf.c,v 1.18 2006/12/18 20:41:01 dillon Exp $ + * $DragonFly: src/sys/kern/kern_conf.c,v 1.19 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -493,16 +493,16 @@ devtoname(cdev_t dev) p = dev->si_name; len = sizeof(dev->si_name); if ((dname = dev_dname(dev)) != NULL) - snprintf(p, len, "#%s/", dname); + ksnprintf(p, len, "#%s/", dname); else - snprintf(p, len, "#%d/", major(dev)); + ksnprintf(p, len, "#%d/", major(dev)); len -= strlen(p); p += strlen(p); mynor = minor(dev); if (mynor < 0 || mynor > 255) - snprintf(p, len, "%#x", (u_int)mynor); + ksnprintf(p, len, "%#x", (u_int)mynor); else - snprintf(p, len, "%d", mynor); + ksnprintf(p, len, "%d", mynor); } return (dev->si_name); } diff --git a/sys/kern/kern_firmware.c b/sys/kern/kern_firmware.c index 85d55652be..afde5ce18d 100644 --- a/sys/kern/kern_firmware.c +++ b/sys/kern/kern_firmware.c @@ -30,7 +30,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_firmware.c,v 1.5 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_firmware.c,v 1.6 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -153,7 +153,7 @@ firmware_image_load_file(const char *image_name) int error; fw_path = kmalloc(MAXPATHLEN, M_TEMP, M_WAITOK); - snprintf(fw_path, MAXPATHLEN, "%s/%s", firmware_root, image_name); + ksnprintf(fw_path, MAXPATHLEN, "%s/%s", firmware_root, image_name); /* XXX: access? */ diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index bf4f986451..35e81bd418 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_intr.c,v 1.24.2.1 2001/10/14 20:05:50 luigi Exp $ - * $DragonFly: src/sys/kern/kern_intr.c,v 1.43 2006/11/07 18:50:06 dillon Exp $ + * $DragonFly: src/sys/kern/kern_intr.c,v 1.44 2006/12/20 18:14:41 dillon Exp $ * */ @@ -951,12 +951,12 @@ sysctl_intrnames(SYSCTL_HANDLER_ARGS) len = 0; buf[0] = 0; for (rec = info->i_reclist; rec; rec = rec->next) { - snprintf(buf + len, sizeof(buf) - len, "%s%s", + ksnprintf(buf + len, sizeof(buf) - len, "%s%s", (len ? "/" : ""), rec->name); len += strlen(buf + len); } if (len == 0) { - snprintf(buf, sizeof(buf), "irq%d", intr); + ksnprintf(buf, sizeof(buf), "irq%d", intr); len = strlen(buf); } error = SYSCTL_OUT(req, buf, len + 1); diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index a7ec7060a2..f37de2ec06 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_linker.c,v 1.41.2.3 2001/11/21 17:50:35 luigi Exp $ - * $DragonFly: src/sys/kern/kern_linker.c,v 1.30 2006/09/05 03:48:12 dillon Exp $ + * $DragonFly: src/sys/kern/kern_linker.c,v 1.31 2006/12/20 18:14:41 dillon Exp $ */ #include "opt_ddb.h" @@ -261,7 +261,7 @@ linker_load_file(const char* filename, linker_file_t* result) error = ENOMEM; goto out; } - sprintf(koname, "%s.ko", filename); + ksprintf(koname, "%s.ko", filename); lf = NULL; foundfile = 0; for (lc = TAILQ_FIRST(&classes); lc; lc = TAILQ_NEXT(lc, link)) { @@ -324,7 +324,7 @@ linker_find_file_by_name(const char* filename) koname = kmalloc(strlen(filename) + 4, M_LINKER, M_WAITOK); if (koname == NULL) goto out; - sprintf(koname, "%s.ko", filename); + ksprintf(koname, "%s.ko", filename); lockmgr(&lock, LK_SHARED); for (lf = TAILQ_FIRST(&linker_files); lf; lf = TAILQ_NEXT(lf, link)) { diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 75f31a4aa5..71de599879 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -37,7 +37,7 @@ * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 * $FreeBSD: src/sys/kern/kern_sig.c,v 1.72.2.17 2003/05/16 16:34:34 obrien Exp $ - * $DragonFly: src/sys/kern/kern_sig.c,v 1.56 2006/11/07 18:50:06 dillon Exp $ + * $DragonFly: src/sys/kern/kern_sig.c,v 1.57 2006/12/20 18:14:41 dillon Exp $ */ #include "opt_ktrace.h" @@ -1610,7 +1610,7 @@ expand_name(const char *name, uid_t uid, pid_t pid) n += namelen; break; case 'P': /* process id */ - l = sprintf(buf, "%u", pid); + l = ksprintf(buf, "%u", pid); if ((n + l) > MAXPATHLEN) { log(LOG_ERR, "pid %d (%s), uid (%u): Path `%s%s' is too long\n", pid, name, uid, temp, name); @@ -1621,7 +1621,7 @@ expand_name(const char *name, uid_t uid, pid_t pid) n += l; break; case 'U': /* user id */ - l = sprintf(buf, "%u", uid); + l = ksprintf(buf, "%u", uid); if ((n + l) > MAXPATHLEN) { log(LOG_ERR, "pid %d (%s), uid (%u): Path `%s%s' is too long\n", pid, name, uid, temp, name); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 8f4470a4cb..57fb3b5e80 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -38,7 +38,7 @@ * * @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94 * $FreeBSD: src/sys/kern/kern_sysctl.c,v 1.92.2.9 2003/05/01 22:48:09 trhodes Exp $ - * $DragonFly: src/sys/kern/kern_sysctl.c,v 1.23 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/kern/kern_sysctl.c,v 1.24 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -558,7 +558,7 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) sysctl_lock(LK_SHARED); while (namelen) { if (!lsp) { - snprintf(buf,sizeof(buf),"%d",*name); + ksnprintf(buf,sizeof(buf),"%d",*name); if (req->oldidx) error = SYSCTL_OUT(req, ".", 1); if (!error) diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index b98a9a1588..d1f32f0c66 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/link_elf.c,v 1.24 1999/12/24 15:33:36 bde Exp $ - * $DragonFly: src/sys/kern/link_elf.c,v 1.22 2006/09/11 20:25:01 dillon Exp $ + * $DragonFly: src/sys/kern/link_elf.c,v 1.23 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -1016,7 +1016,7 @@ link_elf_lookup_set(linker_file_t lf, const char *name, return ENOMEM; /* get address of first entry */ - snprintf(setsym, len, "%s%s", "__start_set_", name); + ksnprintf(setsym, len, "%s%s", "__start_set_", name); error = link_elf_lookup_symbol(lf, setsym, &sym); if (error) goto out; @@ -1028,7 +1028,7 @@ link_elf_lookup_set(linker_file_t lf, const char *name, start = (void **)symval.value; /* get address of last entry */ - snprintf(setsym, len, "%s%s", "__stop_set_", name); + ksnprintf(setsym, len, "%s%s", "__stop_set_", name); error = link_elf_lookup_symbol(lf, setsym, &sym); if (error) goto out; diff --git a/sys/kern/lwkt_caps.c b/sys/kern/lwkt_caps.c index 849d6d49bf..325f8d11fd 100644 --- a/sys/kern/lwkt_caps.c +++ b/sys/kern/lwkt_caps.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/lwkt_caps.c,v 1.9 2006/09/05 03:48:12 dillon Exp $ + * $DragonFly: src/sys/kern/lwkt_caps.c,v 1.10 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -1020,7 +1020,7 @@ again: if ((rcaps = caps_find(name, len, uid, gid)) == NULL) { if (flags & CAPF_WAITSVC) { char cbuf[32]; - snprintf(cbuf, sizeof(cbuf), "C%s", name); + ksnprintf(cbuf, sizeof(cbuf), "C%s", name); *error = tsleep(&caps_waitsvc, PCATCH, cbuf, 0); if (*error == 0) goto again; diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 8f7bbd99fd..83bc8ce618 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/subr_bus.c,v 1.54.2.9 2002/10/10 15:13:32 jhb Exp $ - * $DragonFly: src/sys/kern/subr_bus.c,v 1.33 2006/12/18 20:41:01 dillon Exp $ + * $DragonFly: src/sys/kern/subr_bus.c,v 1.34 2006/12/20 18:14:41 dillon Exp $ */ #include "opt_bus.h" @@ -436,7 +436,7 @@ devclass_add_device(devclass_t dc, device_t dev) } dc->devices[dev->unit] = dev; dev->devclass = dc; - snprintf(dev->nameunit, buflen, "%s%d", dc->name, dev->unit); + ksnprintf(dev->nameunit, buflen, "%s%d", dc->name, dev->unit); #ifdef DEVICE_SYSCTLS device_register_oids(dev); diff --git a/sys/kern/subr_diskmbr.c b/sys/kern/subr_diskmbr.c index 2618473bcb..36b205609b 100644 --- a/sys/kern/subr_diskmbr.c +++ b/sys/kern/subr_diskmbr.c @@ -36,7 +36,7 @@ * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ * $FreeBSD: src/sys/kern/subr_diskmbr.c,v 1.45 2000/01/28 10:22:07 bde Exp $ - * $DragonFly: src/sys/kern/subr_diskmbr.c,v 1.16 2006/12/03 04:52:25 dillon Exp $ + * $DragonFly: src/sys/kern/subr_diskmbr.c,v 1.17 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -456,7 +456,7 @@ mbr_extended(cdev_t dev, struct disklabel *lp, struct diskslices *ssp, sname = dsname(dev, dkunit(dev), WHOLE_DISK_SLICE, RAW_PART, partname); - snprintf(buf, sizeof(buf), "%s", sname); + ksnprintf(buf, sizeof(buf), "%s", sname); if (strlen(buf) < sizeof buf - 11) strcat(buf, ""); check_part(buf, dp, base_ext_offset, nsectors, diff --git a/sys/kern/subr_diskslice.c b/sys/kern/subr_diskslice.c index faa2cb9a30..1fac89f6a9 100644 --- a/sys/kern/subr_diskslice.c +++ b/sys/kern/subr_diskslice.c @@ -44,7 +44,7 @@ * from: @(#)ufs_disksubr.c 7.16 (Berkeley) 5/4/91 * from: ufs_disksubr.c,v 1.8 1994/06/07 01:21:39 phk Exp $ * $FreeBSD: src/sys/kern/subr_diskslice.c,v 1.82.2.6 2001/07/24 09:49:41 dd Exp $ - * $DragonFly: src/sys/kern/subr_diskslice.c,v 1.24 2006/09/10 01:26:39 dillon Exp $ + * $DragonFly: src/sys/kern/subr_diskslice.c,v 1.25 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -626,13 +626,13 @@ dsname(cdev_t dev, int unit, int slice, int part, char *partname) dname = dev_dname(dev); if (strlen(dname) > 16) dname = "nametoolong"; - snprintf(name, sizeof(name), "%s%d", dname, unit); + ksnprintf(name, sizeof(name), "%s%d", dname, unit); partname[0] = '\0'; if (slice != WHOLE_DISK_SLICE || part != RAW_PART) { partname[0] = 'a' + part; partname[1] = '\0'; if (slice != COMPATIBILITY_SLICE) { - snprintf(name + strlen(name), + ksnprintf(name + strlen(name), sizeof(name) - strlen(name), "s%d", slice - 1); } } diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 3daaf06a71..748922dafd 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -37,7 +37,7 @@ * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/subr_prf.c,v 1.61.2.5 2002/08/31 18:22:08 dwmalone Exp $ - * $DragonFly: src/sys/kern/subr_prf.c,v 1.13 2006/12/18 21:02:58 dillon Exp $ + * $DragonFly: src/sys/kern/subr_prf.c,v 1.14 2006/12/20 18:14:41 dillon Exp $ */ #include @@ -417,22 +417,6 @@ ksprintf(char *buf, const char *cfmt, ...) return retval; } -/* - * Scaled down version of sprintf(3). (TO BE REMOVED) - */ -int -sprintf(char *buf, const char *cfmt, ...) -{ - int retval; - __va_list ap; - - __va_start(ap, cfmt); - retval = kvcprintf(cfmt, NULL, (void *)buf, 10, ap); - buf[retval] = '\0'; - __va_end(ap); - return retval; -} - /* * Scaled down version of vsprintf(3). */ @@ -461,21 +445,6 @@ ksnprintf(char *str, size_t size, const char *format, ...) return(retval); } -/* - * Scaled down version of snprintf(3). (TO BE REMOVED) - */ -int -snprintf(char *str, size_t size, const char *format, ...) -{ - int retval; - __va_list ap; - - __va_start(ap, format); - retval = kvsnprintf(str, size, format, ap); - __va_end(ap); - return(retval); -} - /* * Scaled down version of vsnprintf(3). */ diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 3f05a21afb..a2098cfc2d 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -37,7 +37,7 @@ * * @(#)tty.c 8.8 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/tty.c,v 1.129.2.5 2002/03/11 01:32:31 dd Exp $ - * $DragonFly: src/sys/kern/tty.c,v 1.31 2006/09/19 11:47:35 corecode Exp $ + * $DragonFly: src/sys/kern/tty.c,v 1.32 2006/12/20 18:14:41 dillon Exp $ */ /*- @@ -2411,7 +2411,7 @@ ttyinfo(tp) else str = "iowait"; - snprintf(buf, sizeof(buf), "cmd: %s %d [%s]", + ksnprintf(buf, sizeof(buf), "cmd: %s %d [%s]", pick->p_comm, pick->p_pid, str); /* diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index bff667257c..1299123e68 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/vfs_conf.c,v 1.49.2.5 2003/01/07 11:56:53 joerg Exp $ - * $DragonFly: src/sys/kern/vfs_conf.c,v 1.22 2006/12/13 21:58:50 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_conf.c,v 1.23 2006/12/20 18:14:41 dillon Exp $ */ /* @@ -209,7 +209,7 @@ vfs_mountroot_try(const char *mountfrom) vfsname = kmalloc(MFSNAMELEN, M_MOUNT, M_WAITOK); devname = kmalloc(MNAMELEN, M_MOUNT, M_WAITOK); vfsname[0] = devname[0] = 0; - sprintf(patt, "%%%d[a-z0-9]:%%%ds", MFSNAMELEN, MNAMELEN); + ksprintf(patt, "%%%d[a-z0-9]:%%%ds", MFSNAMELEN, MNAMELEN); if (ksscanf(mountfrom, patt, vfsname, devname) < 1) goto done; diff --git a/sys/libkern/inet_ntoa.c b/sys/libkern/inet_ntoa.c index bc34f8013a..8fa18fb765 100644 --- a/sys/libkern/inet_ntoa.c +++ b/sys/libkern/inet_ntoa.c @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/libkern/inet_ntoa.c,v 1.2.16.1 2000/08/03 01:03:45 peter Exp $ - * $DragonFly: src/sys/libkern/inet_ntoa.c,v 1.4 2004/12/29 03:26:42 hsu Exp $ + * $DragonFly: src/sys/libkern/inet_ntoa.c,v 1.5 2006/12/20 18:14:42 dillon Exp $ */ #include @@ -42,11 +42,11 @@ inet_ntoa(struct in_addr ina) static char buf[sizeof "aaa.bbb.ccc.ddd"]; unsigned char *ucp = (unsigned char *)&ina; - sprintf(buf, "%d.%d.%d.%d", - ucp[0] & 0xff, - ucp[1] & 0xff, - ucp[2] & 0xff, - ucp[3] & 0xff); + ksprintf(buf, "%d.%d.%d.%d", + ucp[0] & 0xff, + ucp[1] & 0xff, + ucp[2] & 0xff, + ucp[3] & 0xff); return buf; } diff --git a/sys/net/ef/if_ef.c b/sys/net/ef/if_ef.c index bf3210a657..3c316bd81d 100644 --- a/sys/net/ef/if_ef.c +++ b/sys/net/ef/if_ef.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/net/if_ef.c,v 1.2.2.4 2001/02/22 09:27:04 bp Exp $ - * $DragonFly: src/sys/net/ef/if_ef.c,v 1.20 2006/09/05 03:48:12 dillon Exp $ + * $DragonFly: src/sys/net/ef/if_ef.c,v 1.21 2006/12/20 18:14:42 dillon Exp $ */ #include "opt_inet.h" @@ -485,7 +485,7 @@ ef_clone(struct ef_link *efl, int ft) efp->ef_ifp = ifp; efp->ef_frametype = ft; eifp = &efp->ef_ac.ac_if; - snprintf(eifp->if_xname, IFNAMSIZ, + ksnprintf(eifp->if_xname, IFNAMSIZ, "%sf%d", ifp->if_xname, efp->ef_frametype); eifp->if_dname = "ef"; eifp->if_dunit = IF_DUNIT_NONE; diff --git a/sys/net/i4b/driver/i4b_ing.c b/sys/net/i4b/driver/i4b_ing.c index 5bfa781653..4ed11c085b 100644 --- a/sys/net/i4b/driver/i4b_ing.c +++ b/sys/net/i4b/driver/i4b_ing.c @@ -28,7 +28,7 @@ * ------------------------------------------------- * * $FreeBSD: src/sys/i4b/driver/i4b_ing.c,v 1.10.2.4 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/net/i4b/driver/i4b_ing.c,v 1.8 2005/06/15 11:56:03 joerg Exp $ + * $DragonFly: src/sys/net/i4b/driver/i4b_ing.c,v 1.9 2006/12/20 18:14:42 dillon Exp $ * * last edit-date: [Tue Jan 1 10:43:58 2002] * @@ -283,7 +283,7 @@ i4bingattach(void *dummy) /* name the netgraph node */ - sprintf(sc->nodename, "%s%d", NG_ING_NODE_TYPE, sc->sc_unit); + ksprintf(sc->nodename, "%s%d", NG_ING_NODE_TYPE, sc->sc_unit); if(ng_name_node(sc->node, sc->nodename)) { @@ -676,11 +676,11 @@ ng_ing_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, break; } - pos = sprintf(arg, "state = %s (%d)\n", p, sc->sc_state); + pos = ksprintf(arg, "state = %s (%d)\n", p, sc->sc_state); #if I4BINGACCT - pos += sprintf(arg + pos, "%d bytes in, %d bytes out\n", sc->sc_inb, sc->sc_outb); + pos += ksprintf(arg + pos, "%d bytes in, %d bytes out\n", sc->sc_inb, sc->sc_outb); #endif - pos += sprintf(arg + pos, "%d pkts in, %d pkts out\n", sc->sc_inpkt, sc->sc_outpkt); + pos += ksprintf(arg + pos, "%d pkts in, %d pkts out\n", sc->sc_inpkt, sc->sc_outpkt); resp->header.arglen = pos + 1; break; diff --git a/sys/net/i4b/layer3/i4b_q931.c b/sys/net/i4b/layer3/i4b_q931.c index 99eb0fd7ed..53c4756df5 100644 --- a/sys/net/i4b/layer3/i4b_q931.c +++ b/sys/net/i4b/layer3/i4b_q931.c @@ -30,7 +30,7 @@ * $Id: i4b_q931.c,v 1.32 2000/08/24 11:48:58 hm Exp $ * * $FreeBSD: src/sys/i4b/layer3/i4b_q931.c,v 1.6.2.1 2001/08/10 14:08:42 obrien Exp $ - * $DragonFly: src/sys/net/i4b/layer3/i4b_q931.c,v 1.7 2005/06/14 21:19:19 joerg Exp $ + * $DragonFly: src/sys/net/i4b/layer3/i4b_q931.c,v 1.8 2006/12/20 18:14:42 dillon Exp $ * * last edit-date: [Mon May 29 16:56:52 2000] * @@ -390,7 +390,7 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr) *p = '\0'; for(j = msg_ptr[1]; j > 0; j--, i++) - sprintf(p+strlen(p), "%02d", msg_ptr[i]); + ksprintf(p+strlen(p), "%02d", msg_ptr[i]); NDBGL3(L3_P_MSG, "IEI_DATETIME = %s", cd->datetime); break; diff --git a/sys/net/if.c b/sys/net/if.c index cd87d1b5d0..bd17da837d 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -32,7 +32,7 @@ * * @(#)if.c 8.3 (Berkeley) 1/4/94 * $FreeBSD: src/sys/net/if.c,v 1.185 2004/03/13 02:35:03 brooks Exp $ - * $DragonFly: src/sys/net/if.c,v 1.47 2006/12/18 20:41:02 dillon Exp $ + * $DragonFly: src/sys/net/if.c,v 1.48 2006/12/20 18:14:42 dillon Exp $ */ #include "opt_compat.h" @@ -518,7 +518,7 @@ if_clone_create(char *name, int len) /* In the wildcard case, we need to update the name. */ if (wildcard) { for (dp = name; *dp != '\0'; dp++); - if (snprintf(dp, len - (dp-name), "%d", unit) > + if (ksnprintf(dp, len - (dp-name), "%d", unit) > len - (dp-name) - 1) { /* * This can only be a programmer error and @@ -1855,7 +1855,7 @@ if_initname(struct ifnet *ifp, const char *name, int unit) ifp->if_dname = name; ifp->if_dunit = unit; if (unit != IF_DUNIT_NONE) - snprintf(ifp->if_xname, IFNAMSIZ, "%s%d", name, unit); + ksnprintf(ifp->if_xname, IFNAMSIZ, "%s%d", name, unit); else strlcpy(ifp->if_xname, name, IFNAMSIZ); } diff --git a/sys/net/ip6fw/ip6_fw.c b/sys/net/ip6fw/ip6_fw.c index 0f318a81e7..45646ea232 100644 --- a/sys/net/ip6fw/ip6_fw.c +++ b/sys/net/ip6fw/ip6_fw.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ip6_fw.c,v 1.2.2.10 2003/08/03 17:52:54 ume Exp $ */ -/* $DragonFly: src/sys/net/ip6fw/ip6_fw.c,v 1.16 2006/12/13 21:58:52 dillon Exp $ */ +/* $DragonFly: src/sys/net/ip6fw/ip6_fw.c,v 1.17 2006/12/20 18:14:42 dillon Exp $ */ /* $KAME: ip6_fw.c,v 1.21 2001/01/24 01:25:32 itojun Exp $ */ /* @@ -372,7 +372,7 @@ ip6fw_report(struct ip6_fw *f, struct ip6_hdr *ip6, return; /* Print command name */ - snprintf(SNPARGS(name, 0), "ip6fw: %d", f ? f->fw_number : -1); + ksnprintf(SNPARGS(name, 0), "ip6fw: %d", f ? f->fw_number : -1); action = action2; if (!f) @@ -395,15 +395,15 @@ ip6fw_report(struct ip6_fw *f, struct ip6_hdr *ip6, action = "Count"; break; case IPV6_FW_F_DIVERT: - snprintf(SNPARGS(action2, 0), "Divert %d", + ksnprintf(SNPARGS(action2, 0), "Divert %d", f->fw_divert_port); break; case IPV6_FW_F_TEE: - snprintf(SNPARGS(action2, 0), "Tee %d", + ksnprintf(SNPARGS(action2, 0), "Tee %d", f->fw_divert_port); break; case IPV6_FW_F_SKIPTO: - snprintf(SNPARGS(action2, 0), "SkipTo %d", + ksnprintf(SNPARGS(action2, 0), "SkipTo %d", f->fw_skipto_rule); break; default: @@ -414,48 +414,48 @@ ip6fw_report(struct ip6_fw *f, struct ip6_hdr *ip6, switch (nxt) { case IPPROTO_TCP: - len = snprintf(SNPARGS(proto, 0), "TCP [%s]", + len = ksnprintf(SNPARGS(proto, 0), "TCP [%s]", ip6_sprintf(&ip6->ip6_src)); if (off > 0) - len += snprintf(SNPARGS(proto, len), ":%d ", + len += ksnprintf(SNPARGS(proto, len), ":%d ", ntohs(tcp6->th_sport)); else - len += snprintf(SNPARGS(proto, len), " "); - len += snprintf(SNPARGS(proto, len), "[%s]", + len += ksnprintf(SNPARGS(proto, len), " "); + len += ksnprintf(SNPARGS(proto, len), "[%s]", ip6_sprintf(&ip6->ip6_dst)); if (off > 0) - snprintf(SNPARGS(proto, len), ":%d", + ksnprintf(SNPARGS(proto, len), ":%d", ntohs(tcp6->th_dport)); break; case IPPROTO_UDP: - len = snprintf(SNPARGS(proto, 0), "UDP [%s]", + len = ksnprintf(SNPARGS(proto, 0), "UDP [%s]", ip6_sprintf(&ip6->ip6_src)); if (off > 0) - len += snprintf(SNPARGS(proto, len), ":%d ", + len += ksnprintf(SNPARGS(proto, len), ":%d ", ntohs(udp->uh_sport)); else - len += snprintf(SNPARGS(proto, len), " "); - len += snprintf(SNPARGS(proto, len), "[%s]", + len += ksnprintf(SNPARGS(proto, len), " "); + len += ksnprintf(SNPARGS(proto, len), "[%s]", ip6_sprintf(&ip6->ip6_dst)); if (off > 0) - snprintf(SNPARGS(proto, len), ":%d", + ksnprintf(SNPARGS(proto, len), ":%d", ntohs(udp->uh_dport)); break; case IPPROTO_ICMPV6: if (off > 0) - len = snprintf(SNPARGS(proto, 0), "IPV6-ICMP:%u.%u ", + len = ksnprintf(SNPARGS(proto, 0), "IPV6-ICMP:%u.%u ", icmp6->icmp6_type, icmp6->icmp6_code); else - len = snprintf(SNPARGS(proto, 0), "IPV6-ICMP "); - len += snprintf(SNPARGS(proto, len), "[%s]", + len = ksnprintf(SNPARGS(proto, 0), "IPV6-ICMP "); + len += ksnprintf(SNPARGS(proto, len), "[%s]", ip6_sprintf(&ip6->ip6_src)); - snprintf(SNPARGS(proto, len), " [%s]", + ksnprintf(SNPARGS(proto, len), " [%s]", ip6_sprintf(&ip6->ip6_dst)); break; default: - len = snprintf(SNPARGS(proto, 0), "P:%d [%s]", nxt, + len = ksnprintf(SNPARGS(proto, 0), "P:%d [%s]", nxt, ip6_sprintf(&ip6->ip6_src)); - snprintf(SNPARGS(proto, len), " [%s]", + ksnprintf(SNPARGS(proto, len), " [%s]", ip6_sprintf(&ip6->ip6_dst)); break; } diff --git a/sys/net/ipfw/ip_fw.c b/sys/net/ipfw/ip_fw.c index 518aef587c..f516095e48 100644 --- a/sys/net/ipfw/ip_fw.c +++ b/sys/net/ipfw/ip_fw.c @@ -14,7 +14,7 @@ * This software is provided ``AS IS'' without any warranties of any kind. * * $FreeBSD: src/sys/netinet/ip_fw.c,v 1.131.2.39 2003/01/20 02:23:07 iedowse Exp $ - * $DragonFly: src/sys/net/ipfw/Attic/ip_fw.c,v 1.20 2006/12/13 21:58:52 dillon Exp $ + * $DragonFly: src/sys/net/ipfw/Attic/ip_fw.c,v 1.21 2006/12/20 18:14:42 dillon Exp $ */ #define DEB(x) @@ -498,7 +498,7 @@ ipfw_report(struct ip_fw *f, struct ip *ip, int ip_off, int ip_len, return; /* Print command name */ - snprintf(SNPARGS(name, 0), "ipfw: %d", f ? f->fw_number : -1); + ksnprintf(SNPARGS(name, 0), "ipfw: %d", f ? f->fw_number : -1); action = action2; if (!f) @@ -522,35 +522,35 @@ ipfw_report(struct ip_fw *f, struct ip *ip, int ip_off, int ip_len, break; #ifdef IPDIVERT case IP_FW_F_DIVERT: - snprintf(SNPARGS(action2, 0), "Divert %d", + ksnprintf(SNPARGS(action2, 0), "Divert %d", f->fw_divert_port); break; case IP_FW_F_TEE: - snprintf(SNPARGS(action2, 0), "Tee %d", + ksnprintf(SNPARGS(action2, 0), "Tee %d", f->fw_divert_port); break; #endif case IP_FW_F_SKIPTO: - snprintf(SNPARGS(action2, 0), "SkipTo %d", + ksnprintf(SNPARGS(action2, 0), "SkipTo %d", f->fw_skipto_rule); break; case IP_FW_F_PIPE: - snprintf(SNPARGS(action2, 0), "Pipe %d", + ksnprintf(SNPARGS(action2, 0), "Pipe %d", f->fw_skipto_rule); break; case IP_FW_F_QUEUE: - snprintf(SNPARGS(action2, 0), "Queue %d", + ksnprintf(SNPARGS(action2, 0), "Queue %d", f->fw_skipto_rule); break; case IP_FW_F_FWD: if (f->fw_fwd_ip.sin_port) - snprintf(SNPARGS(action2, 0), + ksnprintf(SNPARGS(action2, 0), "Forward to %s:%d", inet_ntoa(f->fw_fwd_ip.sin_addr), f->fw_fwd_ip.sin_port); else - snprintf(SNPARGS(action2, 0), "Forward to %s", + ksnprintf(SNPARGS(action2, 0), "Forward to %s", inet_ntoa(f->fw_fwd_ip.sin_addr)); break; @@ -562,52 +562,52 @@ ipfw_report(struct ip_fw *f, struct ip *ip, int ip_off, int ip_len, switch (ip->ip_p) { case IPPROTO_TCP: - len = snprintf(SNPARGS(proto, 0), "TCP %s", + len = ksnprintf(SNPARGS(proto, 0), "TCP %s", inet_ntoa(ip->ip_src)); if (offset == 0) - len += snprintf(SNPARGS(proto, len), ":%d ", + len += ksnprintf(SNPARGS(proto, len), ":%d ", ntohs(tcp->th_sport)); else - len += snprintf(SNPARGS(proto, len), " "); - len += snprintf(SNPARGS(proto, len), "%s", + len += ksnprintf(SNPARGS(proto, len), " "); + len += ksnprintf(SNPARGS(proto, len), "%s", inet_ntoa(ip->ip_dst)); if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d", + ksnprintf(SNPARGS(proto, len), ":%d", ntohs(tcp->th_dport)); break; case IPPROTO_UDP: - len = snprintf(SNPARGS(proto, 0), "UDP %s", + len = ksnprintf(SNPARGS(proto, 0), "UDP %s", inet_ntoa(ip->ip_src)); if (offset == 0) - len += snprintf(SNPARGS(proto, len), ":%d ", + len += ksnprintf(SNPARGS(proto, len), ":%d ", ntohs(udp->uh_sport)); else - len += snprintf(SNPARGS(proto, len), " "); - len += snprintf(SNPARGS(proto, len), "%s", + len += ksnprintf(SNPARGS(proto, len), " "); + len += ksnprintf(SNPARGS(proto, len), "%s", inet_ntoa(ip->ip_dst)); if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d", + ksnprintf(SNPARGS(proto, len), ":%d", ntohs(udp->uh_dport)); break; case IPPROTO_ICMP: if (offset == 0) - len = snprintf(SNPARGS(proto, 0), "ICMP:%u.%u ", + len = ksnprintf(SNPARGS(proto, 0), "ICMP:%u.%u ", icmp->icmp_type, icmp->icmp_code); else - len = snprintf(SNPARGS(proto, 0), "ICMP "); - len += snprintf(SNPARGS(proto, len), "%s", + len = ksnprintf(SNPARGS(proto, 0), "ICMP "); + len += ksnprintf(SNPARGS(proto, len), "%s", inet_ntoa(ip->ip_src)); - snprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); + ksnprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); break; default: - len = snprintf(SNPARGS(proto, 0), "P:%d %s", ip->ip_p, + len = ksnprintf(SNPARGS(proto, 0), "P:%d %s", ip->ip_p, inet_ntoa(ip->ip_src)); - snprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); + ksnprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); break; } if (ip_off & (IP_MF | IP_OFFMASK)) - snprintf(SNPARGS(fragment, 0), " (frag %d:%d@%d%s)", + ksnprintf(SNPARGS(fragment, 0), " (frag %d:%d@%d%s)", ntohs(ip->ip_id), ip_len - (ip->ip_hl << 2), offset << 3, (ip_off & IP_MF) ? "+" : ""); diff --git a/sys/net/ipfw/ip_fw2.c b/sys/net/ipfw/ip_fw2.c index 0ebea1a3a1..ea8ba210df 100644 --- a/sys/net/ipfw/ip_fw2.c +++ b/sys/net/ipfw/ip_fw2.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet/ip_fw2.c,v 1.6.2.12 2003/04/08 10:42:32 maxim Exp $ - * $DragonFly: src/sys/net/ipfw/ip_fw2.c,v 1.24 2006/12/13 21:58:52 dillon Exp $ + * $DragonFly: src/sys/net/ipfw/ip_fw2.c,v 1.25 2006/12/20 18:14:42 dillon Exp $ */ #define DEB(x) @@ -445,7 +445,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, struct ether_header *eh, else if (cmd->arg1==ICMP_UNREACH_HOST) action = "Reject"; else - snprintf(SNPARGS(action2, 0), "Unreach %d", + ksnprintf(SNPARGS(action2, 0), "Unreach %d", cmd->arg1); break; @@ -456,33 +456,33 @@ ipfw_log(struct ip_fw *f, u_int hlen, struct ether_header *eh, action = "Count"; break; case O_DIVERT: - snprintf(SNPARGS(action2, 0), "Divert %d", + ksnprintf(SNPARGS(action2, 0), "Divert %d", cmd->arg1); break; case O_TEE: - snprintf(SNPARGS(action2, 0), "Tee %d", + ksnprintf(SNPARGS(action2, 0), "Tee %d", cmd->arg1); break; case O_SKIPTO: - snprintf(SNPARGS(action2, 0), "SkipTo %d", + ksnprintf(SNPARGS(action2, 0), "SkipTo %d", cmd->arg1); break; case O_PIPE: - snprintf(SNPARGS(action2, 0), "Pipe %d", + ksnprintf(SNPARGS(action2, 0), "Pipe %d", cmd->arg1); break; case O_QUEUE: - snprintf(SNPARGS(action2, 0), "Queue %d", + ksnprintf(SNPARGS(action2, 0), "Queue %d", cmd->arg1); break; case O_FORWARD_IP: { ipfw_insn_sa *sa = (ipfw_insn_sa *)cmd; int len; - len = snprintf(SNPARGS(action2, 0), "Forward to %s", + len = ksnprintf(SNPARGS(action2, 0), "Forward to %s", inet_ntoa(sa->sa.sin_addr)); if (sa->sa.sin_port) - snprintf(SNPARGS(action2, len), ":%d", + ksnprintf(SNPARGS(action2, len), ":%d", sa->sa.sin_port); } break; @@ -493,7 +493,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, struct ether_header *eh, } if (hlen == 0) { /* non-ip */ - snprintf(SNPARGS(proto, 0), "MAC"); + ksnprintf(SNPARGS(proto, 0), "MAC"); } else { struct ip *ip = mtod(m, struct ip *); /* these three are all aliases to the same thing */ @@ -515,54 +515,54 @@ ipfw_log(struct ip_fw *f, u_int hlen, struct ether_header *eh, offset = ip_off & IP_OFFMASK; switch (ip->ip_p) { case IPPROTO_TCP: - len = snprintf(SNPARGS(proto, 0), "TCP %s", + len = ksnprintf(SNPARGS(proto, 0), "TCP %s", inet_ntoa(ip->ip_src)); if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d %s:%d", + ksnprintf(SNPARGS(proto, len), ":%d %s:%d", ntohs(tcp->th_sport), inet_ntoa(ip->ip_dst), ntohs(tcp->th_dport)); else - snprintf(SNPARGS(proto, len), " %s", + ksnprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); break; case IPPROTO_UDP: - len = snprintf(SNPARGS(proto, 0), "UDP %s", + len = ksnprintf(SNPARGS(proto, 0), "UDP %s", inet_ntoa(ip->ip_src)); if (offset == 0) - snprintf(SNPARGS(proto, len), ":%d %s:%d", + ksnprintf(SNPARGS(proto, len), ":%d %s:%d", ntohs(udp->uh_sport), inet_ntoa(ip->ip_dst), ntohs(udp->uh_dport)); else - snprintf(SNPARGS(proto, len), " %s", + ksnprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); break; case IPPROTO_ICMP: if (offset == 0) - len = snprintf(SNPARGS(proto, 0), + len = ksnprintf(SNPARGS(proto, 0), "ICMP:%u.%u ", icmp->icmp_type, icmp->icmp_code); else - len = snprintf(SNPARGS(proto, 0), "ICMP "); - len += snprintf(SNPARGS(proto, len), "%s", + len = ksnprintf(SNPARGS(proto, 0), "ICMP "); + len += ksnprintf(SNPARGS(proto, len), "%s", inet_ntoa(ip->ip_src)); - snprintf(SNPARGS(proto, len), " %s", + ksnprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); break; default: - len = snprintf(SNPARGS(proto, 0), "P:%d %s", ip->ip_p, + len = ksnprintf(SNPARGS(proto, 0), "P:%d %s", ip->ip_p, inet_ntoa(ip->ip_src)); - snprintf(SNPARGS(proto, len), " %s", + ksnprintf(SNPARGS(proto, len), " %s", inet_ntoa(ip->ip_dst)); break; } if (ip_off & (IP_MF | IP_OFFMASK)) - snprintf(SNPARGS(fragment, 0), " (frag %d:%d@%d%s)", + ksnprintf(SNPARGS(fragment, 0), " (frag %d:%d@%d%s)", ntohs(ip->ip_id), ip_len - (ip->ip_hl << 2), offset << 3, (ip_off & IP_MF) ? "+" : ""); diff --git a/sys/net/pf/pf_if.c b/sys/net/pf/pf_if.c index 0c996a02c0..28d1d922f8 100644 --- a/sys/net/pf/pf_if.c +++ b/sys/net/pf/pf_if.c @@ -1,7 +1,7 @@ /* $FreeBSD: src/sys/contrib/pf/net/pf_if.c,v 1.6 2004/09/14 15:20:24 mlaier Exp $ */ /* $OpenBSD: pf_if.c,v 1.11 2004/03/15 11:38:23 cedric Exp $ */ /* add $OpenBSD: pf_if.c,v 1.19 2004/08/11 12:06:44 henning Exp $ */ -/* $DragonFly: src/sys/net/pf/pf_if.c,v 1.6 2006/09/05 03:48:12 dillon Exp $ */ +/* $DragonFly: src/sys/net/pf/pf_if.c,v 1.7 2006/12/20 18:14:42 dillon Exp $ */ /* * Copyright (c) 2004 The DragonFly Project. All rights reserved. @@ -446,7 +446,7 @@ pfi_dynaddr_setup(struct pf_addr_wrap *aw, sa_family_t af) if (aw->iflags & PFI_AFLAG_NOALIAS) strlcat(tblname, ":0", sizeof(tblname)); if (dyn->pfid_net != 128) - snprintf(tblname + strlen(tblname), + ksnprintf(tblname + strlen(tblname), sizeof(tblname) - strlen(tblname), "/%d", dyn->pfid_net); ruleset = pf_find_or_create_ruleset(pfi_reserved_anchor, pfi_interface_ruleset); diff --git a/sys/net/sppp/if_spppsubr.c b/sys/net/sppp/if_spppsubr.c index 1b498e2f58..d4e27236da 100644 --- a/sys/net/sppp/if_spppsubr.c +++ b/sys/net/sppp/if_spppsubr.c @@ -18,7 +18,7 @@ * From: Version 2.4, Thu Apr 30 17:17:21 MSD 1997 * * $FreeBSD: src/sys/net/if_spppsubr.c,v 1.59.2.13 2002/07/03 15:44:41 joerg Exp $ - * $DragonFly: src/sys/net/sppp/if_spppsubr.c,v 1.26 2006/09/05 00:55:48 dillon Exp $ + * $DragonFly: src/sys/net/sppp/if_spppsubr.c,v 1.27 2006/12/20 18:14:42 dillon Exp $ */ #include @@ -5322,7 +5322,7 @@ sppp_cp_type_name(u_char type) case ECHO_REPLY: return "echo-reply"; case DISC_REQ: return "discard-req"; } - snprintf (buf, sizeof(buf), "cp/0x%x", type); + ksnprintf (buf, sizeof(buf), "cp/0x%x", type); return buf; } @@ -5345,7 +5345,7 @@ sppp_auth_type_name(u_short proto, u_char type) case PAP_NAK: return "nak"; } } - snprintf (buf, sizeof(buf), "auth/0x%x", type); + ksnprintf (buf, sizeof(buf), "auth/0x%x", type); return buf; } @@ -5362,7 +5362,7 @@ sppp_lcp_opt_name(u_char opt) case LCP_OPT_PROTO_COMP: return "proto-comp"; case LCP_OPT_ADDR_COMP: return "addr-comp"; } - snprintf (buf, sizeof(buf), "lcp/0x%x", opt); + ksnprintf (buf, sizeof(buf), "lcp/0x%x", opt); return buf; } @@ -5375,7 +5375,7 @@ sppp_ipcp_opt_name(u_char opt) case IPCP_OPT_COMPRESSION: return "compression"; case IPCP_OPT_ADDRESS: return "address"; } - snprintf (buf, sizeof(buf), "ipcp/0x%x", opt); + ksnprintf (buf, sizeof(buf), "ipcp/0x%x", opt); return buf; } @@ -5388,7 +5388,7 @@ sppp_ipv6cp_opt_name(u_char opt) case IPV6CP_OPT_IFID: return "ifid"; case IPV6CP_OPT_COMPRESSION: return "compression"; } - sprintf (buf, "0x%x", opt); + ksprintf (buf, "0x%x", opt); return buf; } #endif @@ -5435,7 +5435,7 @@ sppp_proto_name(u_short proto) case PPP_CHAP: return "chap"; case PPP_IPV6CP: return "ipv6cp"; } - snprintf(buf, sizeof(buf), "proto/0x%x", (unsigned)proto); + ksnprintf(buf, sizeof(buf), "proto/0x%x", (unsigned)proto); return buf; } @@ -5467,7 +5467,7 @@ static const char * sppp_dotted_quad(u_long addr) { static char s[16]; - sprintf(s, "%d.%d.%d.%d", + ksprintf(s, "%d.%d.%d.%d", (int)((addr >> 24) & 0xff), (int)((addr >> 16) & 0xff), (int)((addr >> 8) & 0xff), diff --git a/sys/net/tap/if_tap.c b/sys/net/tap/if_tap.c index 99c3823d9d..c5784e5a49 100644 --- a/sys/net/tap/if_tap.c +++ b/sys/net/tap/if_tap.c @@ -32,7 +32,7 @@ /* * $FreeBSD: src/sys/net/if_tap.c,v 1.3.2.3 2002/04/14 21:41:48 luigi Exp $ - * $DragonFly: src/sys/net/tap/if_tap.c,v 1.30 2006/10/25 08:27:27 swildner Exp $ + * $DragonFly: src/sys/net/tap/if_tap.c,v 1.31 2006/12/20 18:14:42 dillon Exp $ * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $ */ @@ -406,12 +406,12 @@ tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) dummy = strlen(ifs->ascii); if (tp->tap_td != NULL && dummy < sizeof(ifs->ascii)) { if (tp->tap_td->td_proc) { - snprintf(ifs->ascii + dummy, + ksnprintf(ifs->ascii + dummy, sizeof(ifs->ascii) - dummy, "\tOpened by pid %d\n", (int)tp->tap_td->td_proc->p_pid); } else { - snprintf(ifs->ascii + dummy, + ksnprintf(ifs->ascii + dummy, sizeof(ifs->ascii) - dummy, "\tOpened by td %p\n", tp->tap_td); } diff --git a/sys/net/tun/if_tun.c b/sys/net/tun/if_tun.c index 7a966e94d4..a9e7803438 100644 --- a/sys/net/tun/if_tun.c +++ b/sys/net/tun/if_tun.c @@ -14,7 +14,7 @@ * operation though. * * $FreeBSD: src/sys/net/if_tun.c,v 1.74.2.8 2002/02/13 00:43:11 dillon Exp $ - * $DragonFly: src/sys/net/tun/if_tun.c,v 1.30 2006/09/10 01:26:40 dillon Exp $ + * $DragonFly: src/sys/net/tun/if_tun.c,v 1.31 2006/12/20 18:14:42 dillon Exp $ */ #include "opt_atalk.h" @@ -259,7 +259,7 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) case SIOCGIFSTATUS: ifs = (struct ifstat *)data; if (tp->tun_pid) - sprintf(ifs->ascii + strlen(ifs->ascii), + ksprintf(ifs->ascii + strlen(ifs->ascii), "\tOpened by PID %d\n", tp->tun_pid); break; case SIOCSIFADDR: diff --git a/sys/netgraph/bridge/ng_bridge.c b/sys/netgraph/bridge/ng_bridge.c index c141a694ab..1cf51976e4 100644 --- a/sys/netgraph/bridge/ng_bridge.c +++ b/sys/netgraph/bridge/ng_bridge.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_bridge.c,v 1.1.2.5 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/bridge/ng_bridge.c,v 1.8 2005/06/02 22:11:45 swildner Exp $ + * $DragonFly: src/sys/netgraph/bridge/ng_bridge.c,v 1.9 2006/12/20 18:14:42 dillon Exp $ */ /* @@ -591,7 +591,7 @@ ng_bridge_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) char suffix[32]; if (ifp != NULL) - snprintf(suffix, sizeof(suffix), + ksnprintf(suffix, sizeof(suffix), " (%s)", ifp->if_xname); else *suffix = '\0'; @@ -1015,9 +1015,9 @@ ng_bridge_nodename(node_p node) static char name[NG_NODELEN+1]; if (node->name != NULL) - snprintf(name, sizeof(name), "%s", node->name); + ksnprintf(name, sizeof(name), "%s", node->name); else - snprintf(name, sizeof(name), "[%x]", ng_node2ID(node)); + ksnprintf(name, sizeof(name), "[%x]", ng_node2ID(node)); return name; } diff --git a/sys/netgraph/cisco/ng_cisco.c b/sys/netgraph/cisco/ng_cisco.c index edc8b1c1ad..b9a82ab643 100644 --- a/sys/netgraph/cisco/ng_cisco.c +++ b/sys/netgraph/cisco/ng_cisco.c @@ -37,7 +37,7 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_cisco.c,v 1.4.2.6 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/cisco/ng_cisco.c,v 1.8 2005/06/02 22:11:45 swildner Exp $ + * $DragonFly: src/sys/netgraph/cisco/ng_cisco.c,v 1.9 2006/12/20 18:14:43 dillon Exp $ * $Whistle: ng_cisco.c,v 1.25 1999/11/01 09:24:51 julian Exp $ */ @@ -279,9 +279,9 @@ cisco_rcvmsg(node_p node, struct ng_mesg *msg, break; } arg = (char *) resp->data; - pos = sprintf(arg, + pos = ksprintf(arg, "keepalive period: %d sec; ", KEEPALIVE_SECS); - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "unacknowledged keepalives: %ld", sc->seqRetries); resp->header.arglen = pos + 1; break; diff --git a/sys/netgraph/eiface/ng_eiface.c b/sys/netgraph/eiface/ng_eiface.c index b338dcb7fa..4698486f3e 100644 --- a/sys/netgraph/eiface/ng_eiface.c +++ b/sys/netgraph/eiface/ng_eiface.c @@ -28,7 +28,7 @@ * * $Id: ng_eiface.c,v 1.14 2000/03/15 12:28:44 vitaly Exp $ * $FreeBSD: src/sys/netgraph/ng_eiface.c,v 1.4.2.5 2002/12/17 21:47:48 julian Exp $ - * $DragonFly: src/sys/netgraph/eiface/ng_eiface.c,v 1.10 2006/01/14 11:10:47 swildner Exp $ + * $DragonFly: src/sys/netgraph/eiface/ng_eiface.c,v 1.11 2006/12/20 18:14:43 dillon Exp $ */ #include @@ -350,7 +350,7 @@ ng_eiface_constructor(node_p *nodep) /* Give this node name * bzero(ifname, sizeof(ifname)); - sprintf(ifname, "if%s", ifp->if_xname); + ksprintf(ifname, "if%s", ifp->if_xname); ng_name_node(node, ifname); */ @@ -426,7 +426,7 @@ ng_eiface_rcvmsg(node_p node, struct ng_mesg *msg, break; } arg = (struct ng_eiface_ifname *) resp->data; - sprintf(arg->ngif_name, + ksprintf(arg->ngif_name, "%s", ifp->if_xname); /* XXX: strings */ break; } diff --git a/sys/netgraph/ether/ng_ether.c b/sys/netgraph/ether/ng_ether.c index ba8b8e3ad3..d12b863f6e 100644 --- a/sys/netgraph/ether/ng_ether.c +++ b/sys/netgraph/ether/ng_ether.c @@ -38,7 +38,7 @@ * Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_ether.c,v 1.2.2.13 2002/07/02 20:10:25 archie Exp $ - * $DragonFly: src/sys/netgraph/ether/ng_ether.c,v 1.10 2006/09/30 20:23:05 swildner Exp $ + * $DragonFly: src/sys/netgraph/ether/ng_ether.c,v 1.11 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -722,7 +722,7 @@ ng_enaddr_unparse(const struct ng_parse_type *type, { int len; - len = snprintf(cbuf, cbuflen, "%02x:%02x:%02x:%02x:%02x:%02x", + len = ksnprintf(cbuf, cbuflen, "%02x:%02x:%02x:%02x:%02x:%02x", data[*off], data[*off + 1], data[*off + 2], data[*off + 3], data[*off + 4], data[*off + 5]); if (len >= cbuflen) diff --git a/sys/netgraph/fec/ng_fec.c b/sys/netgraph/fec/ng_fec.c index aa8167b2f2..f199cdec25 100644 --- a/sys/netgraph/fec/ng_fec.c +++ b/sys/netgraph/fec/ng_fec.c @@ -33,7 +33,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/netgraph/ng_fec.c,v 1.1.2.1 2002/11/01 21:39:31 julian Exp $ - * $DragonFly: src/sys/netgraph/fec/ng_fec.c,v 1.17 2006/01/14 11:10:47 swildner Exp $ + * $DragonFly: src/sys/netgraph/fec/ng_fec.c,v 1.18 2006/12/20 18:14:43 dillon Exp $ */ /* * Copyright (c) 1996-1999 Whistle Communications, Inc. @@ -1196,7 +1196,7 @@ ng_fec_rmnode(node_p node) while (!TAILQ_EMPTY(&b->ng_fec_ports)) { p = TAILQ_FIRST(&b->ng_fec_ports); - sprintf(ifname, "%s", + ksprintf(ifname, "%s", p->fec_if->if_xname); /* XXX: strings */ ng_fec_delport(priv, ifname); } diff --git a/sys/netgraph/ksocket/ng_ksocket.c b/sys/netgraph/ksocket/ng_ksocket.c index c1d3728d75..b2232ac7f3 100644 --- a/sys/netgraph/ksocket/ng_ksocket.c +++ b/sys/netgraph/ksocket/ng_ksocket.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_ksocket.c,v 1.5.2.14 2003/08/24 08:24:38 hsu Exp $ - * $DragonFly: src/sys/netgraph/ksocket/ng_ksocket.c,v 1.11 2006/06/13 08:12:03 dillon Exp $ + * $DragonFly: src/sys/netgraph/ksocket/ng_ksocket.c,v 1.12 2006/12/20 18:14:43 dillon Exp $ * $Whistle: ng_ksocket.c,v 1.1 1999/11/16 20:04:40 archie Exp $ */ @@ -336,7 +336,7 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type, pathbuf[pathlen] = '\0'; if ((pathtoken = ng_encode_string(pathbuf)) == NULL) return (ENOMEM); - slen += snprintf(cbuf, cbuflen, "local/%s", pathtoken); + slen += ksnprintf(cbuf, cbuflen, "local/%s", pathtoken); FREE(pathtoken, M_NETGRAPH); if (slen >= cbuflen) return (ERANGE); @@ -348,13 +348,13 @@ ng_ksocket_sockaddr_unparse(const struct ng_parse_type *type, { const struct sockaddr_in *sin = (const struct sockaddr_in *)sa; - slen += snprintf(cbuf, cbuflen, "inet/%d.%d.%d.%d", + slen += ksnprintf(cbuf, cbuflen, "inet/%d.%d.%d.%d", ((const u_char *)&sin->sin_addr)[0], ((const u_char *)&sin->sin_addr)[1], ((const u_char *)&sin->sin_addr)[2], ((const u_char *)&sin->sin_addr)[3]); if (sin->sin_port != 0) { - slen += snprintf(cbuf + strlen(cbuf), + slen += ksnprintf(cbuf + strlen(cbuf), cbuflen - strlen(cbuf), ":%d", (u_int)ntohs(sin->sin_port)); } @@ -583,7 +583,7 @@ ng_ksocket_newhook(node_p node, hook_p hook, const char *name0) } } else { /* Extract family, type, and protocol from hook name */ - snprintf(name, sizeof(name), "%s", name0); + ksnprintf(name, sizeof(name), "%s", name0); s1 = name; if ((s2 = index(s1, '/')) == NULL) return (EINVAL); diff --git a/sys/netgraph/lmi/ng_lmi.c b/sys/netgraph/lmi/ng_lmi.c index d6ad91abad..bf96011430 100644 --- a/sys/netgraph/lmi/ng_lmi.c +++ b/sys/netgraph/lmi/ng_lmi.c @@ -37,7 +37,7 @@ * Author: Julian Elischer * * $FreeBSD: src/sys/netgraph/ng_lmi.c,v 1.5.2.3 2002/07/02 22:17:18 archie Exp $ - * $DragonFly: src/sys/netgraph/lmi/ng_lmi.c,v 1.6 2005/06/02 22:11:46 swildner Exp $ + * $DragonFly: src/sys/netgraph/lmi/ng_lmi.c,v 1.7 2006/12/20 18:14:43 dillon Exp $ * $Whistle: ng_lmi.c,v 1.38 1999/11/01 09:24:52 julian Exp $ */ @@ -474,18 +474,18 @@ nglmi_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, break; } arg = (*resp)->data; - pos = sprintf(arg, "protocol %s ", sc->protoname); + pos = ksprintf(arg, "protocol %s ", sc->protoname); if (sc->flags & SCF_FIXED) - pos += sprintf(arg + pos, "fixed\n"); + pos += ksprintf(arg + pos, "fixed\n"); else if (sc->flags & SCF_AUTO) - pos += sprintf(arg + pos, "auto-detecting\n"); + pos += ksprintf(arg + pos, "auto-detecting\n"); else - pos += sprintf(arg + pos, "auto on dlci %d\n", + pos += ksprintf(arg + pos, "auto on dlci %d\n", (sc->lmi_channel == sc->lmi_channel0) ? 0 : 1023); - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "keepalive period: %d seconds\n", sc->liv_rate); - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "unacknowledged keepalives: %ld\n", sc->seq_retries); for (count = 0; @@ -493,7 +493,7 @@ nglmi_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr, && (pos < (NG_TEXTRESPONSE - 20))); count++) { if (sc->dlci_state[count]) { - pos += sprintf(arg + pos, + pos += ksprintf(arg + pos, "dlci %d %s\n", count, (sc->dlci_state[count] == DLCI_UP) ? "up" : "down"); @@ -1010,7 +1010,7 @@ print: pos = 0; j = 0; while ((j++ < 16) && k < m->m_hdr.mh_len) { - pos += sprintf(buf + pos, "%c%02x", + pos += ksprintf(buf + pos, "%c%02x", ((loc == k) ? '>' : ' '), bp[k]); k++; @@ -1037,7 +1037,7 @@ reject: pos = 0; j = 0; while ((j++ < 16) && k < m->m_hdr.mh_len) { - pos += sprintf(buf + pos, "%c%02x", + pos += ksprintf(buf + pos, "%c%02x", ((loc == k) ? '>' : ' '), bp[k]); k++; diff --git a/sys/netgraph/netgraph/ng_base.c b/sys/netgraph/netgraph/ng_base.c index 730baf574a..0202821695 100644 --- a/sys/netgraph/netgraph/ng_base.c +++ b/sys/netgraph/netgraph/ng_base.c @@ -38,7 +38,7 @@ * Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_base.c,v 1.11.2.17 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/netgraph/ng_base.c,v 1.21 2006/06/06 18:04:16 dillon Exp $ + * $DragonFly: src/sys/netgraph/netgraph/ng_base.c,v 1.22 2006/12/20 18:14:43 dillon Exp $ * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ */ @@ -331,7 +331,7 @@ ng_load_module(const char *name) return (ENXIO); /* Not found, try to load it as a loadable module */ - snprintf(filename, sizeof(filename), "ng_%s.ko", name); + ksnprintf(filename, sizeof(filename), "ng_%s.ko", name); if ((path = linker_search_path(filename)) == NULL) return (ENXIO); error = linker_load_file(path, &lf); @@ -352,7 +352,7 @@ ng_unload_module(const char *name) return (ENXIO); /* Not found, try to load it as a loadable module */ - snprintf(filename, sizeof(filename), "ng_%s.ko", name); + ksnprintf(filename, sizeof(filename), "ng_%s.ko", name); if ((lf = linker_find_file_by_name(filename)) == NULL) return (ENXIO); error = linker_file_unload(lf); @@ -1179,9 +1179,9 @@ ng_path2node(node_p here, const char *address, node_p *destp, char **rtnp) return (ENOMEM); } if (start->name != NULL) - sprintf(*rtnp, "%s:", start->name); + ksprintf(*rtnp, "%s:", start->name); else - sprintf(*rtnp, "[%x]:", ng_node2ID(start)); + ksprintf(*rtnp, "[%x]:", ng_node2ID(start)); } /* Done */ @@ -1566,7 +1566,7 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr, } /* Convert command name to ASCII */ - snprintf(ascii->header.cmdstr, sizeof(ascii->header.cmdstr), + ksnprintf(ascii->header.cmdstr, sizeof(ascii->header.cmdstr), "%s", c->name); /* Convert command arguments to ASCII */ diff --git a/sys/netgraph/netgraph/ng_parse.c b/sys/netgraph/netgraph/ng_parse.c index fa29666fd3..2ac2f82d49 100644 --- a/sys/netgraph/netgraph/ng_parse.c +++ b/sys/netgraph/netgraph/ng_parse.c @@ -38,7 +38,7 @@ * * $Whistle: ng_parse.c,v 1.3 1999/11/29 01:43:48 archie Exp $ * $FreeBSD: src/sys/netgraph/ng_parse.c,v 1.3.2.8 2002/07/02 23:44:02 archie Exp $ - * $DragonFly: src/sys/netgraph/netgraph/ng_parse.c,v 1.7 2006/09/30 20:23:05 swildner Exp $ + * $DragonFly: src/sys/netgraph/netgraph/ng_parse.c,v 1.8 2006/12/20 18:14:43 dillon Exp $ */ #include @@ -126,7 +126,7 @@ static ng_getAlign_t *ng_get_getAlign_method(const struct ng_parse_type *t); do { \ int len; \ \ - len = snprintf((cbuf), (cbuflen), \ + len = ksnprintf((cbuf), (cbuflen), \ fmt , ## args); \ if (len >= (cbuflen)) \ return (ERANGE); \ @@ -1669,7 +1669,7 @@ ng_encode_string(const char *raw) break; default: if (*raw < 0x20 || *raw > 0x7e) { - off += sprintf(cbuf + off, + off += ksprintf(cbuf + off, "\\x%02x", (u_char)*raw); break; } diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index 4053645ce0..2bd30f1f61 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -29,7 +29,7 @@ * netgraph node. * * $FreeBSD: src/sys/netgraph/ng_device.c,v 1.1.2.1 2002/08/23 07:15:44 julian Exp $ - * $DragonFly: src/sys/netgraph/ng_device.c,v 1.8 2006/09/10 01:26:40 dillon Exp $ + * $DragonFly: src/sys/netgraph/ng_device.c,v 1.9 2006/12/20 18:14:42 dillon Exp $ * */ @@ -187,7 +187,7 @@ ng_device_init(void) printf("%s(): ng_make_node_common failed\n", __func__); return(ENXIO); } - sprintf(sc->nodename, "%s", NG_DEVICE_NODE_TYPE); + ksprintf(sc->nodename, "%s", NG_DEVICE_NODE_TYPE); if (ng_name_node(sc->node, sc->nodename)) { NG_NODE_UNREF(sc->node); /* make it go away again */ printf("%s(): ng_name_node failed\n", __func__); diff --git a/sys/netgraph/ppp/ng_ppp.c b/sys/netgraph/ppp/ng_ppp.c index c4c9b3b29b..ed90f8233b 100644 --- a/sys/netgraph/ppp/ng_ppp.c +++ b/sys/netgraph/ppp/ng_ppp.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_ppp.c,v 1.15.2.10 2003/03/10 17:55:48 archie Exp $ - * $DragonFly: src/sys/netgraph/ppp/ng_ppp.c,v 1.10 2006/12/13 21:58:52 dillon Exp $ + * $DragonFly: src/sys/netgraph/ppp/ng_ppp.c,v 1.11 2006/12/20 18:14:43 dillon Exp $ * $Whistle: ng_ppp.c,v 1.24 1999/11/01 09:24:52 julian Exp $ */ @@ -565,7 +565,7 @@ ng_ppp_rcvmsg(node_p node, struct ng_mesg *msg, if ((error = ng_path2node(node, raddr, &origNode, NULL)) != 0) ERROUT(error); - snprintf(path, sizeof(path), "[%lx]:%s", + ksnprintf(path, sizeof(path), "[%lx]:%s", (long)node, NG_PPP_HOOK_VJC_IP); return ng_send_msg(origNode, msg, path, rptr); } diff --git a/sys/netgraph/tty/ng_tty.c b/sys/netgraph/tty/ng_tty.c index d0511441c4..dd5e3d17ed 100644 --- a/sys/netgraph/tty/ng_tty.c +++ b/sys/netgraph/tty/ng_tty.c @@ -37,7 +37,7 @@ * Author: Archie Cobbs * * $FreeBSD: src/sys/netgraph/ng_tty.c,v 1.7.2.3 2002/02/13 00:43:12 dillon Exp $ - * $DragonFly: src/sys/netgraph/tty/ng_tty.c,v 1.16 2006/11/07 18:50:07 dillon Exp $ + * $DragonFly: src/sys/netgraph/tty/ng_tty.c,v 1.17 2006/12/20 18:14:43 dillon Exp $ * $Whistle: ng_tty.c,v 1.21 1999/11/01 09:24:52 julian Exp $ */ @@ -225,7 +225,7 @@ ngt_open(cdev_t dev, struct tty *tp) FREE(sc, M_NETGRAPH); goto done; } - snprintf(name, sizeof(name), "%s%d", typestruct.name, ngt_unit++); + ksnprintf(name, sizeof(name), "%s%d", typestruct.name, ngt_unit++); /* Set back pointers */ sc->node->private = sc; diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 77f3f48b40..89228a714d 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netinet/ip_divert.c,v 1.42.2.6 2003/01/23 21:06:45 sam Exp $ - * $DragonFly: src/sys/netinet/ip_divert.c,v 1.25 2005/06/17 19:12:20 dillon Exp $ + * $DragonFly: src/sys/netinet/ip_divert.c,v 1.26 2006/12/20 18:14:43 dillon Exp $ */ #include "opt_inet.h" @@ -212,7 +212,7 @@ divert_packet(struct mbuf *m, int incoming, int port) * this iface name will come along for the ride. * (see div_output for the other half of this.) */ - snprintf(divsrc.sin_zero, sizeof divsrc.sin_zero, + ksnprintf(divsrc.sin_zero, sizeof divsrc.sin_zero, m->m_pkthdr.rcvif->if_xname); } diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index e244986052..19231ba840 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/icmp6.c,v 1.6.2.13 2003/05/06 06:46:58 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/icmp6.c,v 1.23 2006/10/24 06:18:42 hsu Exp $ */ +/* $DragonFly: src/sys/netinet6/icmp6.c,v 1.24 2006/12/20 18:14:43 dillon Exp $ */ /* $KAME: icmp6.c,v 1.211 2001/04/04 05:56:20 itojun Exp $ */ /* @@ -2140,7 +2140,7 @@ icmp6_redirect_diag(struct in6_addr *src6, struct in6_addr *dst6, struct in6_addr *tgt6) { static char buf[1024]; - snprintf(buf, sizeof(buf), "(src=%s dst=%s tgt=%s)", + ksnprintf(buf, sizeof(buf), "(src=%s dst=%s tgt=%s)", ip6_sprintf(src6), ip6_sprintf(dst6), ip6_sprintf(tgt6)); return buf; } diff --git a/sys/netinet6/ipsec.c b/sys/netinet6/ipsec.c index 2ac00c1f30..1dbc478726 100644 --- a/sys/netinet6/ipsec.c +++ b/sys/netinet6/ipsec.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netinet6/ipsec.c,v 1.3.2.12 2003/05/06 06:46:58 suz Exp $ */ -/* $DragonFly: src/sys/netinet6/ipsec.c,v 1.17 2006/10/24 06:18:42 hsu Exp $ */ +/* $DragonFly: src/sys/netinet6/ipsec.c,v 1.18 2006/12/20 18:14:43 dillon Exp $ */ /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ /* @@ -2261,18 +2261,18 @@ ipsec4_logpacketstr(struct ip *ip, u_int32_t spi) d = (u_int8_t *)(&ip->ip_dst); p = buf; - snprintf(buf, sizeof(buf), "packet(SPI=%u ", (u_int32_t)ntohl(spi)); + ksnprintf(buf, sizeof(buf), "packet(SPI=%u ", (u_int32_t)ntohl(spi)); while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), "src=%u.%u.%u.%u", + ksnprintf(p, sizeof(buf) - (p - buf), "src=%u.%u.%u.%u", s[0], s[1], s[2], s[3]); while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), " dst=%u.%u.%u.%u", + ksnprintf(p, sizeof(buf) - (p - buf), " dst=%u.%u.%u.%u", d[0], d[1], d[2], d[3]); while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), ")"); + ksnprintf(p, sizeof(buf) - (p - buf), ")"); return buf; } @@ -2285,18 +2285,18 @@ ipsec6_logpacketstr(struct ip6_hdr *ip6, u_int32_t spi) char *p; p = buf; - snprintf(buf, sizeof(buf), "packet(SPI=%u ", (u_int32_t)ntohl(spi)); + ksnprintf(buf, sizeof(buf), "packet(SPI=%u ", (u_int32_t)ntohl(spi)); while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), "src=%s", + ksnprintf(p, sizeof(buf) - (p - buf), "src=%s", ip6_sprintf(&ip6->ip6_src)); while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), " dst=%s", + ksnprintf(p, sizeof(buf) - (p - buf), " dst=%s", ip6_sprintf(&ip6->ip6_dst)); while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), ")"); + ksnprintf(p, sizeof(buf) - (p - buf), ")"); return buf; } @@ -2315,32 +2315,32 @@ ipsec_logsastr(struct secasvar *sav) panic("ipsec_logsastr: family mismatched."); p = buf; - snprintf(buf, sizeof(buf), "SA(SPI=%u ", (u_int32_t)ntohl(sav->spi)); + ksnprintf(buf, sizeof(buf), "SA(SPI=%u ", (u_int32_t)ntohl(sav->spi)); while (p && *p) p++; if (((struct sockaddr *)&saidx->src)->sa_family == AF_INET) { u_int8_t *s, *d; s = (u_int8_t *)&((struct sockaddr_in *)&saidx->src)->sin_addr; d = (u_int8_t *)&((struct sockaddr_in *)&saidx->dst)->sin_addr; - snprintf(p, sizeof(buf) - (p - buf), + ksnprintf(p, sizeof(buf) - (p - buf), "src=%d.%d.%d.%d dst=%d.%d.%d.%d", s[0], s[1], s[2], s[3], d[0], d[1], d[2], d[3]); } #ifdef INET6 else if (((struct sockaddr *)&saidx->src)->sa_family == AF_INET6) { - snprintf(p, sizeof(buf) - (p - buf), + ksnprintf(p, sizeof(buf) - (p - buf), "src=%s", ip6_sprintf(&((struct sockaddr_in6 *)&saidx->src)->sin6_addr)); while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), + ksnprintf(p, sizeof(buf) - (p - buf), " dst=%s", ip6_sprintf(&((struct sockaddr_in6 *)&saidx->dst)->sin6_addr)); } #endif while (p && *p) p++; - snprintf(p, sizeof(buf) - (p - buf), ")"); + ksnprintf(p, sizeof(buf) - (p - buf), ")"); return buf; } diff --git a/sys/netproto/802_11/wlan/ieee80211_dragonfly.c b/sys/netproto/802_11/wlan/ieee80211_dragonfly.c index cd461937b7..26125e09b4 100644 --- a/sys/netproto/802_11/wlan/ieee80211_dragonfly.c +++ b/sys/netproto/802_11/wlan/ieee80211_dragonfly.c @@ -25,7 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/net80211/ieee80211_freebsd.c,v 1.7.2.2 2005/12/22 19:22:51 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_dragonfly.c,v 1.6 2006/11/28 14:44:03 sephe Exp $ + * $DragonFly: src/sys/netproto/802_11/wlan/ieee80211_dragonfly.c,v 1.7 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -93,7 +93,7 @@ ieee80211_sysctl_attach(struct ieee80211com *ic) M_WAITOK | M_ZERO); sysctl_ctx_init(ctx); - snprintf(num, sizeof(num), "%u", ic->ic_vap); + ksnprintf(num, sizeof(num), "%u", ic->ic_vap); oid = SYSCTL_ADD_NODE(ctx, &SYSCTL_NODE_CHILDREN(_net, wlan), OID_AUTO, num, CTLFLAG_RD, NULL, ""); if (oid == NULL) { diff --git a/sys/netproto/atalk/at_rmx.c b/sys/netproto/atalk/at_rmx.c index 952778ada0..cff4b1528a 100644 --- a/sys/netproto/atalk/at_rmx.c +++ b/sys/netproto/atalk/at_rmx.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * at_rmx.c,v 1.13 1995/05/30 08:09:31 rgrimes Exp - * $DragonFly: src/sys/netproto/atalk/at_rmx.c,v 1.2 2004/12/14 18:46:58 hsu Exp $ + * $DragonFly: src/sys/netproto/atalk/at_rmx.c,v 1.3 2006/12/20 18:14:43 dillon Exp $ */ /* This code generates debugging traces to the radix code */ @@ -54,13 +54,13 @@ prsockaddr(void *v) /* return: "(len) hexdump" */ - bp += sprintf(bp, "(%d)", len); + bp += ksprintf(bp, "(%d)", len); for (cp++; cp < cplim && bp < hexbuf+252; cp++) { *bp++ = "0123456789abcdef"[*cp / 16]; *bp++ = "0123456789abcdef"[*cp % 16]; } } else { - bp+= sprintf(bp, "null"); + bp+= ksprintf(bp, "null"); } *bp = '\0'; diff --git a/sys/netproto/atm/atm_device.c b/sys/netproto/atm/atm_device.c index aaa7c88142..5753ba4be6 100644 --- a/sys/netproto/atm/atm_device.c +++ b/sys/netproto/atm/atm_device.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/atm_device.c,v 1.5 1999/08/28 00:48:35 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/atm_device.c,v 1.8 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/atm_device.c,v 1.9 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -760,7 +760,7 @@ atm_dev_pdu_print(Cmn_unit *cup, Cmn_vcc *cvp, KBuffer *m, char *msg) { char buf[128]; - snprintf(buf, sizeof(buf), "%s vcc=(%d,%d)", msg, + ksnprintf(buf, sizeof(buf), "%s vcc=(%d,%d)", msg, cvp->cv_connvc->cvc_vcc->vc_vpi, cvp->cv_connvc->cvc_vcc->vc_vci); diff --git a/sys/netproto/atm/atm_if.c b/sys/netproto/atm/atm_if.c index 5050e8bd88..203bc2e0af 100644 --- a/sys/netproto/atm/atm_if.c +++ b/sys/netproto/atm/atm_if.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/atm_if.c,v 1.5 1999/08/28 00:48:35 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/atm_if.c,v 1.14 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/atm_if.c,v 1.15 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -303,7 +303,7 @@ atm_physif_ioctl(int code, caddr_t data, caddr_t arg) KM_ZERO((caddr_t)&apr, sizeof(apr)); smp = pip->pif_sigmgr; sip = pip->pif_siginst; - snprintf(apr.anp_intf, sizeof(apr.anp_intf), + ksnprintf(apr.anp_intf, sizeof(apr.anp_intf), "%s%d", pip->pif_name, pip->pif_unit ); if ( pip->pif_nif ) { @@ -358,13 +358,13 @@ atm_physif_ioctl(int code, caddr_t data, caddr_t arg) * Fill in info to be returned */ KM_ZERO((caddr_t)&anr, sizeof(anr)); - snprintf(anr.anp_intf, sizeof(anr.anp_intf), + ksnprintf(anr.anp_intf, sizeof(anr.anp_intf), "%s", ifp->if_xname); IFP_TO_IA(ifp, ia); if (ia) { anr.anp_proto_addr = *ia->ia_ifa.ifa_addr; } - snprintf(anr.anp_phy_intf, sizeof(anr.anp_phy_intf), + ksnprintf(anr.anp_phy_intf, sizeof(anr.anp_phy_intf), "%s%d", pip->pif_name, pip->pif_unit); /* @@ -388,7 +388,7 @@ atm_physif_ioctl(int code, caddr_t data, caddr_t arg) pip = (struct atm_pif *)arg; if ( pip == NULL ) return ( ENXIO ); - snprintf ( ifname, sizeof(ifname), + ksnprintf ( ifname, sizeof(ifname), "%s%d", pip->pif_name, pip->pif_unit ); /* @@ -543,7 +543,7 @@ atm_physif_ioctl(int code, caddr_t data, caddr_t arg) * Fill in info to be returned */ KM_ZERO((caddr_t)&acr, sizeof(acr)); - snprintf(acr.acp_intf, sizeof(acr.acp_intf), + ksnprintf(acr.acp_intf, sizeof(acr.acp_intf), "%s%d", pip->pif_name, pip->pif_unit); KM_COPY((caddr_t)acp, (caddr_t)&acr.acp_cfg, sizeof(Atm_config)); diff --git a/sys/netproto/atm/atm_socket.c b/sys/netproto/atm/atm_socket.c index aa85b3ccf8..5c140bf2b7 100644 --- a/sys/netproto/atm/atm_socket.c +++ b/sys/netproto/atm/atm_socket.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/atm_socket.c,v 1.4 1999/08/28 00:48:37 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/atm_socket.c,v 1.8 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/atm_socket.c,v 1.9 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -1176,7 +1176,7 @@ atm_sock_getopt(struct socket *so, struct sockopt *sopt, Atm_pcb *atp) struct ifnet *ifp; ifp = &ap->nif->nif_if; - snprintf(netif.net_intf, sizeof(netif.net_intf), + ksnprintf(netif.net_intf, sizeof(netif.net_intf), "%s", ifp->if_xname); return (sooptcopyout(sopt, &netif, sizeof netif)); diff --git a/sys/netproto/atm/sigpvc/sigpvc_if.c b/sys/netproto/atm/sigpvc/sigpvc_if.c index 847ec8206e..95ec097e57 100644 --- a/sys/netproto/atm/sigpvc/sigpvc_if.c +++ b/sys/netproto/atm/sigpvc/sigpvc_if.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/sigpvc/sigpvc_if.c,v 1.7 2000/01/17 20:49:46 mks Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/sigpvc/sigpvc_if.c,v 1.10 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/sigpvc/sigpvc_if.c,v 1.11 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -587,7 +587,7 @@ sigpvc_ioctl(int code, caddr_t data, caddr_t arg1) /* * Fill in info to be returned */ - snprintf(avr.avp_intf, sizeof(avr.avp_intf), + ksnprintf(avr.avp_intf, sizeof(avr.avp_intf), "%s%d", pvp->pv_pif->pif_name, pvp->pv_pif->pif_unit); avr.avp_vpi = vcp->vc_vpi; diff --git a/sys/netproto/atm/spans/spans_cls.c b/sys/netproto/atm/spans/spans_cls.c index 3ac7a97fdc..5cc9f1bfab 100644 --- a/sys/netproto/atm/spans/spans_cls.c +++ b/sys/netproto/atm/spans/spans_cls.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/spans/spans_cls.c,v 1.6 1999/08/28 00:48:49 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_cls.c,v 1.7 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_cls.c,v 1.8 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -820,7 +820,7 @@ spanscls_pdu_print(struct spanscls *clp, KBuffer *m, char *msg) { char buf[128]; - snprintf(buf, sizeof(buf), "spanscls %s:\n", msg); + ksnprintf(buf, sizeof(buf), "spanscls %s:\n", msg); atm_pdu_print(m, buf); } diff --git a/sys/netproto/atm/spans/spans_if.c b/sys/netproto/atm/spans/spans_if.c index 6af5c216e1..363bf7264e 100644 --- a/sys/netproto/atm/spans/spans_if.c +++ b/sys/netproto/atm/spans/spans_if.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/spans/spans_if.c,v 1.6 1999/08/28 00:48:49 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_if.c,v 1.10 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_if.c,v 1.11 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -953,7 +953,7 @@ spans_ioctl(int code, caddr_t data, caddr_t arg1) /* * Fill out the response struct for the VCC */ - snprintf(rsp.avp_intf, + ksnprintf(rsp.avp_intf, sizeof(rsp.avp_intf), "%s%d", spp->sp_pif->pif_name, spp->sp_pif->pif_unit); diff --git a/sys/netproto/atm/spans/spans_print.c b/sys/netproto/atm/spans/spans_print.c index 0615923949..a4f237a973 100644 --- a/sys/netproto/atm/spans/spans_print.c +++ b/sys/netproto/atm/spans/spans_print.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/spans/spans_print.c,v 1.6 1999/08/28 00:48:50 peter Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_print.c,v 1.6 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_print.c,v 1.7 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -140,9 +140,9 @@ spans_aal_str(spans_aal *objp, char *dest, int len) }; if (*objp < SPANS_AAL0 || *objp > SPANS_AAL5) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); + ksnprintf(dest, len, "Invalid (%d)", (int)*objp); } else { - snprintf(dest, len, "%s (%d)", aal_names[(int)*objp], + ksnprintf(dest, len, "%s (%d)", aal_names[(int)*objp], (int)*objp); } } @@ -161,9 +161,9 @@ spans_result_str(spans_result *objp, char *dest, int len) }; if (*objp < SPANS_OK || *objp > SPANS_BADDEST) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); + ksnprintf(dest, len, "Invalid (%d)", (int)*objp); } else { - snprintf(dest, len, "%s (%d)", + ksnprintf(dest, len, "%s (%d)", result_names[(int)*objp], (int)*objp); } } @@ -215,7 +215,7 @@ spans_msgtype_str(spans_msgtype *objp, char *dest, int len) */ for (i=0; msgtype_names[i].name; i++) { if (*objp == msgtype_names[i].type) { - snprintf(dest, len, "%s (%d)", + ksnprintf(dest, len, "%s (%d)", msgtype_names[i].name, (int)*objp); return; @@ -225,7 +225,7 @@ spans_msgtype_str(spans_msgtype *objp, char *dest, int len) /* * Type was not found--return an error indicator */ - snprintf(dest, len, "Invalid (%d)", (int)*objp); + ksnprintf(dest, len, "Invalid (%d)", (int)*objp); } #ifdef LONGPRINT @@ -241,9 +241,9 @@ spans_query_type_str(spans_query_type *objp, char *dest, int len) if (*objp < SPANS_QUERY_NORMAL || *objp > SPANS_QUERY_END_TO_END) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); + ksnprintf(dest, len, "Invalid (%d)", (int)*objp); } else { - snprintf(dest, len, "%s (%d)", query_names[(int)*objp], + ksnprintf(dest, len, "%s (%d)", query_names[(int)*objp], (int)*objp); } } @@ -259,9 +259,9 @@ spans_state_str(spans_query_type *objp, char *dest, int len) }; if (*objp < SPANS_CONN_OPEN || *objp > SPANS_CONN_CLOSED) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); + ksnprintf(dest, len, "Invalid (%d)", (int)*objp); } else { - snprintf(dest, len, "%s (%d)", state_names[(int)*objp], + ksnprintf(dest, len, "%s (%d)", state_names[(int)*objp], (int)*objp); } } diff --git a/sys/netproto/atm/spans/spans_util.c b/sys/netproto/atm/spans/spans_util.c index 9f12b72eb0..489c795c9b 100644 --- a/sys/netproto/atm/spans/spans_util.c +++ b/sys/netproto/atm/spans/spans_util.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/spans/spans_util.c,v 1.5 1999/08/29 10:28:10 bde Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_util.c,v 1.5 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/spans/spans_util.c,v 1.6 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -416,7 +416,7 @@ spans_addr_print(struct spans_addr *p) /* * Print and return the string */ - sprintf(strbuff, "%lx.%lx", (u_long)ntohl(u1.w), (u_long)ntohl(u2.w)); + ksprintf(strbuff, "%lx.%lx", (u_long)ntohl(u1.w), (u_long)ntohl(u2.w)); return(strbuff); } diff --git a/sys/netproto/atm/uni/sscf_uni.c b/sys/netproto/atm/uni/sscf_uni.c index ef11a81629..a90f251e0a 100644 --- a/sys/netproto/atm/uni/sscf_uni.c +++ b/sys/netproto/atm/uni/sscf_uni.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/uni/sscf_uni.c,v 1.7.2.1 2001/09/30 22:54:35 kris Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/uni/sscf_uni.c,v 1.6 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/uni/sscf_uni.c,v 1.7 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -296,7 +296,7 @@ sscf_uni_pdu_print(struct univcc *uvp, KBuffer *m, char *msg) struct vccb *vcp; vcp = uvp->uv_connvc->cvc_vcc; - snprintf(buf, sizeof(buf), "sscf_uni %s: vcc=(%d,%d)\n", + ksnprintf(buf, sizeof(buf), "sscf_uni %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci); atm_pdu_print(m, buf); } diff --git a/sys/netproto/atm/uni/sscop_pdu.c b/sys/netproto/atm/uni/sscop_pdu.c index 226120b5b3..374f000c0d 100644 --- a/sys/netproto/atm/uni/sscop_pdu.c +++ b/sys/netproto/atm/uni/sscop_pdu.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/uni/sscop_pdu.c,v 1.5 2000/01/17 20:49:52 mks Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/uni/sscop_pdu.c,v 1.6 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/uni/sscop_pdu.c,v 1.7 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -1195,7 +1195,7 @@ sscop_pdu_print(struct sscop *sop, KBuffer *m, char *msg) struct vccb *vcp; vcp = sop->so_connvc->cvc_vcc; - snprintf(buf, sizeof(buf), + ksnprintf(buf, sizeof(buf), "sscop %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci); atm_pdu_print(m, buf); } diff --git a/sys/netproto/atm/uni/uniarp_input.c b/sys/netproto/atm/uni/uniarp_input.c index 21825d0707..58b8511730 100644 --- a/sys/netproto/atm/uni/uniarp_input.c +++ b/sys/netproto/atm/uni/uniarp_input.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/uni/uniarp_input.c,v 1.6 2000/01/17 20:49:55 mks Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/uni/uniarp_input.c,v 1.7 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/uni/uniarp_input.c,v 1.8 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -826,7 +826,7 @@ uniarp_pdu_print(struct ipvcc *ivp, KBuffer *m, char *msg) struct vccb *vcp; vcp = ivp->iv_conn->co_connvc->cvc_vcc; - snprintf(buf, sizeof(buf), + ksnprintf(buf, sizeof(buf), "uniarp %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci); atm_pdu_print(m, buf); } diff --git a/sys/netproto/atm/uni/unisig_if.c b/sys/netproto/atm/uni/unisig_if.c index 2a346d7f85..900aac66ce 100644 --- a/sys/netproto/atm/uni/unisig_if.c +++ b/sys/netproto/atm/uni/unisig_if.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/uni/unisig_if.c,v 1.8 2000/01/17 20:49:56 mks Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/uni/unisig_if.c,v 1.8 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/uni/unisig_if.c,v 1.9 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -871,7 +871,7 @@ unisig_ioctl(int code, caddr_t data, caddr_t arg1) /* * Fill out the response struct for the VCC */ - snprintf(rsp.avp_intf, + ksnprintf(rsp.avp_intf, sizeof(rsp.avp_intf), "%s%d", usp->us_pif->pif_name, usp->us_pif->pif_unit); diff --git a/sys/netproto/atm/uni/unisig_util.c b/sys/netproto/atm/uni/unisig_util.c index fe10460802..88da10f6af 100644 --- a/sys/netproto/atm/uni/unisig_util.c +++ b/sys/netproto/atm/uni/unisig_util.c @@ -24,7 +24,7 @@ * notice must be reproduced on all copies. * * @(#) $FreeBSD: src/sys/netatm/uni/unisig_util.c,v 1.6 2000/01/17 20:49:58 mks Exp $ - * @(#) $DragonFly: src/sys/netproto/atm/uni/unisig_util.c,v 1.5 2006/01/14 13:36:39 swildner Exp $ + * @(#) $DragonFly: src/sys/netproto/atm/uni/unisig_util.c,v 1.6 2006/12/20 18:14:43 dillon Exp $ */ /* @@ -283,7 +283,7 @@ unisig_addr_print(Atm_addr *p) * two-digit hex representation of the * NSAP byte in the output buffer */ - snprintf(t_buff, sizeof(t_buff), + ksnprintf(t_buff, sizeof(t_buff), "%x", *cp + 512); strcpy(op, &t_buff[strlen(t_buff)-2]); op++; op++; @@ -306,7 +306,7 @@ unisig_addr_print(Atm_addr *p) * Print the IA5 characters of the E.164 address */ for(i=0; iaddress_length; i++) { - snprintf(strbuff + strlen(strbuff), + ksnprintf(strbuff + strlen(strbuff), sizeof(strbuff) - strlen(strbuff), "%c", ((Atm_addr_e164 *)p->address)->aae_addr[i]); } @@ -328,7 +328,7 @@ unisig_addr_print(Atm_addr *p) /* * Print the address as two words xxxxx.yyyyyyyy */ - snprintf(strbuff, sizeof(strbuff), "%x.%x", u1.w, u2.w); + ksnprintf(strbuff, sizeof(strbuff), "%x.%x", u1.w, u2.w); break; case T_ATM_ABSENT: diff --git a/sys/netproto/ipsec/ipsec.c b/sys/netproto/ipsec/ipsec.c index ae782acc24..f9bb021262 100644 --- a/sys/netproto/ipsec/ipsec.c +++ b/sys/netproto/ipsec/ipsec.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/netipsec/ipsec.c,v 1.2.2.1 2003/01/24 05:11:35 sam Exp $ */ -/* $DragonFly: src/sys/netproto/ipsec/ipsec.c,v 1.17 2006/10/12 01:32:51 hsu Exp $ */ +/* $DragonFly: src/sys/netproto/ipsec/ipsec.c,v 1.18 2006/12/20 18:14:44 dillon Exp $ */ /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */ /* @@ -1784,15 +1784,15 @@ ipsec_logsastr(struct secasvar *sav) ("ipsec_logsastr: address family mismatch")); p = buf; - snprintf(buf, sizeof(buf), "SA(SPI=%u ", (u_int32_t)ntohl(sav->spi)); + ksnprintf(buf, sizeof(buf), "SA(SPI=%u ", (u_int32_t)ntohl(sav->spi)); while (p && *p) p++; /* NB: only use ipsec_address on one address at a time */ - snprintf(p, sizeof (buf) - (p - buf), "src=%s ", + ksnprintf(p, sizeof (buf) - (p - buf), "src=%s ", ipsec_address(&saidx->src)); while (p && *p) p++; - snprintf(p, sizeof (buf) - (p - buf), "dst=%s)", + ksnprintf(p, sizeof (buf) - (p - buf), "dst=%s)", ipsec_address(&saidx->dst)); return buf; diff --git a/sys/netproto/ipx/ipx.c b/sys/netproto/ipx/ipx.c index 512108be55..28e4ac23aa 100644 --- a/sys/netproto/ipx/ipx.c +++ b/sys/netproto/ipx/ipx.c @@ -34,7 +34,7 @@ * @(#)ipx.c * * $FreeBSD: src/sys/netipx/ipx.c,v 1.17.2.3 2003/04/04 09:35:43 tjr Exp $ - * $DragonFly: src/sys/netproto/ipx/ipx.c,v 1.11 2006/09/05 00:55:49 dillon Exp $ + * $DragonFly: src/sys/netproto/ipx/ipx.c,v 1.12 2006/12/20 18:14:44 dillon Exp $ */ #include @@ -358,7 +358,7 @@ ipx_printhost(struct ipx_addr *addr) net = "*"; else { q = work.x_net.c_net; - snprintf(cnet, sizeof(cnet), "%x%x%x%x", + ksnprintf(cnet, sizeof(cnet), "%x%x%x%x", q[0], q[1], q[2], q[3]); for (p = cnet; *p == '0' && p < cnet + 8; p++) continue; @@ -371,7 +371,7 @@ ipx_printhost(struct ipx_addr *addr) host = "*"; else { q = work.x_host.c_host; - snprintf(chost, sizeof(chost), "%x%x%x%x%x%x", + ksnprintf(chost, sizeof(chost), "%x%x%x%x%x%x", q[0], q[1], q[2], q[3], q[4], q[5]); for (p = chost; *p == '0' && p < chost + 12; p++) continue; @@ -381,9 +381,9 @@ ipx_printhost(struct ipx_addr *addr) if (port) { if (strcmp(host, "*") == 0) { host = ""; - snprintf(cport, sizeof(cport), "%x", port); + ksnprintf(cport, sizeof(cport), "%x", port); } else - snprintf(cport, sizeof(cport), ".%x", port); + ksnprintf(cport, sizeof(cport), ".%x", port); } else *cport = 0; diff --git a/sys/netproto/natm/natm.c b/sys/netproto/natm/natm.c index fb5287820d..708eb2b9ef 100644 --- a/sys/netproto/natm/natm.c +++ b/sys/netproto/natm/natm.c @@ -1,6 +1,6 @@ /* $NetBSD: natm.c,v 1.5 1996/11/09 03:26:26 chuck Exp $ */ /* $FreeBSD: src/sys/netnatm/natm.c,v 1.12 2000/02/13 03:32:03 peter Exp $ */ -/* $DragonFly: src/sys/netproto/natm/natm.c,v 1.21 2006/05/20 06:32:41 dillon Exp $ */ +/* $DragonFly: src/sys/netproto/natm/natm.c,v 1.22 2006/12/20 18:14:44 dillon Exp $ */ /* * @@ -632,7 +632,7 @@ natm_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) bcopy(npcb->npcb_ifp->if_xname, snatm->snatm_if, sizeof(snatm->snatm_if)); #elif defined(__DragonFly__) - snprintf(snatm->snatm_if, sizeof(snatm->snatm_if), + ksnprintf(snatm->snatm_if, sizeof(snatm->snatm_if), "%s%d", npcb->npcb_ifp->if_name, npcb->npcb_ifp->if_unit); #endif snatm->snatm_vci = npcb->npcb_vci; diff --git a/sys/netproto/smb/smb_conn.c b/sys/netproto/smb/smb_conn.c index 4e1b20d309..44988f2f2e 100644 --- a/sys/netproto/smb/smb_conn.c +++ b/sys/netproto/smb/smb_conn.c @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/netsmb/smb_conn.c,v 1.1.2.1 2001/05/22 08:32:33 bp Exp $ - * $DragonFly: src/sys/netproto/smb/smb_conn.c,v 1.19 2006/09/30 20:23:05 swildner Exp $ + * $DragonFly: src/sys/netproto/smb/smb_conn.c,v 1.20 2006/12/20 18:14:44 dillon Exp $ */ /* @@ -678,8 +678,8 @@ smb_vc_getinfo(struct smb_vc *vcp, struct smb_vc_info *vip) vip->sopt = vcp->vc_sopt; vip->iodstate = vcp->vc_iod->iod_state; bzero(&vip->sopt.sv_skey, sizeof(vip->sopt.sv_skey)); - snprintf(vip->srvname, sizeof(vip->srvname), "%s", vcp->vc_srvname); - snprintf(vip->vcname, sizeof(vip->vcname), "%s", vcp->vc_username); + ksnprintf(vip->srvname, sizeof(vip->srvname), "%s", vcp->vc_srvname); + ksnprintf(vip->vcname, sizeof(vip->vcname), "%s", vcp->vc_username); return 0; } @@ -855,7 +855,7 @@ smb_share_getinfo(struct smb_share *ssp, struct smb_share_info *sip) sip->gid = ssp->ss_grp; sip->mode= ssp->ss_mode; sip->flags = ssp->obj.co_flags; - snprintf(sip->sname, sizeof(sip->sname), "%s", ssp->ss_name); + ksnprintf(sip->sname, sizeof(sip->sname), "%s", ssp->ss_name); return 0; } diff --git a/sys/platform/pc32/i386/autoconf.c b/sys/platform/pc32/i386/autoconf.c index dd5d683b02..bd19274552 100644 --- a/sys/platform/pc32/i386/autoconf.c +++ b/sys/platform/pc32/i386/autoconf.c @@ -35,7 +35,7 @@ * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/autoconf.c,v 1.146.2.2 2001/06/07 06:05:58 dd Exp $ - * $DragonFly: src/sys/platform/pc32/i386/autoconf.c,v 1.32 2006/12/13 21:58:52 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/autoconf.c,v 1.33 2006/12/20 18:14:42 dillon Exp $ */ /* @@ -310,7 +310,7 @@ setroot(void) return; sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[0] = kmalloc(strlen(sname) + 6, M_DEVBUF, M_WAITOK); - sprintf(rootdevnames[0], "ufs:%s%s", sname, partname); + ksprintf(rootdevnames[0], "ufs:%s%s", sname, partname); /* * For properly dangerously dedicated disks (ones with a historical @@ -326,7 +326,7 @@ setroot(void) slice = COMPATIBILITY_SLICE; sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[1] = kmalloc(strlen(sname) + 6, M_DEVBUF, M_WAITOK); - sprintf(rootdevnames[1], "ufs:%s%s", sname, partname); + ksprintf(rootdevnames[1], "ufs:%s%s", sname, partname); } #endif diff --git a/sys/platform/pc32/i386/est.c b/sys/platform/pc32/i386/est.c index 0364841dec..f3876f340d 100644 --- a/sys/platform/pc32/i386/est.c +++ b/sys/platform/pc32/i386/est.c @@ -85,7 +85,7 @@ * ACPI objects: _PCT is MSR location, _PSS is freq/voltage, _PPC is caps. * * $NetBSD: est.c,v 1.24 2006/03/15 22:56:38 dogcow Exp $ - * $DragonFly: src/sys/platform/pc32/i386/est.c,v 1.2 2006/06/30 07:34:59 y0netan1 Exp $ + * $DragonFly: src/sys/platform/pc32/i386/est.c,v 1.3 2006/12/20 18:14:42 dillon Exp $ */ #include @@ -623,7 +623,7 @@ est_init(void) freqs_available[0] = '\0'; len = 0; for (i = 0; i < est_fqlist->tablec; i++) { - len += snprintf(freqs_available + len, freq_len - len, "%d%s", + len += ksnprintf(freqs_available + len, freq_len - len, "%d%s", est_fqlist->table[i].mhz, i < est_fqlist->tablec - 1 ? " " : ""); } diff --git a/sys/platform/pc32/i386/userconfig.c b/sys/platform/pc32/i386/userconfig.c index 7ff2b6a3a0..174f8efe3e 100644 --- a/sys/platform/pc32/i386/userconfig.c +++ b/sys/platform/pc32/i386/userconfig.c @@ -47,7 +47,7 @@ ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** ** $FreeBSD: src/sys/i386/i386/userconfig.c,v 1.175.2.10 2002/10/05 18:31:48 scottl Exp $ - ** $DragonFly: src/sys/platform/pc32/i386/userconfig.c,v 1.10 2006/11/07 06:43:24 dillon Exp $ + ** $DragonFly: src/sys/platform/pc32/i386/userconfig.c,v 1.11 2006/12/20 18:14:42 dillon Exp $ **/ /** @@ -1296,27 +1296,27 @@ drawline(int row, int detail, DEV_LIST *list, int inverse, char *dhelp) } if (list->comment == DEV_DEVICE) { - sprintf(db,"%s%d",list->dev,list->unit); + ksprintf(db,"%s%d",list->dev,list->unit); pad(db,8); }else{ strcpy(db," "); } if ((list->irq > 0) && detail && (list->comment == DEV_DEVICE)) { - sprintf(ib," %d",list->irq); + ksprintf(ib," %d",list->irq); pad(ib,4); }else{ strcpy(ib," "); } if ((list->iobase > 0) && detail && (list->comment == DEV_DEVICE)) { - sprintf(pb,"0x%x",list->iobase); + ksprintf(pb,"0x%x",list->iobase); pad(pb,7); }else{ strcpy(pb," "); } - sprintf(lbuf," %s%s%s%s%s",inverse?"!i":"",nb,db,ib,pb); + ksprintf(lbuf," %s%s%s%s%s",inverse?"!i":"",nb,db,ib,pb); putxyl(0,row,lbuf,80); if (dhelp) @@ -1385,7 +1385,7 @@ redrawactive(void) if (conflicts) { - sprintf(cbuf,"!i%d conflict%s-",conflicts,(conflicts>1)?"s":""); + ksprintf(cbuf,"!i%d conflict%s-",conflicts,(conflicts>1)?"s":""); putxy(45,0,cbuf); }else{ putxyl(45,0,lines,16); @@ -1487,31 +1487,31 @@ showparams(DEV_LIST *dev) if (dev->iobase > 0) { - sprintf(buf,"Port address : 0x%x",dev->iobase); + ksprintf(buf,"Port address : 0x%x",dev->iobase); putxy(1,18,buf); } if (dev->irq > 0) { - sprintf(buf,"IRQ number : %d",dev->irq); + ksprintf(buf,"IRQ number : %d",dev->irq); putxy(1,19,buf); } - sprintf(buf,"Flags : 0x%x",dev->flags); + ksprintf(buf,"Flags : 0x%x",dev->flags); putxy(1,20,buf); if (dev->maddr > 0) { - sprintf(buf,"Memory address : 0x%x",dev->maddr); + ksprintf(buf,"Memory address : 0x%x",dev->maddr); putxy(26,18,buf); } if (dev->msize > 0) { - sprintf(buf,"Memory size : 0x%x",dev->msize); + ksprintf(buf,"Memory size : 0x%x",dev->msize); putxy(26,19,buf); } if (dev->drq > 0) { - sprintf(buf,"DRQ number : %d",dev->drq); + ksprintf(buf,"DRQ number : %d",dev->drq); putxy(26,20,buf); } } @@ -1531,7 +1531,7 @@ showparams(DEV_LIST *dev) if ((i >= min) && (i <= max)) /* legit? */ \ { \ *val = i; \ - sprintf(buf,hex?"0x%x":"%d",i); \ + ksprintf(buf,hex?"0x%x":"%d",i); \ putxy(hex?x-2:x,y,buf); \ return(code); /* all done and exit */ \ } \ @@ -1566,8 +1566,8 @@ editval(int x, int y, int width, int hex, int min, int max, int *val, int ro) { if (delta) /* only update if necessary */ { - sprintf(tc,hex?"%x":"%d",i); /* make a text copy of the value */ - sprintf(buf,"!i%s",tc); /* format for printing */ + ksprintf(tc,hex?"%x":"%d",i); /* make a text copy of the value */ + ksprintf(buf,"!i%s",tc); /* format for printing */ erase(x,y,width,1); /* clear the area */ putxy(x,y,buf); /* write */ xp = strlen(tc); /* cursor always at end */ @@ -1734,7 +1734,7 @@ editparams(DEV_LIST *dev) char buf[16]; /* needs to fit the device name */ putxy(2,17,"!bParameters!n-!bfor!n-!bdevice!n-"); - sprintf(buf,"!b%s",dev->dev); + ksprintf(buf,"!b%s",dev->dev); putxy(24,17,buf); erase(1,22,80,1); @@ -1993,7 +1993,7 @@ helpscreen(void) } /* prompt */ - sprintf(prompt,"!i --%s-- [U]p [D]own [Q]uit !n",helptext[line] ? "MORE" : "END"); + ksprintf(prompt,"!i --%s-- [U]p [D]own [Q]uit !n",helptext[line] ? "MORE" : "END"); putxy(0,24,prompt); c = kgetchar(); /* so what do they say? */ @@ -3201,7 +3201,7 @@ lsdevtab(struct uc_device *dt) ); ++lineno; } - sprintf(dname, "%s%d", dt->id_name, dt->id_unit); + ksprintf(dname, "%s%d", dt->id_name, dt->id_unit); printf("%-9.9s%-#11x%-6d%-6d%-8p%-9d%-6d%-#11x%-5s\n", dname, /* dt->id_id, dt->id_driver(by name), */ dt->id_iobase, ffs(dt->id_irq) - 1, dt->id_drq, dt->id_maddr, dt->id_msize, diff --git a/sys/platform/pc32/isa/asc.c b/sys/platform/pc32/isa/asc.c index 84bfb4cbf7..b671d988d1 100644 --- a/sys/platform/pc32/isa/asc.c +++ b/sys/platform/pc32/isa/asc.c @@ -35,7 +35,7 @@ */ /* * $FreeBSD: src/sys/i386/isa/asc.c,v 1.42.2.2 2001/03/01 03:22:39 jlemon Exp $ - * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.15 2006/09/10 01:26:39 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.16 2006/12/20 18:14:42 dillon Exp $ */ #include "use_asc.h" @@ -668,7 +668,7 @@ static void pbm_init(struct asc_unit *scu) { int width = geomtab[scu->geometry].dpl; - int l= sprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height); + int l= ksprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height); char *p; scu->bcount = scu->height * width / 8 + l; diff --git a/sys/platform/pc32/isa/clock.c b/sys/platform/pc32/isa/clock.c index f0d53c1324..3ead7c1691 100644 --- a/sys/platform/pc32/isa/clock.c +++ b/sys/platform/pc32/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.48 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.49 2006/12/20 18:14:42 dillon Exp $ */ /* @@ -1180,7 +1180,7 @@ hw_i8254_timestamp(SYSCTL_HANDLER_ARGS) else tscval = 0; crit_exit(); - snprintf(buf, sizeof(buf), "%08x %016llx", count, (long long)tscval); + ksnprintf(buf, sizeof(buf), "%08x %016llx", count, (long long)tscval); return(SYSCTL_OUT(req, buf, strlen(buf) + 1)); } diff --git a/sys/platform/vkernel/i386/autoconf.c b/sys/platform/vkernel/i386/autoconf.c index e946d57072..ff7cb7505d 100644 --- a/sys/platform/vkernel/i386/autoconf.c +++ b/sys/platform/vkernel/i386/autoconf.c @@ -35,7 +35,7 @@ * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/autoconf.c,v 1.146.2.2 2001/06/07 06:05:58 dd Exp $ - * $DragonFly: src/sys/platform/vkernel/i386/autoconf.c,v 1.3 2006/12/13 21:58:52 dillon Exp $ + * $DragonFly: src/sys/platform/vkernel/i386/autoconf.c,v 1.4 2006/12/20 18:14:42 dillon Exp $ */ /* @@ -258,7 +258,7 @@ setroot(void) return; sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[0] = kmalloc(strlen(sname) + 6, M_DEVBUF, M_WAITOK); - sprintf(rootdevnames[0], "ufs:%s%s", sname, partname); + ksprintf(rootdevnames[0], "ufs:%s%s", sname, partname); /* * For properly dangerously dedicated disks (ones with a historical @@ -274,7 +274,7 @@ setroot(void) slice = COMPATIBILITY_SLICE; sname = dsname(newrootdev, unit, slice, part, partname); rootdevnames[1] = kmalloc(strlen(sname) + 6, M_DEVBUF, M_WAITOK); - sprintf(rootdevnames[1], "ufs:%s%s", sname, partname); + ksprintf(rootdevnames[1], "ufs:%s%s", sname, partname); } #endif diff --git a/sys/sys/systm.h b/sys/sys/systm.h index a762e59011..48f058d5cd 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -37,7 +37,7 @@ * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD: src/sys/sys/systm.h,v 1.111.2.18 2002/12/17 18:04:02 sam Exp $ - * $DragonFly: src/sys/sys/systm.h,v 1.51 2006/12/18 21:02:59 dillon Exp $ + * $DragonFly: src/sys/sys/systm.h,v 1.52 2006/12/20 18:14:44 dillon Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -151,9 +151,7 @@ void logwakeup (void); void log_console (struct uio *); int kprintf (const char *, ...) __printflike(1, 2); int printf (const char *, ...) __printflike(1, 2); -int snprintf (char *, size_t, const char *, ...) __printflike(3, 4); int ksnprintf (char *, size_t, const char *, ...) __printflike(3, 4); -int sprintf (char *buf, const char *, ...) __printflike(2, 3); int ksprintf (char *buf, const char *, ...) __printflike(2, 3); int uprintf (const char *, ...) __printflike(1, 2); int kvprintf (const char *, __va_list) __printflike(1, 0); diff --git a/sys/vfs/fdesc/fdesc_vnops.c b/sys/vfs/fdesc/fdesc_vnops.c index b5fbf39d46..5fa3567c1f 100644 --- a/sys/vfs/fdesc/fdesc_vnops.c +++ b/sys/vfs/fdesc/fdesc_vnops.c @@ -36,7 +36,7 @@ * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 * * $FreeBSD: src/sys/miscfs/fdesc/fdesc_vnops.c,v 1.47.2.1 2001/10/22 22:49:26 chris Exp $ - * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.34 2006/09/05 00:55:50 dillon Exp $ + * $DragonFly: src/sys/vfs/fdesc/fdesc_vnops.c,v 1.35 2006/12/20 18:14:44 dillon Exp $ */ /* @@ -462,7 +462,7 @@ fdesc_readdir(struct vop_readdir_args *ap) continue; } - namelen = snprintf(name, sizeof(name), "%d", fcnt); + namelen = ksnprintf(name, sizeof(name), "%d", fcnt); if (vop_write_dirent(&error, uio, FD_ROOT + i, DT_UNKNOWN, namelen, name)) goto done; diff --git a/sys/vfs/nfs/bootp_subr.c b/sys/vfs/nfs/bootp_subr.c index a26312f98c..3620ddf1a4 100644 --- a/sys/vfs/nfs/bootp_subr.c +++ b/sys/vfs/nfs/bootp_subr.c @@ -38,7 +38,7 @@ * nfs/krpc_subr.c * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ * $FreeBSD: src/sys/nfs/bootp_subr.c,v 1.20.2.9 2003/04/24 16:51:08 ambrisko Exp $ - * $DragonFly: src/sys/vfs/nfs/bootp_subr.c,v 1.20 2006/11/08 16:38:46 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/bootp_subr.c,v 1.21 2006/12/20 18:14:44 dillon Exp $ */ #include "opt_bootp.h" @@ -1201,7 +1201,7 @@ bootpc_compose_query(struct bootpc_ifcontext *ifctx, *vendp++ = (sizeof(struct bootp_packet) >> 8) & 255; *vendp++ = sizeof(struct bootp_packet) & 255; - snprintf(vendor_client, sizeof(vendor_client), "%s:%s:%s", + ksnprintf(vendor_client, sizeof(vendor_client), "%s:%s:%s", ostype, MACHINE, osrelease); vendor_client_len = strlen(vendor_client); *vendp++ = TAG_VENDOR_INDENTIFIER; @@ -1356,7 +1356,7 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, ifctx->myaddr.sin_addr = ifctx->reply.yiaddr; ip = ntohl(ifctx->myaddr.sin_addr.s_addr); - snprintf(gctx->lookup_path, sizeof(gctx->lookup_path), + ksnprintf(gctx->lookup_path, sizeof(gctx->lookup_path), "swap.%d.%d.%d.%d", ip >> 24, (ip >> 16) & 255, (ip >> 8) & 255, ip & 255); diff --git a/sys/vfs/nfs/nfs_vfsops.c b/sys/vfs/nfs/nfs_vfsops.c index c6712e0732..0d8741877f 100644 --- a/sys/vfs/nfs/nfs_vfsops.c +++ b/sys/vfs/nfs/nfs_vfsops.c @@ -35,7 +35,7 @@ * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 * $FreeBSD: src/sys/nfs/nfs_vfsops.c,v 1.91.2.7 2003/01/27 20:04:08 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.47 2006/09/19 16:06:14 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.48 2006/12/20 18:14:44 dillon Exp $ */ #include "opt_bootp.h" @@ -528,7 +528,7 @@ nfs_mountroot(struct mount *mp) nd->root_args.fh = nd->root_fh; nd->root_args.fhsize = nd->root_fhsize; l = ntohl(nd->root_saddr.sin_addr.s_addr); - snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s", + ksnprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s", (l >> 24) & 0xff, (l >> 16) & 0xff, (l >> 8) & 0xff, (l >> 0) & 0xff,nd->root_hostnam); printf("NFS ROOT: %s\n",buf); @@ -555,7 +555,7 @@ nfs_mountroot(struct mount *mp) nd->swap_args.fh = nd->swap_fh; nd->swap_args.fhsize = nd->swap_fhsize; l = ntohl(nd->swap_saddr.sin_addr.s_addr); - snprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s", + ksnprintf(buf, sizeof(buf), "%ld.%ld.%ld.%ld:%s", (l >> 24) & 0xff, (l >> 16) & 0xff, (l >> 8) & 0xff, (l >> 0) & 0xff,nd->swap_hostnam); printf("NFS SWAP: %s\n",buf); diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index e2187bd46d..fc0ec9f25b 100644 --- a/sys/vfs/nfs/nfs_vnops.c +++ b/sys/vfs/nfs/nfs_vnops.c @@ -35,7 +35,7 @@ * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 * $FreeBSD: src/sys/nfs/nfs_vnops.c,v 1.150.2.5 2001/12/20 19:56:28 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.67 2006/10/27 04:56:34 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.68 2006/12/20 18:14:44 dillon Exp $ */ @@ -2635,7 +2635,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) vref(dvp); /* Fudge together a funny name */ - sp->s_namlen = sprintf(sp->s_name, ".nfsA%08x4.4", (int)cnp->cn_td); + sp->s_namlen = ksprintf(sp->s_name, ".nfsA%08x4.4", (int)cnp->cn_td); /* Try lookitups until we get one that isn't there */ while (nfs_lookitup(dvp, sp->s_name, sp->s_namlen, sp->s_cred, diff --git a/sys/vfs/procfs/procfs_map.c b/sys/vfs/procfs/procfs_map.c index 9caa19921c..2e8907234d 100644 --- a/sys/vfs/procfs/procfs_map.c +++ b/sys/vfs/procfs/procfs_map.c @@ -37,7 +37,7 @@ * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 * * $FreeBSD: src/sys/miscfs/procfs/procfs_map.c,v 1.24.2.1 2001/08/04 13:12:24 rwatson Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_map.c,v 1.5 2006/09/11 20:25:01 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_map.c,v 1.6 2006/12/20 18:14:44 dillon Exp $ */ #include @@ -150,7 +150,7 @@ case OBJT_DEVICE: * format: * start, end, resident, private resident, cow, access, type. */ - snprintf(mebuffer, sizeof(mebuffer), + ksnprintf(mebuffer, sizeof(mebuffer), "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s\n", (u_long)entry->start, (u_long)entry->end, resident, privateresident, obj, diff --git a/sys/vfs/procfs/procfs_rlimit.c b/sys/vfs/procfs/procfs_rlimit.c index 36032b0808..17626e3f1b 100644 --- a/sys/vfs/procfs/procfs_rlimit.c +++ b/sys/vfs/procfs/procfs_rlimit.c @@ -37,7 +37,7 @@ * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94 * * $FreeBSD: src/sys/miscfs/procfs/procfs_rlimit.c,v 1.5 1999/12/08 08:59:37 phk Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_rlimit.c,v 1.5 2004/05/02 03:05:11 cpressey Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_rlimit.c,v 1.6 2006/12/20 18:14:44 dillon Exp $ */ /* @@ -78,7 +78,7 @@ procfs_dorlimit(struct proc *curp, struct proc *p, struct pfsnode *pfs, * Add the rlimit ident */ - ps += sprintf(ps, "%s ", rlimit_ident[i]); + ps += ksprintf(ps, "%s ", rlimit_ident[i]); /* * Replace RLIM_INFINITY with -1 in the string @@ -89,9 +89,9 @@ procfs_dorlimit(struct proc *curp, struct proc *p, struct pfsnode *pfs, */ if (p->p_rlimit[i].rlim_cur == RLIM_INFINITY) { - ps += sprintf(ps, "-1 "); + ps += ksprintf(ps, "-1 "); } else { - ps += sprintf(ps, "%llu ", + ps += ksprintf(ps, "%llu ", (unsigned long long)p->p_rlimit[i].rlim_cur); } @@ -100,9 +100,9 @@ procfs_dorlimit(struct proc *curp, struct proc *p, struct pfsnode *pfs, */ if (p->p_rlimit[i].rlim_max == RLIM_INFINITY) { - ps += sprintf(ps, "-1\n"); + ps += ksprintf(ps, "-1\n"); } else { - ps += sprintf(ps, "%llu\n", + ps += ksprintf(ps, "%llu\n", (unsigned long long)p->p_rlimit[i].rlim_max); } } diff --git a/sys/vfs/procfs/procfs_status.c b/sys/vfs/procfs/procfs_status.c index ca17d1910c..4b81175177 100644 --- a/sys/vfs/procfs/procfs_status.c +++ b/sys/vfs/procfs/procfs_status.c @@ -38,7 +38,7 @@ * * From: * $FreeBSD: src/sys/miscfs/procfs/procfs_status.c,v 1.20.2.4 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_status.c,v 1.11 2005/11/14 18:50:13 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_status.c,v 1.12 2006/12/20 18:14:44 dillon Exp $ */ #include @@ -92,41 +92,41 @@ procfs_dostatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, ps[MAXCOMLEN] = '\0'; ps += strlen(ps); DOCHECK(); - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, " %d %d %d %d ", pid, ppid, pgid, sid); DOCHECK(); if ((p->p_flag&P_CONTROLT) && (tp = sess->s_ttyp)) - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, "%d,%d ", major(tp->t_dev), minor(tp->t_dev)); else - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, "%d,%d ", -1, -1); DOCHECK(); sep = ""; if (sess->s_ttyvp) { - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, "%sctty", sep); + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, "%sctty", sep); sep = ","; DOCHECK(); } if (SESS_LEADER(p)) { - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, "%ssldr", sep); + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, "%ssldr", sep); sep = ","; DOCHECK(); } if (*sep != ',') { - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, "noflags"); + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, "noflags"); DOCHECK(); } if (p->p_flag & P_SWAPPEDOUT) { - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, " -1,-1 -1,-1 -1,-1"); } else { struct timeval ut, st; calcru(p, &ut, &st, (struct timeval *) NULL); - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, " %ld,%ld %ld,%ld %ld,%ld", p->p_start.tv_sec, p->p_start.tv_usec, @@ -135,13 +135,13 @@ procfs_dostatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, } DOCHECK(); - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " %s", + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, " %s", (p->p_wchan && p->p_wmesg) ? p->p_wmesg : "nochan"); DOCHECK(); cr = p->p_ucred; - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " %lu %lu %lu", + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, " %lu %lu %lu", (u_long)cr->cr_uid, (u_long)p->p_ucred->cr_ruid, (u_long)p->p_ucred->cr_rgid); @@ -151,18 +151,18 @@ procfs_dostatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, see also getegid(2) in /sys/kern/kern_prot.c */ for (i = 0; i < cr->cr_ngroups; i++) { - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, ",%lu", (u_long)cr->cr_groups[i]); DOCHECK(); } if (p->p_ucred->cr_prison) - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, " %s", p->p_ucred->cr_prison->pr_host); else - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " -"); + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, " -"); DOCHECK(); - ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, "\n"); + ps += ksnprintf(ps, psbuf + sizeof(psbuf) - ps, "\n"); DOCHECK(); xlen = ps - psbuf; diff --git a/sys/vfs/procfs/procfs_vnops.c b/sys/vfs/procfs/procfs_vnops.c index 2300c533ff..95f1343d81 100644 --- a/sys/vfs/procfs/procfs_vnops.c +++ b/sys/vfs/procfs/procfs_vnops.c @@ -37,7 +37,7 @@ * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * * $FreeBSD: src/sys/miscfs/procfs/procfs_vnops.c,v 1.76.2.7 2002/01/22 17:22:59 nectar Exp $ - * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.39 2006/11/07 20:48:15 dillon Exp $ + * $DragonFly: src/sys/vfs/procfs/procfs_vnops.c,v 1.40 2006/12/20 18:14:44 dillon Exp $ */ /* @@ -544,7 +544,7 @@ procfs_getattr(struct vop_getattr_args *ap) vap->va_uid = 0; vap->va_gid = 0; vap->va_size = vap->va_bytes = - snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); + ksnprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); break; } @@ -995,7 +995,7 @@ procfs_readdir_root_callback(struct proc *p, void *data) } d_ino = PROCFS_FILENO(p->p_pid, Pproc); - d_namlen = snprintf(d_name_pid, sizeof(d_name_pid), + d_namlen = ksnprintf(d_name_pid, sizeof(d_name_pid), "%ld", (long)p->p_pid); d_name = d_name_pid; d_type = DT_DIR; @@ -1037,7 +1037,7 @@ procfs_readlink(struct vop_readlink_args *ap) if (pfs->pfs_fileno != PROCFS_FILENO(0, Pcurproc)) return (EINVAL); - len = snprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); + len = ksnprintf(buf, sizeof(buf), "%ld", (long)curproc->p_pid); return (uiomove(buf, len, ap->a_uio)); /* diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index 9d4e048610..68bf4e4a5e 100644 --- a/sys/vm/vm_zone.c +++ b/sys/vm/vm_zone.c @@ -12,7 +12,7 @@ * John S. Dyson. * * $FreeBSD: src/sys/vm/vm_zone.c,v 1.30.2.6 2002/10/10 19:50:16 dillon Exp $ - * $DragonFly: src/sys/vm/vm_zone.c,v 1.21 2006/09/05 00:55:51 dillon Exp $ + * $DragonFly: src/sys/vm/vm_zone.c,v 1.22 2006/12/20 18:14:44 dillon Exp $ */ #include @@ -432,7 +432,7 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS) char tmpbuf[128]; char tmpname[14]; - snprintf(tmpbuf, sizeof(tmpbuf), + ksnprintf(tmpbuf, sizeof(tmpbuf), "\nITEM SIZE LIMIT USED FREE REQUESTS\n"); error = SYSCTL_OUT(req, tmpbuf, strlen(tmpbuf)); if (error) @@ -458,7 +458,7 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS) tmpbuf[0] = '\n'; } - snprintf(tmpbuf + offset, sizeof(tmpbuf) - offset, + ksnprintf(tmpbuf + offset, sizeof(tmpbuf) - offset, "%s %6.6u, %8.8u, %6.6u, %6.6u, %8.8u\n", tmpname, curzone->zsize, curzone->zmax, (curzone->ztotal - curzone->zfreecnt), -- 2.41.0