svn commit: r230449 - head/cddl/contrib/opensolaris/cmd/zfs

2012-01-22 Thread Martin Matuska
Author: mm
Date: Sun Jan 22 08:06:36 2012
New Revision: 230449
URL: http://svn.freebsd.org/changeset/base/230449

Log:
  Merge illumos revisions 13540, 13562:
  
  illumos rev 13540 [1]:
  Removal of pyzfs broke delegation for volumes
  
  illumos rev 13562 [2]:
  zfs allow arguments not parsed correctly after pyzfs removal
  
  References:
  https://www.illumos.org/issues/1726 [1]
  https://www.illumos.org/issues/1977 [2]
  
  Obtained from:illumos (issues #1726, #1977)
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==
--- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cSun Jan 22 06:00:50 
2012(r230448)
+++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.cSun Jan 22 08:06:36 
2012(r230449)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2011 by Delphix. All rights reserved.
  * Copyright (c) 2011-2012 Pawel Jakub Dawidek .
  * All rights reserved.
@@ -4501,7 +4501,7 @@ parse_allow_args(int argc, char **argv, 
argc--;
argv++;
opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
-   } else if (argc == 1) {
+   } else if (argc == 1 && !un) {
opts->prt_perms = B_TRUE;
opts->dataset = argv[argc-1];
} else {
@@ -4988,9 +4988,9 @@ zfs_do_allow_unallow_impl(int argc, char
parse_allow_args(argc, argv, un, &opts);
 
/* try to open the dataset */
-   if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM))
-   == NULL) {
-   (void) fprintf(stderr, "Failed to open Dataset *%s*\n",
+   if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM |
+   ZFS_TYPE_VOLUME)) == NULL) {
+   (void) fprintf(stderr, "Failed to open dataset: %s\n",
opts.dataset);
return (-1);
}
@@ -5000,7 +5000,7 @@ zfs_do_allow_unallow_impl(int argc, char
 
fs_perm_set_init(&fs_perm_set);
if (parse_fs_perm_set(&fs_perm_set, perm_nvl) != 0) {
-   (void) fprintf(stderr, "Failed to parse fsacl permissionsn");
+   (void) fprintf(stderr, "Failed to parse fsacl permissions\n");
goto cleanup1;
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230450 - head/share/man/man4

2012-01-22 Thread Christian Brueffer
Author: brueffer
Date: Sun Jan 22 10:16:24 2012
New Revision: 230450
URL: http://svn.freebsd.org/changeset/base/230450

Log:
  General cleanup.
  
  Prodded by:   grehan

Modified:
  head/share/man/man4/virtio.4
  head/share/man/man4/virtio_balloon.4
  head/share/man/man4/virtio_blk.4
  head/share/man/man4/vtnet.4

Modified: head/share/man/man4/virtio.4
==
--- head/share/man/man4/virtio.4Sun Jan 22 08:06:36 2012
(r230449)
+++ head/share/man/man4/virtio.4Sun Jan 22 10:16:24 2012
(r230450)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 4, 2011
+.Dd January 22, 2012
 .Dt VIRTIO 4
 .Os
 .Sh NAME
@@ -48,24 +48,25 @@ virtio_pci_load="YES"
 .Sh DESCRIPTION
 VirtIO is a specification for para-virtualized I/O in a virtual machine (VM).
 Traditionally, the hypervisor emulated real devices such as an Ethernet
-interface or disk controller to provide the VM with I/O. This emulation is
-often inefficient.
+interface or disk controller to provide the VM with I/O.
+This emulation is often inefficient.
 .Pp
 VirtIO defines an interface for efficient I/O between the hypervisor and VM.
-The 
-.Xr virtio 4 
+The
+.Xr virtio 4
 module provides a shared memory transport called a virtqueue.
 The
 .Xr virtio_pci 4
 device driver represents an emulated PCI device that the hypervisor makes
-available to the VM. This device provides the probing, configuration, and 
-interrupt notifications need to interact with the hypervisor.
+available to the VM.
+This device provides the probing, configuration, and 
+interrupt notifications needed to interact with the hypervisor.
 .Fx
 supports the following VirtIO devices:
 .Bl -hang -offset indent -width 
 .It Nm Ethernet
 An emulated Ethernet device is provided by the
-.Xr if_vtnet 4
+.Xr vtnet 4
 device driver.
 .It Nm Block
 An emulated disk controller is provided by the
@@ -78,9 +79,9 @@ provided by the
 device driver.
 .El
 .Sh SEE ALSO
-.Xr if_vtnet 4 ,
+.Xr virtio_balloon 4 ,
 .Xr virtio_blk 4 ,
-.Xr virtio_balloon 4
+.Xr vtnet 4
 .Sh HISTORY
 Support for VirtIO first appeared in
 .Fx 9.0 .

Modified: head/share/man/man4/virtio_balloon.4
==
--- head/share/man/man4/virtio_balloon.4Sun Jan 22 08:06:36 2012
(r230449)
+++ head/share/man/man4/virtio_balloon.4Sun Jan 22 10:16:24 2012
(r230450)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 4, 2011
+.Dd January 22, 2012
 .Dt VIRTIO_BALLOON 4
 .Os
 .Sh NAME
@@ -51,8 +51,8 @@ device driver provides support for VirtI
 .Pp
 The memory balloon allows the guest to, at the request of the
 hypervisor, return memory allocated to the hypervisor so it can
-be made available to other guests. The hypervisor can later
-signal the balloon to return the memory.
+be made available to other guests.
+The hypervisor can later signal the balloon to return the memory.
 .Sh SEE ALSO
 .Xr virtio 4
 .Sh HISTORY

Modified: head/share/man/man4/virtio_blk.4
==
--- head/share/man/man4/virtio_blk.4Sun Jan 22 08:06:36 2012
(r230449)
+++ head/share/man/man4/virtio_blk.4Sun Jan 22 10:16:24 2012
(r230450)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 4, 2011
+.Dd January 22, 2012
 .Dt VIRTIO_BLK 4
 .Os
 .Sh NAME
@@ -48,7 +48,6 @@ virtio_blk_load="YES"
 The
 .Nm
 device driver provides support for VirtIO block devices.
-.Pp
 .Sh LOADER TUNABLES
 Tunables can be set at the
 .Xr loader 8
@@ -57,7 +56,8 @@ prompt before booting the kernel or stor
 .Bl -tag -width "xx"
 .It Va hw.vtblk.no_ident
 This tunable disables retrieving the device identification string
-from the hypervisor. The default value is 0.
+from the hypervisor.
+The default value is 0.
 .El
 .Sh SEE ALSO
 .Xr virtio 4

Modified: head/share/man/man4/vtnet.4
==
--- head/share/man/man4/vtnet.4 Sun Jan 22 08:06:36 2012(r230449)
+++ head/share/man/man4/vtnet.4 Sun Jan 22 10:16:24 2012(r230450)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 4, 2011
+.Dd January 22, 2012
 .Dt VTNET 4
 .Os
 .Sh NAME
@@ -62,7 +62,6 @@ utility configures the adapter to receiv
 .Pp
 For more information on configuring this device, see
 .Xr ifconfig 8 .
-.El
 .Sh LOADER TUNABLES
 Tunables can be set at the
 .Xr loader 8
@@ -70,19 +69,21 @@ prompt before booting the kernel or stor
 .Xr loader.conf 5 .
 .Bl -tag -width "xx"
 .It Va hw.vtnet.csum_disable
-This tunable disables receive and send checksum offload. The default
-value is 0.
+This tunable disables receive and send checksum offload.
+The default value is 0.
 .It Va hw.vtnet.tso_disable
-This tunable disables TSO. The default value is 0.
+This tunable disables TSO.
+The default value is 0.
 .It Va hw.vtnet.lro_disable
-This tunable disables LRO. Th

svn commit: r230451 - head/sys/dev/sound/pci/hda

2012-01-22 Thread Alexander Motin
Author: mav
Date: Sun Jan 22 10:24:12 2012
New Revision: 230451
URL: http://svn.freebsd.org/changeset/base/230451

Log:
  Complete rewrite of the snd_hda(4) volume control.
  
  Previous code was relatively dumb. During CODEC probe it was tracing signals
  and statically binding amplifier controls to the OSS mixer controls. To set
  volume it just set all bound amplifier controls proportionally to mixer
  level, not looking on their hierarchy and amplification levels/offsets.
  
  New code is much smarter. It also traces signals during probe, but mostly
  to find out possible amplification control rages in dB for each specific
  signal. To set volume it retraces each affected signal again and sets
  amplifiers controls recursively to reach desired amplification level in dB.
  It would be nice to export values in dB to user, but unluckily our OSS mixer
  API is too simple for that.
  
  As result of this change:
   - cascaded amplifiers will work together to reach maximal precision.
  If some input has 0/+40dB preamplifier with 10dB step and -10/+10dB mixer
  with 1dB step after it, new code will use both to provide 0/+40dB control
  with 1dB step! We could even get -10/+50dB range there, but that is
  intentionally blocked for now.
   - different channels of multichannel associations on non-uniform CODECs
  such as VIA VT1708S will have the same volume, not looking that control
  ranges are different. It was not good when fronts were 12dB louder.
   - for multiplexed recording, when we can record from only one source at
  a time, we can now use recording amplifier controls to set different
  volume levels for different inputs if they have no own controls of they
  are less precise. If recording source change, amplifiers will be
  reconfigured.
  
  To improve out-of-the-box behavior, ignore default volume levels set by
  sound(4) and use own, more reasonable: +20dB for mics, -10dB for analog
  output volume and 0dB for the rest of controls. sound(4) defaults of 75%
  mean absolutely random things for different controls of different CODECs
  because of very different control ranges.
  Together with further planned automatic recording source selection this
  should allow users to get fine playback and recording without touching
  mixer first.
  Note that existing users should delete /var/db/mixer*-state and reboot
  or trigger CODEC reconfiguration to get new default values.
  
  MFC after:2 months
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/sound/pci/hda/hdaa.c
  head/sys/dev/sound/pci/hda/hdaa.h

Modified: head/sys/dev/sound/pci/hda/hdaa.c
==
--- head/sys/dev/sound/pci/hda/hdaa.c   Sun Jan 22 10:16:24 2012
(r230450)
+++ head/sys/dev/sound/pci/hda/hdaa.c   Sun Jan 22 10:24:12 2012
(r230451)
@@ -175,6 +175,8 @@ static const struct {
 };
 #define HDA_RATE_TAB_LEN (sizeof(hda_rate_tab) / sizeof(hda_rate_tab[0]))
 
+const static char *ossnames[] = SOUND_DEVICE_NAMES;
+
 /
  * Function prototypes
  /
@@ -193,7 +195,6 @@ static void hdaa_dump_pin_config(struct 
 static char *
 hdaa_audio_ctl_ossmixer_mask2allname(uint32_t mask, char *buf, size_t len)
 {
-   static char *ossname[] = SOUND_DEVICE_NAMES;
int i, first = 1;
 
bzero(buf, len);
@@ -201,7 +202,7 @@ hdaa_audio_ctl_ossmixer_mask2allname(uin
if (mask & (1 << i)) {
if (first == 0)
strlcat(buf, ", ", len);
-   strlcat(buf, ossname[i], len);
+   strlcat(buf, ossnames[i], len);
first = 0;
}
}
@@ -1774,11 +1775,11 @@ hdaa_audio_ctl_ossmixer_init(struct snd_
struct hdaa_pcm_devinfo *pdevinfo = mix_getdevinfo(m);
struct hdaa_devinfo *devinfo = pdevinfo->devinfo;
struct hdaa_widget *w, *cw;
-   struct hdaa_audio_ctl *ctl;
uint32_t mask, recmask;
-   int i, j, softpcmvol;
+   int i, j;
 
hdaa_lock(devinfo);
+   pdevinfo->mixer = m;
 
/* Make sure that in case of soft volume it won't stay muted. */
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
@@ -1786,11 +1787,10 @@ hdaa_audio_ctl_ossmixer_init(struct snd_
pdevinfo->right[i] = 100;
}
 
-   mask = 0;
-   recmask = 0;
-
-   /* Declate EAPD as ogain control. */
+   /* Declare volume controls assigned to this association. */
+   mask = pdevinfo->ossmask;
if (pdevinfo->playas >= 0) {
+   /* Declate EAPD as ogain control. */
for (i = devinfo->startnode; i < devinfo->endnode; i++) {
w = hdaa_widget_get(devinfo, i);
if (w == NULL || w->enable == 0)
@@ -1802,23 +1802,36 @@ hdaa_audio_ctl_ossmixe

svn commit: r230452 - in head/sys/netinet: . ipfw

2012-01-22 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Jan 22 10:41:58 2012
New Revision: 230452
URL: http://svn.freebsd.org/changeset/base/230452

Log:
  Make #error messages string-literals and remove punctuation.
  
  Reported by:  bde (for ip_divert)
  Reviewed by:  bde
  MFC after:3 days

Modified:
  head/sys/netinet/ip_divert.c
  head/sys/netinet/ip_gre.c
  head/sys/netinet/ipfw/ip_fw2.c

Modified: head/sys/netinet/ip_divert.c
==
--- head/sys/netinet/ip_divert.cSun Jan 22 10:24:12 2012
(r230451)
+++ head/sys/netinet/ip_divert.cSun Jan 22 10:41:58 2012
(r230452)
@@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet6.h"
 #include "opt_sctp.h"
 #ifndef INET
-#error "IPDIVERT requires INET."
+#error "IPDIVERT requires INET"
 #endif
 
 #include 

Modified: head/sys/netinet/ip_gre.c
==
--- head/sys/netinet/ip_gre.c   Sun Jan 22 10:24:12 2012(r230451)
+++ head/sys/netinet/ip_gre.c   Sun Jan 22 10:41:58 2012(r230452)
@@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #else
-#error ip_gre input without IP?
+#error "ip_gre requires INET"
 #endif
 
 #ifdef NETATALK

Modified: head/sys/netinet/ipfw/ip_fw2.c
==
--- head/sys/netinet/ipfw/ip_fw2.c  Sun Jan 22 10:24:12 2012
(r230451)
+++ head/sys/netinet/ipfw/ip_fw2.c  Sun Jan 22 10:41:58 2012
(r230452)
@@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_ipdivert.h"
 #include "opt_inet.h"
 #ifndef INET
-#error IPFIREWALL requires INET.
+#error "IPFIREWALL requires INET"
 #endif /* INET */
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230453 - in head/etc: . rc.d

2012-01-22 Thread Hiroki Sato
Author: hrs
Date: Sun Jan 22 10:57:32 2012
New Revision: 230453
URL: http://svn.freebsd.org/changeset/base/230453

Log:
  Fix several glitches in IPv6-related knobs:
  
  - ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for
backward compatibility.
  
  - Configurations in ipv6_prefix_IF should be recognized even if there is no
ifconfig_IF_ipv6.
  
  - DAD wait should be performed at once, not on a per-interface basis, if
possible.  This fixes an issue that a system with a lot of IPv6-capable
interfaces takes too long for booting.
  
  MFC after:1 week

Modified:
  head/etc/network.subr
  head/etc/rc.d/netif

Modified: head/etc/network.subr
==
--- head/etc/network.subr   Sun Jan 22 10:41:58 2012(r230452)
+++ head/etc/network.subr   Sun Jan 22 10:57:32 2012(r230453)
@@ -109,8 +109,10 @@ ifconfig_up()
# backward compatibility: $ipv6_enable
case $ipv6_enable in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
-   _ipv6_opts="${_ipv6_opts} accept_rtadv"
-   ;;
+   if ! checkyesno ipv6_gateway_enable; then
+   _ipv6_opts="${_ipv6_opts} accept_rtadv"
+   fi
+   ;;
esac
 
case $ipv6_cpe_wanif in
@@ -139,6 +141,14 @@ ifconfig_up()
_cfg=0
fi
 
+   # $ipv6_prefix_IF will be handled in
+   # ipv6_prefix_hostid_addr_common().
+   ifconfig_args=`get_if_var $1 ipv6_prefix_IF`
+   if [ -n "${ifconfig_args}" ]; then
+   ifconfig $1 inet6 -ifdisabled
+   _cfg=0
+   fi
+
# backward compatibility: $ipv6_ifconfig_IF
ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF`
if [ -n "${ifconfig_args}" ]; then
@@ -444,6 +454,12 @@ ipv6if()
return 0
fi
 
+   # True if $ipv6_prefix_IF is defined.
+   _tmpargs=`get_if_var $_if ipv6_prefix_IF`
+   if [ -n "${_tmpargs}" ]; then
+   return 0
+   fi
+
# backward compatibility: True if $ipv6_ifconfig_IF is defined.
_tmpargs=`get_if_var $_if ipv6_ifconfig_IF`
if [ -n "${_tmpargs}" ]; then
@@ -559,10 +575,6 @@ ipv6_up()
ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0
ipv6_accept_rtadv_up ${_if} && _ret=0
 
-   # wait for DAD
-   sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
-   sleep 1
-
return $_ret
 }
 

Modified: head/etc/rc.d/netif
==
--- head/etc/rc.d/netif Sun Jan 22 10:41:58 2012(r230452)
+++ head/etc/rc.d/netif Sun Jan 22 10:57:32 2012(r230453)
@@ -123,16 +123,26 @@ network_common()
_cooked_list="`list_net_interfaces`"
fi
 
+   _dadwait=
_fail=
_ok=
for ifn in ${_cooked_list}; do
if ${_func} ${ifn} $2; then
_ok="${_ok} ${ifn}"
+   if ipv6if ${ifn}; then
+   _dadwait=1
+   fi
else
_fail="${_fail} ${ifn}"
fi
done
 
+   # inet6 address configuration needs sleep for DAD.
+   if [ -n "${_dadwait}" ]; then
+   sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
+   sleep 1
+   fi
+
_str=
if [ -n "${_ok}" ]; then
case ${_func} in
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230454 - head/sys/cddl/compat/opensolaris/sys

2012-01-22 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Jan 22 10:58:17 2012
New Revision: 230454
URL: http://svn.freebsd.org/changeset/base/230454

Log:
  Use provided name when allocating ksid domain. It isn't really used on 
FreeBSD,
  but should fix a panic when pool is imported from another OS that is using 
this.
  
  MFC after:1 week

Modified:
  head/sys/cddl/compat/opensolaris/sys/sid.h

Modified: head/sys/cddl/compat/opensolaris/sys/sid.h
==
--- head/sys/cddl/compat/opensolaris/sys/sid.h  Sun Jan 22 10:57:32 2012
(r230453)
+++ head/sys/cddl/compat/opensolaris/sys/sid.h  Sun Jan 22 10:58:17 2012
(r230454)
@@ -30,7 +30,7 @@
 #define_OPENSOLARIS_SYS_SID_H_
 
 typedef struct ksiddomain {
-   charkd_name[16];/* Domain part of SID */
+   charkd_name[1]; /* Domain part of SID */
 } ksiddomain_t;
 typedef void   ksid_t;
 
@@ -39,8 +39,8 @@ ksid_lookupdomain(const char *domain)
 {
ksiddomain_t *kd;
 
-   kd = kmem_alloc(sizeof(*kd), KM_SLEEP);
-   strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name));
+   kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP);
+   strcpy(kd->kd_name, domain);
return (kd);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230455 - in head/sys: arm/arm kern

2012-01-22 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Jan 22 11:01:36 2012
New Revision: 230455
URL: http://svn.freebsd.org/changeset/base/230455

Log:
  TDF_* flags should be used with td_flags field and TDP_* flags should be used
  with td_pflags field. Correct two places where it was not the case.
  
  Discussed with:   kib
  MFC after:1 week

Modified:
  head/sys/arm/arm/machdep.c
  head/sys/kern/init_main.c

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Sun Jan 22 10:58:17 2012(r230454)
+++ head/sys/arm/arm/machdep.c  Sun Jan 22 11:01:36 2012(r230455)
@@ -137,7 +137,7 @@ sendsig(catcher, ksi, mask)
catcher, sig);
 
/* Allocate and validate space for the signal handler context. */
-   if ((td->td_flags & TDP_ALTSTACK) != 0 && !(onstack) &&
+   if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct sigframe *)(td->td_sigstk.ss_sp + 
td->td_sigstk.ss_size);

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Sun Jan 22 10:58:17 2012(r230454)
+++ head/sys/kern/init_main.c   Sun Jan 22 11:01:36 2012(r230455)
@@ -467,7 +467,8 @@ proc0_init(void *dummy __unused)
td->td_priority = PVM;
td->td_base_pri = PVM;
td->td_oncpu = 0;
-   td->td_flags = TDF_INMEM|TDP_KTHREAD;
+   td->td_flags = TDF_INMEM;
+   td->td_pflags = TDP_KTHREAD;
td->td_cpuset = cpuset_thread0();
prison0.pr_cpuset = cpuset_ref(td->td_cpuset);
p->p_peers = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230456 - head/lib/libc/sys

2012-01-22 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Jan 22 11:15:48 2012
New Revision: 230456
URL: http://svn.freebsd.org/changeset/base/230456

Log:
  The sys/uio.h header is needed only for readv(2), preadv(2), writev(2) and
  pwritev(2). Document it more precisely.
  
  Reviewed by:  jilles
  MFC after:3 days

Modified:
  head/lib/libc/sys/read.2
  head/lib/libc/sys/write.2

Modified: head/lib/libc/sys/read.2
==
--- head/lib/libc/sys/read.2Sun Jan 22 11:01:36 2012(r230455)
+++ head/lib/libc/sys/read.2Sun Jan 22 11:15:48 2012(r230456)
@@ -28,7 +28,7 @@
 .\" @(#)read.2 8.4 (Berkeley) 2/26/94
 .\" $FreeBSD$
 .\"
-.Dd October 11, 2006
+.Dd January 22, 2012
 .Dt READ 2
 .Os
 .Sh NAME
@@ -41,12 +41,12 @@
 .Lb libc
 .Sh SYNOPSIS
 .In sys/types.h
-.In sys/uio.h
 .In unistd.h
 .Ft ssize_t
 .Fn read "int d" "void *buf" "size_t nbytes"
 .Ft ssize_t
 .Fn pread "int d" "void *buf" "size_t nbytes" "off_t offset"
+.In sys/uio.h
 .Ft ssize_t
 .Fn readv "int d" "const struct iovec *iov" "int iovcnt"
 .Ft ssize_t

Modified: head/lib/libc/sys/write.2
==
--- head/lib/libc/sys/write.2   Sun Jan 22 11:01:36 2012(r230455)
+++ head/lib/libc/sys/write.2   Sun Jan 22 11:15:48 2012(r230456)
@@ -28,7 +28,7 @@
 .\" @(#)write.28.5 (Berkeley) 4/2/94
 .\" $FreeBSD$
 .\"
-.Dd July 7, 2005
+.Dd January 22, 2012
 .Dt WRITE 2
 .Os
 .Sh NAME
@@ -41,12 +41,12 @@
 .Lb libc
 .Sh SYNOPSIS
 .In sys/types.h
-.In sys/uio.h
 .In unistd.h
 .Ft ssize_t
 .Fn write "int d" "const void *buf" "size_t nbytes"
 .Ft ssize_t
 .Fn pwrite "int d" "const void *buf" "size_t nbytes" "off_t offset"
+.In sys/uio.h
 .Ft ssize_t
 .Fn writev "int d" "const struct iovec *iov" "int iovcnt"
 .Ft ssize_t
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230457 - head/sbin/hastd

2012-01-22 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Jan 22 11:20:42 2012
New Revision: 230457
URL: http://svn.freebsd.org/changeset/base/230457

Log:
  Free memory that won't be used in child.
  
  MFC after:1 week

Modified:
  head/sbin/hastd/hastd.c

Modified: head/sbin/hastd/hastd.c
==
--- head/sbin/hastd/hastd.c Sun Jan 22 11:15:48 2012(r230456)
+++ head/sbin/hastd/hastd.c Sun Jan 22 11:20:42 2012(r230457)
@@ -99,10 +99,10 @@ g_gate_load(void)
 void
 descriptors_cleanup(struct hast_resource *res)
 {
-   struct hast_resource *tres;
+   struct hast_resource *tres, *tmres;
struct hastd_listen *lst;
 
-   TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) {
+   TAILQ_FOREACH_SAFE(tres, &cfg->hc_resources, hr_next, tmres) {
if (tres == res) {
PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY ||
(res->hr_remotein == NULL &&
@@ -119,13 +119,17 @@ descriptors_cleanup(struct hast_resource
proto_close(tres->hr_event);
if (tres->hr_conn != NULL)
proto_close(tres->hr_conn);
+   TAILQ_REMOVE(&cfg->hc_resources, tres, hr_next);
+   free(tres);
}
if (cfg->hc_controlin != NULL)
proto_close(cfg->hc_controlin);
proto_close(cfg->hc_controlconn);
-   TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) {
+   while ((lst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) {
+   TAILQ_REMOVE(&cfg->hc_listen, lst, hl_next);
if (lst->hl_conn != NULL)
proto_close(lst->hl_conn);
+   free(lst);
}
(void)pidfile_close(pfh);
hook_fini();
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230458 - head/usr.bin/last

2012-01-22 Thread Hiroki Sato
Author: hrs
Date: Sun Jan 22 11:34:24 2012
New Revision: 230458
URL: http://svn.freebsd.org/changeset/base/230458

Log:
  - Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp.
  - A real filename is now shown in an output report when "-f file" is 
specified.
  - Add Xr lastlogin into last(1) manual page.
  
  Reviewed by:  ed
  MFC after:1 week

Modified:
  head/usr.bin/last/last.1
  head/usr.bin/last/last.c

Modified: head/usr.bin/last/last.1
==
--- head/usr.bin/last/last.1Sun Jan 22 11:20:42 2012(r230457)
+++ head/usr.bin/last/last.1Sun Jan 22 11:34:24 2012(r230458)
@@ -198,6 +198,7 @@ login data base
 .El
 .Sh SEE ALSO
 .Xr lastcomm 1 ,
+.Xr lastlogin 8 ,
 .Xr getutxent 3 ,
 .Xr ac 8
 .Sh HISTORY

Modified: head/usr.bin/last/last.c
==
--- head/usr.bin/last/last.cSun Jan 22 11:20:42 2012(r230457)
+++ head/usr.bin/last/last.cSun Jan 22 11:34:24 2012(r230458)
@@ -83,7 +83,7 @@ struct idtab {
 static const   char *crmsg;/* cause of last reboot */
 static time_t  currentout; /* current logout value */
 static longmaxrec; /* records to display */
-static const   char *file = NULL;  /* wtmp file */
+static const   char *file = NULL;  /* utx.log file */
 static int sflag = 0;  /* show delta in seconds */
 static int width = 5;  /* show seconds in delta */
 static int yflag;  /* show year */
@@ -194,7 +194,7 @@ main(int argc, char *argv[])
 
 /*
  * wtmp --
- * read through the wtmp file
+ * read through the utx.log file
  */
 static void
 wtmp(void)
@@ -229,13 +229,13 @@ wtmp(void)
doentry(&buf[--amount]);
 
tm = localtime(&t);
-   (void) strftime(ct, sizeof(ct), "\nwtmp begins %+\n", tm);
-   printf("%s", ct);
+   (void) strftime(ct, sizeof(ct), "%+", tm);
+   printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct);
 }
 
 /*
  * doentry --
- * process a single wtmp entry
+ * process a single utx.log entry
  */
 static void
 doentry(struct utmpx *bp)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230459 - head/sys/sys

2012-01-22 Thread Konstantin Belousov
Author: kib
Date: Sun Jan 22 11:35:50 2012
New Revision: 230459
URL: http://svn.freebsd.org/changeset/base/230459

Log:
  Fix typo.
  
  Submitted by: John Marino 
  MFC after:3 days

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Sun Jan 22 11:34:24 2012(r230458)
+++ head/sys/sys/elf_common.h   Sun Jan 22 11:35:50 2012(r230459)
@@ -384,7 +384,7 @@ typedef struct {
 #defineDT_INIT_ARRAYSZ 27  /* Size in bytes of the array of
   initialization functions. */
 #defineDT_FINI_ARRAYSZ 28  /* Size in bytes of the array of
-  terminationfunctions. */
+  termination functions. */
 #defineDT_RUNPATH  29  /* String table offset of a 
null-terminated
   library search path string. */
 #defineDT_FLAGS30  /* Object specific flag values. */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230460 - head/lib/libc/sys

2012-01-22 Thread Konstantin Belousov
Author: kib
Date: Sun Jan 22 11:58:17 2012
New Revision: 230460
URL: http://svn.freebsd.org/changeset/base/230460

Log:
  Clarify the implementation-defined behaviour in case of close(2)
  returning error.
  
  MFC after:1 week

Modified:
  head/lib/libc/sys/close.2

Modified: head/lib/libc/sys/close.2
==
--- head/lib/libc/sys/close.2   Sun Jan 22 11:35:50 2012(r230459)
+++ head/lib/libc/sys/close.2   Sun Jan 22 11:58:17 2012(r230460)
@@ -28,7 +28,7 @@
 .\" @(#)close.28.2 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd December 4, 2006
+.Dd January 22, 2012
 .Dt CLOSE 2
 .Os
 .Sh NAME
@@ -118,6 +118,10 @@ The underlying object did not fit, cache
 The underlying object was a stream socket that was shut down by the peer
 before all pending data was delivered.
 .El
+.Pp
+In case of any error except
+.Er EBADF ,
+the supplied file descriptor is deallocated and therefore is no longer valid.
 .Sh SEE ALSO
 .Xr accept 2 ,
 .Xr closefrom 2 ,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230252 - head/sys/fs/tmpfs

2012-01-22 Thread Mikolaj Golub

On Tue, 17 Jan 2012 19:10:31 +0200 Jaakko Heinonen wrote:

 JH> On 2012-01-17, Kevin Lo wrote:
 >>   Return EOPNOTSUPP since we only support update mounts for NFS export.
 >>   
 >> @@ -150,8 +150,12 @@ tmpfs_mount(struct mount *mp)
 >>  return (EINVAL);
 >>  
 >>  if (mp->mnt_flag & MNT_UPDATE) {
 >> +/*
 >> + * Only support update mounts for NFS export.
 >> + */
 >>  if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0))
 >>  return (0);
 >> +return (EOPNOTSUPP);
 >>  }

 JH> This doesn't look correct. As long as the option list includes the
 JH> "export" option, all options are accepted. An example:

 JH> # mount -u -o ro /mnt
 JH> mount: tmpfs : Operation not supported
 JH> # mount -u -o ro,export /mnt
 JH> #

There is no error but ro is still ignored, so this is only the issue with
reporting. Note, the code for nullfs (as an example) looks the same.

It could be fixed with vfs_filteropt(9), not sure if this is worth doing here
though.

-- 
Mikolaj Golub
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230252 - head/sys/fs/tmpfs

2012-01-22 Thread Jaakko Heinonen

Hi,

On 2012-01-22, Mikolaj Golub wrote:
>  JH> # mount -u -o ro /mnt
>  JH> mount: tmpfs : Operation not supported
>  JH> # mount -u -o ro,export /mnt
>  JH> #
> 
> There is no error but ro is still ignored, so this is only the issue with
> reporting. Note, the code for nullfs (as an example) looks the same.

This is not true. "ro" is not ignored:

# mount -t tmpfs
tmpfs on /mnt (tmpfs, local)
# mount -u -o ro /mnt
mount: tmpfs: Operation not supported
# mount -t tmpfs
tmpfs on /mnt (tmpfs, local)
# mount -u -o ro,export /mnt
# mount -t tmpfs
tmpfs on /mnt (tmpfs, local, read-only)

> It could be fixed with vfs_filteropt(9), not sure if this is worth doing here
> though.

The problem with vfs_filteropt(9) is that it will allow some additional
options (global_opts list in vfs_mount.c). However those options might
already work sufficiently with update mount. Here is a mostly untested
patch:

%%%
Index: sys/fs/tmpfs/tmpfs_vfsops.c
===
--- sys/fs/tmpfs/tmpfs_vfsops.c (revision 230328)
+++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy)
@@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = {
NULL
 };
 
+static const char *tmpfs_updateopts[] = {
+   "from", "export", NULL
+};
+
 /* - */
 
 static int
@@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp)
return (EINVAL);
 
if (mp->mnt_flag & MNT_UPDATE) {
-   /*
-* Only support update mounts for NFS export.
-*/
-   if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0))
-   return (0);
-   return (EOPNOTSUPP);
+   /* Only support update mounts for certain options. */
+   if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0)
+   return (EOPNOTSUPP);
+   return (0);
}
 
vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY);
%%%

-- 
Jaakko
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230461 - head/share/man/man4

2012-01-22 Thread Christian Brueffer
Author: brueffer
Date: Sun Jan 22 13:51:20 2012
New Revision: 230461
URL: http://svn.freebsd.org/changeset/base/230461

Log:
  Connect VirtIO-related manpages to the build.

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileSun Jan 22 11:58:17 2012
(r230460)
+++ head/share/man/man4/MakefileSun Jan 22 13:51:20 2012
(r230461)
@@ -505,11 +505,15 @@ MAN=  aac.4 \
viapm.4 \
${_viawd.4} \
vinum.4 \
+   ${_virtio.4} \
+   ${_virtio_balloon.4} \
+   ${_virtio_blk.4} \
vkbd.4 \
vlan.4 \
vpo.4 \
vr.4 \
vte.4 \
+   ${_vtnet.4} \
${_vxge.4} \
watchdog.4 \
wb.4 \
@@ -656,6 +660,7 @@ MLINKS+=vge.4 if_vge.4
 MLINKS+=vlan.4 if_vlan.4
 MLINKS+=vpo.4 imm.4
 MLINKS+=vr.4 if_vr.4
+MLINKS+=${_vtnet.4} ${_if_vtnet.4}
 MLINKS+=${_vxge.4} ${_if_vxge.4}
 MLINKS+=watchdog.4 SW_WATCHDOG.4
 MLINKS+=wb.4 if_wb.4
@@ -699,6 +704,7 @@ _if_nfe.4=  if_nfe.4
 _if_nve.4= if_nve.4
 _if_nxge.4=if_nxge.4
 _if_urtw.4=if_urtw.4
+_if_vtnet.4=   if_vtnet.4
 _if_vxge.4=if_vxge.4
 _if_wpi.4= if_wpi.4
 _ipmi.4=   ipmi.4
@@ -711,6 +717,10 @@ _nfsmb.4=  nfsmb.4
 _nve.4=nve.4
 _nvram.4=  nvram.4
 _nxge.4=   nxge.4
+_virtio.4= virtio.4
+_virtio_balloon.4=virtio_balloon.4
+_virtio_blk.4= virtio_blk.4
+_vtnet.4=  vtnet.4
 _vxge.4=   vxge.4
 _padlock.4=padlock.4
 _rr232x.4= rr232x.4
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230463 - in head: bin/sh tools/regression/bin/sh/builtins

2012-01-22 Thread Jilles Tjoelker
Author: jilles
Date: Sun Jan 22 14:00:33 2012
New Revision: 230463
URL: http://svn.freebsd.org/changeset/base/230463

Log:
  sh: Fix $? in the first command of a 'for'.
  
  In the first command of a 'for', $? should be the exit status of the last
  pipeline (command substitution in the word list or command before 'for'),
  not always 0.

Added:
  head/tools/regression/bin/sh/builtins/for2.0   (contents, props changed)
  head/tools/regression/bin/sh/builtins/for3.0   (contents, props changed)
Modified:
  head/bin/sh/eval.c

Modified: head/bin/sh/eval.c
==
--- head/bin/sh/eval.c  Sun Jan 22 13:55:15 2012(r230462)
+++ head/bin/sh/eval.c  Sun Jan 22 14:00:33 2012(r230463)
@@ -348,6 +348,7 @@ evalfor(union node *n, int flags)
union node *argp;
struct strlist *sp;
struct stackmark smark;
+   int status;
 
setstackmark(&smark);
arglist.lastp = &arglist.list;
@@ -357,11 +358,12 @@ evalfor(union node *n, int flags)
}
*arglist.lastp = NULL;
 
-   exitstatus = 0;
loopnest++;
+   status = 0;
for (sp = arglist.list ; sp ; sp = sp->next) {
setvar(n->nfor.var, sp->text, 0);
evaltree(n->nfor.body, flags);
+   status = exitstatus;
if (evalskip) {
if (evalskip == SKIPCONT && --skipcount <= 0) {
evalskip = 0;
@@ -374,6 +376,7 @@ evalfor(union node *n, int flags)
}
loopnest--;
popstackmark(&smark);
+   exitstatus = status;
 }
 
 

Added: head/tools/regression/bin/sh/builtins/for2.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/for2.0Sun Jan 22 14:00:33 
2012(r230463)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+r=x
+f() { return 42; }
+f
+for i in x; do
+   r=$?
+done
+[ "$r" = 42 ]

Added: head/tools/regression/bin/sh/builtins/for3.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/for3.0Sun Jan 22 14:00:33 
2012(r230463)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+r=x
+f() { return 42; }
+for i in x`f`; do
+   r=$?
+done
+[ "$r" = 42 ]
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230464 - head/share/man/man4

2012-01-22 Thread Stefan Farfeleder
Author: stefanf
Date: Sun Jan 22 14:04:42 2012
New Revision: 230464
URL: http://svn.freebsd.org/changeset/base/230464

Log:
  Document the values for hw.snd.default_auto.

Modified:
  head/share/man/man4/pcm.4

Modified: head/share/man/man4/pcm.4
==
--- head/share/man/man4/pcm.4   Sun Jan 22 14:00:33 2012(r230463)
+++ head/share/man/man4/pcm.4   Sun Jan 22 14:04:42 2012(r230464)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 31, 2011
+.Dd January 22, 2012
 .Dt SOUND 4
 .Os
 .Sh NAME
@@ -324,8 +324,17 @@ for Linux applications, and deny for eve
 Always allow PROT_EXEC page mappings.
 .El
 .It Va hw.snd.default_auto
-Enable to automatically assign default sound unit to the most recent
-attached device.
+Automatically assign the default sound unit.
+The following values are supported (default is 1):
+.Bl -tag -width 2n
+.It 0
+Do not assign the default sound unit automatically.
+.It 1
+Use the best available sound device based on playing and recording
+capabilities of the device.
+.It 2
+Use the most recently attached device.
+.El
 .It Va hw.snd.default_unit
 Default sound card for systems with multiple sound cards.
 When using
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230465 - head/sys/dev/sound/pci/hda

2012-01-22 Thread Alexander Motin
Author: mav
Date: Sun Jan 22 15:44:20 2012
New Revision: 230465
URL: http://svn.freebsd.org/changeset/base/230465

Log:
  Increase snd_hda(4) default maximal buffer size from 16K to 64K and
  maximal from 64K to 256K.
  
  We usually don't need 750 sound interrupts per second (1.3ms latency)
  when playing 192K/24/8 stream. 187 should be better. On usual 48K/16/2
  it is just enough for hw.snd.latency=9 at hw.snd.latency_profile=1 with
  23 and 6 interrupts per second.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/dev/sound/pci/hda/hdaa.c
  head/sys/dev/sound/pci/hda/hdac.c
  head/sys/dev/sound/pci/hda/hdac.h

Modified: head/sys/dev/sound/pci/hda/hdaa.c
==
--- head/sys/dev/sound/pci/hda/hdaa.c   Sun Jan 22 14:04:42 2012
(r230464)
+++ head/sys/dev/sound/pci/hda/hdaa.c   Sun Jan 22 15:44:20 2012
(r230465)
@@ -74,17 +74,6 @@ static const struct {
 #define HDAA_QUIRKS_TAB_LEN\
(sizeof(hdaa_quirks_tab) / sizeof(hdaa_quirks_tab[0]))
 
-#define HDA_BDL_MIN2
-#define HDA_BDL_MAX256
-#define HDA_BDL_DEFAULTHDA_BDL_MIN
-
-#define HDA_BLK_MINHDA_DMA_ALIGNMENT
-#define HDA_BLK_ALIGN  (~(HDA_BLK_MIN - 1))
-
-#define HDA_BUFSZ_MIN  4096
-#define HDA_BUFSZ_MAX  65536
-#define HDA_BUFSZ_DEFAULT  16384
-
 #define HDA_PARSE_MAXDEPTH 10
 
 MALLOC_DEFINE(M_HDAA, "hdaa", "HDA Audio");

Modified: head/sys/dev/sound/pci/hda/hdac.c
==
--- head/sys/dev/sound/pci/hda/hdac.c   Sun Jan 22 14:04:42 2012
(r230464)
+++ head/sys/dev/sound/pci/hda/hdac.c   Sun Jan 22 15:44:20 2012
(r230465)
@@ -70,17 +70,6 @@ static const struct {
 #define HDAC_QUIRKS_TAB_LEN\
(sizeof(hdac_quirks_tab) / sizeof(hdac_quirks_tab[0]))
 
-#define HDA_BDL_MIN2
-#define HDA_BDL_MAX256
-#define HDA_BDL_DEFAULTHDA_BDL_MIN
-
-#define HDA_BLK_MINHDA_DMA_ALIGNMENT
-#define HDA_BLK_ALIGN  (~(HDA_BLK_MIN - 1))
-
-#define HDA_BUFSZ_MIN  4096
-#define HDA_BUFSZ_MAX  65536
-#define HDA_BUFSZ_DEFAULT  16384
-
 MALLOC_DEFINE(M_HDAC, "hdac", "HDA Controller");
 
 static const struct {

Modified: head/sys/dev/sound/pci/hda/hdac.h
==
--- head/sys/dev/sound/pci/hda/hdac.h   Sun Jan 22 14:04:42 2012
(r230464)
+++ head/sys/dev/sound/pci/hda/hdac.h   Sun Jan 22 15:44:20 2012
(r230465)
@@ -521,6 +521,18 @@
  /
 
 #define HDA_DMA_ALIGNMENT  128
+
+#define HDA_BDL_MIN2
+#define HDA_BDL_MAX256
+#define HDA_BDL_DEFAULTHDA_BDL_MIN
+
+#define HDA_BLK_MINHDA_DMA_ALIGNMENT
+#define HDA_BLK_ALIGN  (~(HDA_BLK_MIN - 1))
+
+#define HDA_BUFSZ_MIN  (HDA_BDL_MIN * HDA_BLK_MIN)
+#define HDA_BUFSZ_MAX  262144
+#define HDA_BUFSZ_DEFAULT  65536
+
 #define HDA_GPIO_MAX   8
 
 #define HDA_DEV_MATCH(fl, v)   ((fl) == (v) || \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230252 - head/sys/fs/tmpfs

2012-01-22 Thread Kevin Lo
Jaakko Heinonen wrote:
> Hi,

Hi Jaakko,

> On 2012-01-22, Mikolaj Golub wrote:
> >  JH> # mount -u -o ro /mnt
> >  JH> mount: tmpfs : Operation not supported
> >  JH> # mount -u -o ro,export /mnt
> >  JH> #
> > 
> > There is no error but ro is still ignored, so this is only the issue with
> > reporting. Note, the code for nullfs (as an example) looks the same.
> 
> This is not true. "ro" is not ignored:
> 
> # mount -t tmpfs
> tmpfs on /mnt (tmpfs, local)
> # mount -u -o ro /mnt
> mount: tmpfs: Operation not supported
> # mount -t tmpfs
> tmpfs on /mnt (tmpfs, local)
> # mount -u -o ro,export /mnt
> # mount -t tmpfs
> tmpfs on /mnt (tmpfs, local, read-only)
> 
> > It could be fixed with vfs_filteropt(9), not sure if this is worth doing 
> > here
> > though.
> 
> The problem with vfs_filteropt(9) is that it will allow some additional
> options (global_opts list in vfs_mount.c). However those options might
> already work sufficiently with update mount. Here is a mostly untested
> patch:
> 
> %%%
> Index: sys/fs/tmpfs/tmpfs_vfsops.c
> ===
> --- sys/fs/tmpfs/tmpfs_vfsops.c   (revision 230328)
> +++ sys/fs/tmpfs/tmpfs_vfsops.c   (working copy)
> @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = {
>   NULL
>  };
>  
> +static const char *tmpfs_updateopts[] = {
> + "from", "export", NULL
> +};
> +
>  /* - */
>  
>  static int
> @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp)
>   return (EINVAL);
>  
>   if (mp->mnt_flag & MNT_UPDATE) {
> - /*
> -  * Only support update mounts for NFS export.
> -  */
> - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0))
> - return (0);
> - return (EOPNOTSUPP);
> + /* Only support update mounts for certain options. */
> + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0)
> + return (EOPNOTSUPP);
> + return (0);
>   }
>  
>   vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY);
> %%%

Sorry for the late reply since I'm still off work for holidays
(Chinese New Year). I'll report back in a few weeks. If you 
have a patch, please commit it, thanks a lot!

Kevin


___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230230 - head/sys/dev/random

2012-01-22 Thread Mark Murray
Andrey Chernov writes:
> > The usual way round this is with a flag. Set a static, volatile
> > flag, defaulting "off", and set it to "on" when the seeding has
> > happened. Then arc4random() can do the right thing, depending on
> > this flag.
>
> Ok, what about this version, is it right? libkern/arc4rand.c is not a
> module but always present in the kernel, so "arc4rand_iniseed_state"
> will be always accessible.
>
> --- dev/random/randomdev_soft.c.old   2011-09-26 07:35:48.0 +0400
> +++ dev/random/randomdev_soft.c   2012-01-21 01:41:37.0 +0400
> @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD: src/sys/dev/random/r
>  
>  #define RANDOM_FIFO_MAX  256 /* How many events to queue up */
>  
> +extern int arc4rand_iniseed_state;
> +

Should be in a header file, nad _possibly_ should be volatile. If it
works without being volatile, then OK.

The rest is OK. I've not tested it, so this is not a review, simply an
"OK" :-)

M
--
Mark R V Murray
Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open)
Pi: 132511160

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230252 - head/sys/fs/tmpfs

2012-01-22 Thread Mikolaj Golub

On Sun, 22 Jan 2012 15:42:18 +0200 Jaakko Heinonen wrote:

 JH> Hi,

 JH> On 2012-01-22, Mikolaj Golub wrote:
 >>  JH> # mount -u -o ro /mnt
 >>  JH> mount: tmpfs : Operation not supported
 >>  JH> # mount -u -o ro,export /mnt
 >>  JH> #
 >> 
 >> There is no error but ro is still ignored, so this is only the issue with
 >> reporting. Note, the code for nullfs (as an example) looks the same.

 JH> This is not true. "ro" is not ignored:

 JH> # mount -t tmpfs
 JH> tmpfs on /mnt (tmpfs, local)
 JH> # mount -u -o ro /mnt
 JH> mount: tmpfs: Operation not supported
 JH> # mount -t tmpfs
 JH> tmpfs on /mnt (tmpfs, local)
 JH> # mount -u -o ro,export /mnt
 JH> # mount -t tmpfs
 JH> tmpfs on /mnt (tmpfs, local, read-only)

Sorry, yes I was wrong. vfs_domount_update() stores old MNT flags and applies
new ones, then calls VFS_MOUNT(), and if it only fails it will restore the old
flags.

So nullfs has the same issue now although the bug is more difficult to expose
as nullfs uses its own mount_nullfs, which currently does not support update
option. Thus to trigger the bug someone has to use nmount(2).

 >> It could be fixed with vfs_filteropt(9), not sure if this is worth doing 
 >> here
 >> though.

 JH> The problem with vfs_filteropt(9) is that it will allow some additional
 JH> options (global_opts list in vfs_mount.c). However those options might
 JH> already work sufficiently with update mount. Here is a mostly untested
 JH> patch:

When I was looking at mount option interface it also looked for me a bit
"complicated" :-), that is why I hoped we could just ignore the issue if it
were just reporting an error...

Also, may be we should allow remounting ro (and may be some othe options) for
tmpfs?

 JH> %%%
 JH> Index: sys/fs/tmpfs/tmpfs_vfsops.c
 JH> ===
 JH> --- sys/fs/tmpfs/tmpfs_vfsops.c(revision 230328)
 JH> +++ sys/fs/tmpfs/tmpfs_vfsops.c(working copy)
 JH> @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = {
 JH>  NULL
 JH>  };
 JH>  
 JH> +static const char *tmpfs_updateopts[] = {
 JH> +"from", "export", NULL
 JH> +};
 JH> +
 JH>  /* - 
*/
 JH>  
 JH>  static int
 JH> @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp)
 JH>  return (EINVAL);
 JH>  
 JH>  if (mp->mnt_flag & MNT_UPDATE) {
 JH> -/*
 JH> - * Only support update mounts for NFS export.
 JH> - */
 JH> -if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0))
 JH> -return (0);
 JH> -return (EOPNOTSUPP);
 JH> +/* Only support update mounts for certain options. */
 JH> +if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0)
 JH> +return (EOPNOTSUPP);
 JH> +return (0);
 JH>  }
 JH>  
 JH>  vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY);
 JH> %%%

 JH> -- 
 JH> Jaakko

-- 
Mikolaj Golub
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230230 - head/sys/dev/random

2012-01-22 Thread Andrey Chernov
On Sun, Jan 22, 2012 at 04:59:55PM +, Mark Murray wrote:
> Andrey Chernov writes:
> > > The usual way round this is with a flag. Set a static, volatile
> > > flag, defaulting "off", and set it to "on" when the seeding has
> > > happened. Then arc4random() can do the right thing, depending on
> > > this flag.
> >
> > Ok, what about this version, is it right? libkern/arc4rand.c is not a
> > module but always present in the kernel, so "arc4rand_iniseed_state"
> > will be always accessible.
> >
> > --- dev/random/randomdev_soft.c.old 2011-09-26 07:35:48.0 +0400
> > +++ dev/random/randomdev_soft.c 2012-01-21 01:41:37.0 +0400
> > @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD: src/sys/dev/random/r
> >  
> >  #define RANDOM_FIFO_MAX256 /* How many events to queue up */
> >  
> > +extern int arc4rand_iniseed_state;
> > +
> 
> Should be in a header file, nad _possibly_ should be volatile. If it
> works without being volatile, then OK.

It was preliminary patch just to confirm/deny my understanding of your 
idea.

I'll put it into header.
In the final version I also plan to move that lines
+   if (arc4rand_iniseed_state == 1)
+   arc4rand_iniseed_state = -1;
into arc4_randomstir() where they will be protected with mutex lock, so 
volatile will be not needed. It will be more logical, because other 
reseeding conditions are resetted there too.

> The rest is OK. I've not tested it, so this is not a review, simply an
> "OK" :-)

Thanx for review! I'll send final version to this thread a bit 
later when I'll find more free time.

-- 
http://ache.vniz.net/
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r230470 - in head/sys: kern sys

2012-01-22 Thread Mikolaj Golub
Author: trociny
Date: Sun Jan 22 20:25:00 2012
New Revision: 230470
URL: http://svn.freebsd.org/changeset/base/230470

Log:
  Change kern.proc.rlimit sysctl to:
  
  - retrive only one, specified limit for a process, not the whole
array, as it was previously (the sysctl has been added recently and
has not been backported to stable yet, so this change is ok);
  
  - allow to set a resource limit for another process.
  
  Submitted by: Andrey Zonov 
  Discussed with:   kib
  Reviewed by:  kib
  MFC after:2 weeks

Modified:
  head/sys/kern/kern_proc.c
  head/sys/kern/kern_resource.c
  head/sys/sys/resourcevar.h

Modified: head/sys/kern/kern_proc.c
==
--- head/sys/kern/kern_proc.c   Sun Jan 22 19:49:43 2012(r230469)
+++ head/sys/kern/kern_proc.c   Sun Jan 22 20:25:00 2012(r230470)
@@ -2372,7 +2372,7 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A
 }
 
 /*
- * This sysctl allows a process to retrieve the resource limits for
+ * This sysctl allows a process to retrieve or/and set the resource limit for
  * another process.
  */
 static int
@@ -2380,30 +2380,53 @@ sysctl_kern_proc_rlimit(SYSCTL_HANDLER_A
 {
int *name = (int *)arg1;
u_int namelen = arg2;
-   struct plimit *limp;
+   struct rlimit rlim;
struct proc *p;
-   int error = 0;
+   u_int which;
+   int flags, error;
 
-   if (namelen != 1)
+   if (namelen != 2)
+   return (EINVAL);
+
+   which = (u_int)name[1];
+   if (which >= RLIM_NLIMITS)
return (EINVAL);
 
-   error = pget((pid_t)name[0], PGET_CANSEE, &p);
+   if (req->newptr != NULL && req->newlen != sizeof(rlim))
+   return (EINVAL);
+
+   flags = PGET_HOLD | PGET_NOTWEXIT;
+   if (req->newptr != NULL)
+   flags |= PGET_CANDEBUG;
+   else
+   flags |= PGET_CANSEE;
+   error = pget((pid_t)name[0], flags, &p);
if (error != 0)
return (error);
+
/*
-* Check the request size.  We alow sizes smaller rlimit array for
-* backward binary compatibility: the number of resource limits may
-* grow.
+* Retrieve limit.
 */
-   if (sizeof(limp->pl_rlimit) < req->oldlen) {
+   if (req->oldptr != NULL) {
+   PROC_LOCK(p);
+   lim_rlimit(p, which, &rlim);
PROC_UNLOCK(p);
-   return (EINVAL);
}
+   error = SYSCTL_OUT(req, &rlim, sizeof(rlim));
+   if (error != 0)
+   goto errout;
 
-   limp = lim_hold(p->p_limit);
-   PROC_UNLOCK(p);
-   error = SYSCTL_OUT(req, limp->pl_rlimit, req->oldlen);
-   lim_free(limp);
+   /*
+* Set limit.
+*/
+   if (req->newptr != NULL) {
+   error = SYSCTL_IN(req, &rlim, sizeof(rlim));
+   if (error == 0)
+   error = kern_proc_setrlimit(curthread, p, which, &rlim);
+   }
+
+errout:
+   PRELE(p);
return (error);
 }
 
@@ -2544,8 +2567,9 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC
 static SYSCTL_NODE(_kern_proc, KERN_PROC_GROUPS, groups, CTLFLAG_RD |
CTLFLAG_MPSAFE, sysctl_kern_proc_groups, "Process groups");
 
-static SYSCTL_NODE(_kern_proc, KERN_PROC_RLIMIT, rlimit, CTLFLAG_RD |
-   CTLFLAG_MPSAFE, sysctl_kern_proc_rlimit, "Process resource limits");
+static SYSCTL_NODE(_kern_proc, KERN_PROC_RLIMIT, rlimit, CTLFLAG_RW |
+   CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_rlimit,
+   "Process resource limits");
 
 static SYSCTL_NODE(_kern_proc, KERN_PROC_PS_STRINGS, ps_strings,
CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE,

Modified: head/sys/kern/kern_resource.c
==
--- head/sys/kern/kern_resource.c   Sun Jan 22 19:49:43 2012
(r230469)
+++ head/sys/kern/kern_resource.c   Sun Jan 22 20:25:00 2012
(r230470)
@@ -649,13 +649,17 @@ lim_cb(void *arg)
 }
 
 int
-kern_setrlimit(td, which, limp)
-   struct thread *td;
-   u_int which;
-   struct rlimit *limp;
+kern_setrlimit(struct thread *td, u_int which, struct rlimit *limp)
+{
+
+   return (kern_proc_setrlimit(td, td->td_proc, which, limp));
+}
+
+int
+kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which,
+struct rlimit *limp)
 {
struct plimit *newlim, *oldlim;
-   struct proc *p;
register struct rlimit *alimp;
struct rlimit oldssiz;
int error;
@@ -672,7 +676,6 @@ kern_setrlimit(td, which, limp)
limp->rlim_max = RLIM_INFINITY;
 
oldssiz.rlim_cur = 0;
-   p = td->td_proc;
newlim = lim_alloc();
PROC_LOCK(p);
oldlim = p->p_limit;

Modified: head/sys/sys/resourcevar.h
==
--- head/sys/sys/resourcevar.h  Sun Jan 22 19:49:43 2012

svn commit: r230471 - head/usr.bin/procstat

2012-01-22 Thread Mikolaj Golub
Author: trociny
Date: Sun Jan 22 20:26:46 2012
New Revision: 230471
URL: http://svn.freebsd.org/changeset/base/230471

Log:
  Make procstat -l to work with the new version of kern.proc.rlimit.
  
  Submitted by: Andrey Zonov 
  MFC after:2 weeks

Modified:
  head/usr.bin/procstat/procstat_rlimit.c

Modified: head/usr.bin/procstat/procstat_rlimit.c
==
--- head/usr.bin/procstat/procstat_rlimit.c Sun Jan 22 20:25:00 2012
(r230470)
+++ head/usr.bin/procstat/procstat_rlimit.c Sun Jan 22 20:26:46 2012
(r230471)
@@ -90,27 +90,28 @@ const char *humanize_rlimit(int indx, rl
 void
 procstat_rlimit(struct kinfo_proc *kipp)
 {
-   int error, i, name[4];
+   int error, i, name[5];
size_t len;
 
if (!hflag) {
printf("%5s %-16s %-16s %16s %16s\n",
"PID", "COMM", "RLIMIT", "SOFT ", "HARD ");
}
+   len = sizeof(struct rlimit);
name[0] = CTL_KERN;
name[1] = KERN_PROC;
name[2] = KERN_PROC_RLIMIT;
name[3] = kipp->ki_pid;
-   len = sizeof(rlimit);
-   error = sysctl(name, 4, rlimit, &len, NULL, 0);
-   if (error < 0 && errno != ESRCH) {
-   warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid);
-   return;
-   }
-   if (error < 0 || len != sizeof(rlimit))
-   return;
-
for (i = 0; i < RLIM_NLIMITS; i++) {
+   name[4] = i;
+   error = sysctl(name, 5, &rlimit[i], &len, NULL, 0);
+   if (error < 0 && errno != ESRCH) {
+   warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid);
+   return;
+   }
+   if (error < 0 || len != sizeof(struct rlimit))
+   return;
+
printf("%5d %-16s %-16s ", kipp->ki_pid, kipp->ki_comm,
rlimit_param[i].name);
printf("%16s ", humanize_rlimit(i, rlimit[i].rlim_cur));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230470 - in head/sys: kern sys

2012-01-22 Thread Mikolaj Golub

On Sun, 22 Jan 2012 20:25:00 + (UTC) Mikolaj Golub wrote:

 MG> Author: trociny
 MG> Date: Sun Jan 22 20:25:00 2012
 MG> New Revision: 230470
 MG> URL: http://svn.freebsd.org/changeset/base/230470

 MG> Log:
 MG>   Change kern.proc.rlimit sysctl to:
 MG>   
 MG>   - retrive only one, specified limit for a process, not the whole
 MG> array, as it was previously (the sysctl has been added recently and
 MG> has not been backported to stable yet, so this change is ok);
 MG>   
 MG>   - allow to set a resource limit for another process.
 MG>   
 MG>   Submitted by:Andrey Zonov 
 MG>   Discussed with:kib
 MG>   Reviewed by:kib
 MG>   MFC after:2 weeks

Andrey has also been working on the patch for limits(1), which allows
to view/set limits for another process:

- If '-P ' without the list of limits is specified it returns the
limits for this process.

- If '-P ' with the list of limits is specified it changes these
limits for the process.

- If '-P ' with list of limits is specified but also -a option is
present it outputs all limits for the process updated by the command
line setting. So if one want, for example, to set for a current shell
all limits as they are for a process , but core dump is disabled,
it could run:

eval `limits -P  -aBec 0`

The latest version of the patch is attached. I am going to commit it
if there are no objections or suggestions.

-- 
Mikolaj Golub

Index: usr.bin/limits/limits.1
===
--- usr.bin/limits/limits.1	(revision 230394)
+++ usr.bin/limits/limits.1	(working copy)
@@ -19,7 +19,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 10, 2011
+.Dd January 18, 2011
 .Dt LIMITS 1
 .Os
 .Sh NAME
@@ -28,11 +28,13 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl C Ar class | Fl U Ar user
+.Op Fl P Ar pid
 .Op Fl SHB
 .Op Fl ea
 .Op Fl bcdflmnstuvpw Op Ar val
 .Nm
 .Op Fl C Ar class | Fl U Ar user
+.Op Fl P Ar pid
 .Op Fl SHB
 .Op Fl bcdflmnstuvpw Op Ar val
 .Op Fl E
@@ -143,6 +145,9 @@ for the
 class are used, if it exists, or the
 .Dq Li root
 class if the user is a superuser account.
+.It Fl P Ar pid
+Select or set limits for the process identified by the
+.Ar pid .
 .It Fl S
 Select display or setting of
 .Dq soft
Index: usr.bin/limits/limits.c
===
--- usr.bin/limits/limits.c	(revision 230394)
+++ usr.bin/limits/limits.c	(working copy)
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -249,6 +250,8 @@ static void usage(void);
 static int getshelltype(void);
 static void print_limit(rlim_t limit, unsigned divisor, const char *inf,
 			const char *pfx, const char *sfx, const char *which);
+static void getrlimit_proc(pid_t pid, int resource, struct rlimit *rlp);
+static void setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp);
 extern char **environ;
 
 static const char rcs_string[] = RCS_STRING;
@@ -262,24 +265,24 @@ main(int argc, char *argv[])
 int rcswhich, shelltype;
 int i, num_limits = 0;
 int ch, doeval = 0, doall = 0;
-int rtrn;
+int rtrn, setproc;
 login_cap_t * lc = NULL;
 enum { ANY=0, SOFT=1, HARD=2, BOTH=3, DISPLAYONLY=4 } type = ANY;
 enum { RCSUNKNOWN=0, RCSSET=1, RCSSEL=2 } todo = RCSUNKNOWN;
 int which_limits[RLIM_NLIMITS];
 rlim_t set_limits[RLIM_NLIMITS];
 struct rlimit limits[RLIM_NLIMITS];
+pid_t pid;
 
 /* init resource tables */
 for (i = 0; i < RLIM_NLIMITS; i++) {
 	which_limits[i] = 0; /* Don't set/display any */
 	set_limits[i] = RLIM_INFINITY;
-	/* Get current resource values */
-	getrlimit(i, &limits[i]);
 }
 
+pid = -1;
 optarg = NULL;
-while ((ch = getopt(argc, argv, ":EeC:U:BSHab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) {
+while ((ch = getopt(argc, argv, ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) {
 	switch(ch) {
 	case 'a':
 	doall = 1;
@@ -312,6 +315,12 @@ main(int argc, char *argv[])
 	case 'B':
 	type = SOFT|HARD;
 	break;
+	case 'P':
+	if (!isdigit(*optarg) || (pid = atoi(optarg)) < 0) {
+		warnx("invalid pid `%s'", optarg);
+		usage();
+	}
+	break;
 	default:
 	case ':': /* Without arg */
 	if ((p = strchr(rcs_string, optopt)) != NULL) {
@@ -335,6 +344,30 @@ main(int argc, char *argv[])
 	optarg = NULL;
 }
 
+if (pid != -1) {
+	if (cls != NULL) {
+	warnx("-C cannot be used with -P option");
+	usage();
+	}
+	if (pwd != NULL) {
+	warnx("-U cannot be used with -P option");
+	usage();
+	}
+}
+
+/* Get current resource values */
+setproc = 0;
+for (i = 0; i < RLIM_NLIMITS; i++) {
+	if (pid == -1) {
+	getrlimit(i, &limits[i]);
+	} else if (doall || num_limits == 0) {
+	getrlimit_proc(pid, i, &limits[i]);
+	} else if (which_limits[i] != 0) {
+	getrlimit_proc(pid, i, &limits[i]);
+	setproc = 1;
+	}
+}
+
 /* If user was specified, get class from that */
 if (pwd !=

Where to unsubscribe

2012-01-22 Thread Steve Laurie
Hi,
I keep receiving emails from here and I don't want them. 

I've tried the 'unsubscribe' link at the bottom of the email several times but 
I just get an email back telling me I'm not subscribed to this list, yet the 
emails keep coming. 

Can someone please help?

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230230 - head/sys/dev/random

2012-01-22 Thread Mark Murray
Andrey Chernov writes:
> > Should be in a header file, nad _possibly_ should be volatile. If it
> > works without being volatile, then OK.
> 
> It was preliminary patch just to confirm/deny my understanding of your 
> idea.

Ah, OK - in which case you got the idea correctly!

> I'll put it into header.

Cool.

> In the final version I also plan to move that lines
> +   if (arc4rand_iniseed_state == 1)
> +   arc4rand_iniseed_state = -1;
> into arc4_randomstir() where they will be protected with mutex lock, so 
> volatile will be not needed. It will be more logical, because other 
> reseeding conditions are resetted there too.

Great.

> > The rest is OK. I've not tested it, so this is not a review, simply an
> > "OK" :-)
> 
> Thanx for review! I'll send final version to this thread a bit 
> later when I'll find more free time.

No problem.

M
--
Mark R V Murray
Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open)
Pi: 132511160

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r230354 - head/usr.sbin/makefs

2012-01-22 Thread Hiroki Sato
Eitan Adler  wrote
  in :

ea> I was was unaware this code was contributed. I just looked at the
ea> NetBSD version and I don't think it suffers from the same problem -
ea> the loop appears to be used later. If that is because of some other

 Just checking, but the variables dot and semi are not used even in
 the NetBSD version since the initial import (in the NetBSD tree).
 What is "the same problem" you mentioned here?  The problem I pointed
 out is just "removing the useless loop would be good but leaving the
 related comments is bad"...

ea> bug fix which could be upstreamed that would be great. On the other
ea> hand I would like to continue with my goal of making the non-contrib
ea> world compilable with CC=gcc46.
ea>
ea> Should I revert this commit?

 I don't think it is needed.  The makefs utility is a special case
 because it will probably diverge from the upstream to support
 FreeBSD-specific feature in the future (this is one of the reasons
 why it is not in contrib/).  It didn't happen so far, however.

 By the way, does gcc46 no longer allow unused code?  Generally
 speaking, I think it is enough to clean up unused code only when we
 actually change the code.

-- Hiroki


pgpj1b19w79Ov.pgp
Description: PGP signature


svn commit: r230475 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include

2012-01-22 Thread David Schultz
Author: das
Date: Mon Jan 23 06:36:41 2012
New Revision: 230475
URL: http://svn.freebsd.org/changeset/base/230475

Log:
  Add C11 macros describing subnormal numbers to float.h.
  
  Reviewed by:  bde

Modified:
  head/sys/amd64/include/float.h
  head/sys/arm/include/float.h
  head/sys/i386/include/float.h
  head/sys/ia64/include/float.h
  head/sys/mips/include/float.h
  head/sys/powerpc/include/float.h
  head/sys/sparc64/include/float.h

Modified: head/sys/amd64/include/float.h
==
--- head/sys/amd64/include/float.h  Mon Jan 23 04:38:31 2012
(r230474)
+++ head/sys/amd64/include/float.h  Mon Jan 23 06:36:41 2012
(r230475)
@@ -55,6 +55,11 @@ __END_DECLS
 #define FLT_MAX_EXP128 /* emax */
 #define FLT_MAX3.40282347E+38F /* (1-b**(-p))*b**emax */
 #define FLT_MAX_10_EXP 38  /* floor(log10((1-b**(-p))*b**emax)) */
+#if __ISO_C_VISIBLE >= 2011
+#defineFLT_TRUE_MIN1.40129846E-45F /* b**(emin-p) */
+#defineFLT_DECIMAL_DIG 9   /* ceil(1+p*log10(b)) */
+#defineFLT_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define DBL_MANT_DIG   53
 #define DBL_EPSILON2.2204460492503131E-16
@@ -65,6 +70,11 @@ __END_DECLS
 #define DBL_MAX_EXP1024
 #define DBL_MAX1.7976931348623157E+308
 #define DBL_MAX_10_EXP 308
+#if __ISO_C_VISIBLE >= 2011
+#defineDBL_TRUE_MIN4.9406564584124654E-324
+#defineDBL_DECIMAL_DIG 17
+#defineDBL_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define LDBL_MANT_DIG  64
 #define LDBL_EPSILON   1.0842021724855044340E-19L
@@ -75,4 +85,10 @@ __END_DECLS
 #define LDBL_MAX_EXP   16384
 #define LDBL_MAX   1.1897314953572317650E+4932L
 #define LDBL_MAX_10_EXP4932
+#if __ISO_C_VISIBLE >= 2011
+#defineLDBL_TRUE_MIN   3.6451995318824746025E-4951L
+#defineLDBL_DECIMAL_DIG 21
+#defineLDBL_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
+
 #endif /* _MACHINE_FLOAT_H_ */

Modified: head/sys/arm/include/float.h
==
--- head/sys/arm/include/float.hMon Jan 23 04:38:31 2012
(r230474)
+++ head/sys/arm/include/float.hMon Jan 23 06:36:41 2012
(r230475)
@@ -63,6 +63,11 @@ __END_DECLS
 #define FLT_MAX_EXP128 /* emax */
 #define FLT_MAX3.40282347E+38F /* (1-b**(-p))*b**emax */
 #define FLT_MAX_10_EXP 38  /* floor(log10((1-b**(-p))*b**emax)) */
+#if __ISO_C_VISIBLE >= 2011
+#defineFLT_TRUE_MIN1.40129846E-45F /* b**(emin-p) */
+#defineFLT_DECIMAL_DIG 9   /* ceil(1+p*log10(b)) */
+#defineFLT_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define DBL_MANT_DIG   53
 #define DBL_EPSILON2.2204460492503131E-16
@@ -73,6 +78,11 @@ __END_DECLS
 #define DBL_MAX_EXP1024
 #define DBL_MAX1.7976931348623157E+308
 #define DBL_MAX_10_EXP 308
+#if __ISO_C_VISIBLE >= 2011
+#defineDBL_TRUE_MIN4.9406564584124654E-324
+#defineDBL_DECIMAL_DIG 17
+#defineDBL_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define LDBL_MANT_DIG  DBL_MANT_DIG
 #define LDBL_EPSILON   ((long double)DBL_EPSILON)
@@ -83,4 +93,10 @@ __END_DECLS
 #define LDBL_MAX_EXP   DBL_MAX_EXP
 #define LDBL_MAX   ((long double)DBL_MAX)
 #define LDBL_MAX_10_EXPDBL_MAX_10_EXP
+#if __ISO_C_VISIBLE >= 2011
+#defineLDBL_TRUE_MIN   ((long double)DBL_TRUE_MIN)
+#defineLDBL_DECIMAL_DIG DBL_DECIMAL_DIG
+#defineLDBL_HAS_SUBNORM DBL_HAS_SUBNORM
+#endif /* __ISO_C_VISIBLE >= 2011 */
+
 #endif /* _MACHINE_FLOAT_H_ */

Modified: head/sys/i386/include/float.h
==
--- head/sys/i386/include/float.h   Mon Jan 23 04:38:31 2012
(r230474)
+++ head/sys/i386/include/float.h   Mon Jan 23 06:36:41 2012
(r230475)
@@ -55,6 +55,11 @@ __END_DECLS
 #define FLT_MAX_EXP128 /* emax */
 #define FLT_MAX3.40282347E+38F /* (1-b**(-p))*b**emax */
 #define FLT_MAX_10_EXP 38  /* floor(log10((1-b**(-p))*b**emax)) */
+#if __ISO_C_VISIBLE >= 2011
+#defineFLT_TRUE_MIN1.40129846E-45F /* b**(emin-p) */
+#defineFLT_DECIMAL_DIG 9   /* ceil(1+p*log10(b)) */
+#defineFLT_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define DBL_MANT_DIG   53
 #define DBL_EPSILON2.2204460492503131E-16
@@ -65,6 +70,11 @@ __END_DECLS
 #define DBL_MAX_EXP1024
 #define DBL_MAX1.7976931348623157E+308
 #define DBL_MAX_10_EXP 308
+#if __ISO_C_VISIBLE >= 2011
+#defineDBL_TRUE_MIN4.9406564584124654E-324
+#defineDBL_DECIMAL_DIG 17
+#defineDBL_HAS_SUBNORM 1
+#endif /* __ISO_C_VISIBLE >= 2011 */
 
 #define LDBL_MANT_DIG  64
 #define LDBL_EPSILON   1.084202