Skip to content

Commit

Permalink
MFC
Browse files Browse the repository at this point in the history
  • Loading branch information
attilio authored and attilio committed Aug 9, 2013
2 parents 59ad28d + e9f37ca commit 8bd5d46
Show file tree
Hide file tree
Showing 89 changed files with 1,783 additions and 996 deletions.
7 changes: 6 additions & 1 deletion bin/pkill/pkill.1
Expand Up @@ -29,7 +29,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd February 11, 2010
.Dd August 9, 2013
.Dt PKILL 1
.Os
.Sh NAME
Expand All @@ -44,6 +44,7 @@
.Op Fl N Ar system
.Op Fl P Ar ppid
.Op Fl U Ar uid
.Op Fl c Ar class
.Op Fl d Ar delim
.Op Fl g Ar pgrp
.Op Fl j Ar jid
Expand All @@ -60,6 +61,7 @@
.Op Fl N Ar system
.Op Fl P Ar ppid
.Op Fl U Ar uid
.Op Fl c Ar class
.Op Fl g Ar pgrp
.Op Fl j Ar jid
.Op Fl s Ar sid
Expand Down Expand Up @@ -130,6 +132,9 @@ or
process and all of its ancestors are excluded (unless
.Fl v
is used).
.It Fl c Ar class
Restrict matches to processes running with specified login class
.Ar class .
.It Fl f
Match against full argument lists.
The default is to match against process names.
Expand Down
43 changes: 36 additions & 7 deletions bin/pkill/pkill.c
Expand Up @@ -79,12 +79,14 @@ enum listtype {
LT_TTY,
LT_PGRP,
LT_JID,
LT_SID
LT_SID,
LT_CLASS
};

struct list {
SLIST_ENTRY(list) li_chain;
long li_number;
char *li_name;
};

SLIST_HEAD(listhead, list);
Expand Down Expand Up @@ -116,6 +118,7 @@ static struct listhead ppidlist = SLIST_HEAD_INITIALIZER(ppidlist);
static struct listhead tdevlist = SLIST_HEAD_INITIALIZER(tdevlist);
static struct listhead sidlist = SLIST_HEAD_INITIALIZER(sidlist);
static struct listhead jidlist = SLIST_HEAD_INITIALIZER(jidlist);
static struct listhead classlist = SLIST_HEAD_INITIALIZER(classlist);

static void usage(void) __attribute__((__noreturn__));
static int killact(const struct kinfo_proc *);
Expand Down Expand Up @@ -179,7 +182,7 @@ main(int argc, char **argv)
execf = NULL;
coref = _PATH_DEVNULL;

while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1)
while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ac:d:fg:ij:lnoqs:t:u:vx")) != -1)
switch (ch) {
case 'D':
debug_opt++;
Expand Down Expand Up @@ -222,6 +225,10 @@ main(int argc, char **argv)
case 'a':
ancestors++;
break;
case 'c':
makelist(&classlist, LT_CLASS, optarg);
criteria = 1;
break;
case 'd':
if (!pgrep)
usage();
Expand Down Expand Up @@ -469,6 +476,20 @@ main(int argc, char **argv)
continue;
}

SLIST_FOREACH(li, &classlist, li_chain) {
/*
* We skip P_SYSTEM processes to match ps(1) output.
*/
if ((kp->ki_flag & P_SYSTEM) == 0 &&
kp->ki_loginclass != NULL &&
strcmp(kp->ki_loginclass, li->li_name) == 0)
break;
}
if (SLIST_FIRST(&classlist) != NULL && li == NULL) {
selected[i] = 0;
continue;
}

if (argc == 0)
selected[i] = 1;
}
Expand Down Expand Up @@ -562,9 +583,9 @@ usage(void)

fprintf(stderr,
"usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n"
" [-P ppid] [-U uid] [-g pgrp] [-j jid] [-s sid]\n"
" [-t tty] [-u euid] pattern ...\n", getprogname(),
ustr);
" [-P ppid] [-U uid] [-c class] [-g pgrp] [-j jid]\n"
" [-s sid] [-t tty] [-u euid] pattern ...\n",
getprogname(), ustr);

exit(STATUS_BADUSAGE);
}
Expand Down Expand Up @@ -664,8 +685,10 @@ makelist(struct listhead *head, enum listtype type, char *src)
SLIST_INSERT_HEAD(head, li, li_chain);
empty = 0;

li->li_number = (uid_t)strtol(sp, &ep, 0);
if (*ep == '\0') {
if (type != LT_CLASS)
li->li_number = (uid_t)strtol(sp, &ep, 0);

if (type != LT_CLASS && *ep == '\0') {
switch (type) {
case LT_PGRP:
if (li->li_number == 0)
Expand Down Expand Up @@ -750,6 +773,12 @@ foundtty: if ((st.st_mode & S_IFCHR) == 0)
errx(STATUS_BADUSAGE,
"Invalid jail ID `%s'", sp);
break;
case LT_CLASS:
li->li_number = -1;
li->li_name = strdup(sp);
if (li->li_name == NULL)
err(STATUS_ERROR, "Cannot allocate memory");
break;
default:
usage();
}
Expand Down
21 changes: 16 additions & 5 deletions cddl/contrib/opensolaris/cmd/ztest/ztest.c
Expand Up @@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
Expand Down Expand Up @@ -769,6 +769,16 @@ ztest_kill(ztest_shared_t *zs)
{
zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa));
zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa));

/*
* Before we kill off ztest, make sure that the config is updated.
* See comment above spa_config_sync().
*/
mutex_enter(&spa_namespace_lock);
spa_config_sync(ztest_spa, B_FALSE, B_FALSE);
mutex_exit(&spa_namespace_lock);

zfs_dbgmsg_print(FTAG);
(void) kill(getpid(), SIGKILL);
}

Expand Down Expand Up @@ -2733,7 +2743,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
uint64_t leaf, top;
uint64_t ashift = ztest_get_ashift();
uint64_t oldguid, pguid;
size_t oldsize, newsize;
uint64_t oldsize, newsize;
char oldpath[MAXPATHLEN], newpath[MAXPATHLEN];
int replacing;
int oldvd_has_siblings = B_FALSE;
Expand Down Expand Up @@ -2892,8 +2902,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
if (error != expected_error && expected_error != EBUSY) {
fatal(0, "attach (%s %llu, %s %llu, %d) "
"returned %d, expected %d",
oldpath, (longlong_t)oldsize, newpath,
(longlong_t)newsize, replacing, error, expected_error);
oldpath, oldsize, newpath,
newsize, replacing, error, expected_error);
}

VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
Expand Down Expand Up @@ -4803,7 +4813,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
*/
if (vd0 != NULL && maxfaults != 1 &&
(!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) ||
vd0->vdev_resilvering)) {
vd0->vdev_resilver_txg != 0)) {
/*
* Make vd0 explicitly claim to be unreadable,
* or unwriteable, or reach behind its back
Expand Down Expand Up @@ -5654,6 +5664,7 @@ ztest_run(ztest_shared_t *zs)

zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa));
zs->zs_space = metaslab_class_get_space(spa_normal_class(spa));
zfs_dbgmsg_print(FTAG);

umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t));

Expand Down
4 changes: 4 additions & 0 deletions contrib/ofed/libsdp/src/linux/sdp_inet.h
Expand Up @@ -29,8 +29,12 @@
*/

#ifndef SOLARIS_BUILD
#ifdef __FreeBSD__
#include <sys/socket.h>
#else
#define AF_INET_SDP 27 /* SDP socket protocol family */
#define AF_INET6_SDP 28 /* SDP socket protocol family */
#endif
#else
#define AF_INET_SDP 31 /* This is an invalid family on native solaris
* and will only work using QuickTransit */
Expand Down
8 changes: 4 additions & 4 deletions contrib/ofed/management/infiniband-diags/src/sminfo.c
Expand Up @@ -72,10 +72,10 @@ enum {
};

char *statestr[] = {
[SMINFO_NOTACT] "SMINFO_NOTACT",
[SMINFO_DISCOVER] "SMINFO_DISCOVER",
[SMINFO_STANDBY] "SMINFO_STANDBY",
[SMINFO_MASTER] "SMINFO_MASTER",
[SMINFO_NOTACT] = "SMINFO_NOTACT",
[SMINFO_DISCOVER] = "SMINFO_DISCOVER",
[SMINFO_STANDBY] = "SMINFO_STANDBY",
[SMINFO_MASTER] = "SMINFO_MASTER",
};

#define STATESTR(s) (((unsigned)(s)) < SMINFO_STATE_LAST ? statestr[s] : "???")
Expand Down
5 changes: 4 additions & 1 deletion contrib/ofed/management/opensm/opensm/osm_console.c
Expand Up @@ -67,7 +67,10 @@ static struct {
time_t previous;
void (*loop_function) (osm_opensm_t * p_osm, FILE * out);
} loop_command = {
on: 0, delay_s: 2, loop_function:NULL};
.on = 0,
.delay_s = 2,
.loop_function = NULL,
};

static const struct command console_cmds[];

Expand Down
4 changes: 2 additions & 2 deletions contrib/ofed/management/opensm/opensm/osm_subnet.c
Expand Up @@ -482,7 +482,7 @@ static void log_report(const char *fmt, ...)
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
printf(buf);
printf("%s", buf);
cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0);
}

Expand All @@ -500,7 +500,7 @@ static void log_config_value(char *name, const char *fmt, ...)
n = sizeof(buf);
snprintf(buf + n, sizeof(buf) - n, "\n");
va_end(args);
printf(buf);
printf("%s", buf);
cl_log_event("OpenSM", CL_LOG_INFO, buf, NULL, 0);
}

Expand Down
66 changes: 66 additions & 0 deletions etc/namedb/named.conf
Expand Up @@ -153,6 +153,72 @@ zone "30.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };

// Shared Address Space (RFC 6598)
zone "64.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "65.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "66.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "67.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "68.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "69.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "70.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "71.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "72.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "73.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "74.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "75.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "76.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "77.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "78.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "79.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "80.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "81.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "82.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "83.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "84.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "85.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "86.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "87.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "88.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "89.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "90.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "91.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "92.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "93.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "94.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "95.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "96.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "97.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "98.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "99.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "100.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "101.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "102.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "103.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "104.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "105.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "106.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "107.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "108.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "109.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "110.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "111.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "112.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "113.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "114.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "115.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "116.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "117.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "118.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "119.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "120.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "121.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "122.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "123.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "124.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "125.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "126.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };
zone "127.100.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };

// Link-local/APIPA (RFCs 3927, 5735 and 6303)
zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; };

Expand Down
22 changes: 15 additions & 7 deletions share/man/man9/Makefile
Expand Up @@ -332,11 +332,8 @@ MAN= accept_filter.9 \
vm_page_grab.9 \
vm_page_hold.9 \
vm_page_insert.9 \
vm_page_io.9 \
vm_page_lookup.9 \
vm_page_rename.9 \
vm_page_sleep_if_busy.9 \
vm_page_wakeup.9 \
vm_page_wire.9 \
vm_set_page_size.9 \
vmem.9 \
Expand Down Expand Up @@ -1465,6 +1462,21 @@ MLINKS+=vm_page_bits.9 vm_page_clear_dirty.9 \
vm_page_bits.9 vm_page_test_dirty.9 \
vm_page_bits.9 vm_page_undirty.9 \
vm_page_bits.9 vm_page_zero_invalid.9
MLINKS+=vm_page_busy.9 vm_page_busied.9 \
vm_page_busy.9 vm_page_busy_downgrade.9 \
vm_page_busy.9 vm_page_busy_sleep.9 \
vm_page_busy.9 vm_page_sbusied.9 \
vm_page_busy.9 vm_page_sbusy.9 \
vm_page_busy.9 vm_page_sleep_if_busy.9 \
vm_page_busy.9 vm_page_sunbusy.9 \
vm_page_busy.9 vm_page_trysbusy.9 \
vm_page_busy.9 vm_page_tryxbusy.9 \
vm_page_busy.9 vm_page_xbusied.9 \
vm_page_busy.9 vm_page_xbusy.9 \
vm_page_busy.9 vm_page_xunbusy.9 \
vm_page_busy.9 vm_page_assert_sbusied.9 \
vm_page_busy.9 vm_page_assert_unbusied.9 \
vm_page_busy.9 vm_page_assert_xbusied.9
MLINKS+=vm_page_aflag.9 vm_page_aflag_clear.9 \
vm_page_aflag.9 vm_page_aflag_set.9 \
vm_page_aflag.9 vm_page_reference.9
Expand All @@ -1473,10 +1485,6 @@ MLINKS+=vm_page_free.9 vm_page_free_toq.9 \
vm_page_free.9 vm_page_try_to_free.9
MLINKS+=vm_page_hold.9 vm_page_unhold.9
MLINKS+=vm_page_insert.9 vm_page_remove.9
MLINKS+=vm_page_io.9 vm_page_io_finish.9 \
vm_page_io.9 vm_page_io_start.9
MLINKS+=vm_page_wakeup.9 vm_page_busy.9 \
vm_page_wakeup.9 vm_page_flash.9
MLINKS+=vm_page_wire.9 vm_page_unwire.9
MLINKS+=VOP_ACCESS.9 VOP_ACCESSX.9
MLINKS+=VOP_ATTRIB.9 VOP_GETATTR.9 \
Expand Down

0 comments on commit 8bd5d46

Please sign in to comment.