Skip to content

Commit

Permalink
Merge branch 'gcc4' of git.joyent.com:illumos-joyent into gcc4
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSonnenschein committed Jan 26, 2012
2 parents d6f9034 + 6a5fc13 commit 92fb61a
Show file tree
Hide file tree
Showing 35 changed files with 1,002 additions and 151 deletions.
2 changes: 2 additions & 0 deletions manifest
Expand Up @@ -2351,6 +2351,7 @@ f usr/bin/zcat 0555 root bin
f usr/bin/ziostat 0555 root bin
s usr/bin/zonename=../../sbin/zonename
f usr/bin/zonestat 0555 root bin
f usr/bin/zschedstat 0555 root bin
d usr/ccs 0755 root bin
d usr/ccs/bin 0755 root bin
d usr/ccs/bin/amd64 0755 root bin
Expand Down Expand Up @@ -11983,6 +11984,7 @@ f usr/share/man/man1m/zic.1m 0444 root bin
f usr/share/man/man1m/zoneadm.1m 0444 root bin
f usr/share/man/man1m/zonecfg.1m 0444 root bin
f usr/share/man/man1m/zpool.1m 0444 root bin
f usr/share/man/man1m/zschedstat.1m 0444 root bin
f usr/share/man/man1m/zstreamdump.1m 0444 root bin
d usr/share/man/man2 0755 root bin
f usr/share/man/man2/Intro.2 0444 root bin
Expand Down
8 changes: 8 additions & 0 deletions usr/src/cmd/fs.d/nfs/mountd/mountd.c
Expand Up @@ -20,6 +20,7 @@
*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright 2012 Joyent, Inc. All rights reserved.
*/

/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
Expand Down Expand Up @@ -390,6 +391,13 @@ main(int argc, char *argv[])
exit(1);
}

/* Mountd cannot run in a non-global zone. */
if (getzoneid() != GLOBAL_ZONEID) {
(void) fprintf(stderr, "%s: can only run in the global zone\n",
argv[0]);
exit(1);
}

maxthreads = 0;

while ((c = getopt(argc, argv, "vrm:")) != EOF) {
Expand Down
8 changes: 8 additions & 0 deletions usr/src/cmd/fs.d/nfs/nfsd/nfsd.c
Expand Up @@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/

/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
Expand Down Expand Up @@ -176,6 +177,13 @@ main(int ac, char *av[])
exit(1);
}

/* Nfsd cannot run in a non-global zone. */
if (getzoneid() != GLOBAL_ZONEID) {
(void) fprintf(stderr, "%s: can only run in the global zone\n",
av[0]);
exit(1);
}

(void) enable_extended_FILE_stdio(-1, -1);

/*
Expand Down
3 changes: 2 additions & 1 deletion usr/src/cmd/rcap/rcapd/rcapd_scanner.c
Expand Up @@ -21,6 +21,7 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2012 Joyent, Inc. All rights reserved.
*/

#pragma ident "%Z%%M% %I% %E% SMI"
Expand Down Expand Up @@ -551,7 +552,7 @@ pageout(pid_t pid, struct ps_prochandle *Pr, caddr_t start, caddr_t end)

errno = 0;
res = pr_memcntl(Pr, start, (end - start), MC_SYNC,
(caddr_t)(MS_ASYNC | MS_INVALIDATE), 0, 0);
(caddr_t)(MS_ASYNC | MS_INVALCURPROC), 0, 0);
debug_high("pr_memcntl [%p-%p): %d", (void *)start, (void *)end, res);

/*
Expand Down
17 changes: 15 additions & 2 deletions usr/src/cmd/savecore/savecore.c
Expand Up @@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/

#include <stdio.h>
Expand Down Expand Up @@ -1501,7 +1502,14 @@ getbounds(const char *f)
long b = -1;
const char *p = strrchr(f, '/');

(void) sscanf(p ? p + 1 : f, "vmdump.%ld", &b);
if (p == NULL || strncmp(p, "vmdump", 6) != 0)
p = strstr(f, "vmdump");

if (p != NULL && *p == '/')
p++;

(void) sscanf(p ? p : f, "vmdump.%ld", &b);

return (b);
}

Expand Down Expand Up @@ -1635,6 +1643,7 @@ main(int argc, char *argv[])
struct rlimit rl;
long filebounds = -1;
char namelist[30], corefile[30], boundstr[30];
dumpfile = NULL;

startts = gethrtime();

Expand Down Expand Up @@ -1675,7 +1684,11 @@ main(int argc, char *argv[])
}
}

if (geteuid() != 0 && filebounds < 0) {
/*
* If doing something other than extracting an existing dump (i.e.
* dumpfile has been provided as an option), the user must be root.
*/
if (geteuid() != 0 && dumpfile == NULL) {
(void) fprintf(stderr, "%s: %s %s\n", progname,
gettext("you must be root to use"), progname);
exit(1);
Expand Down
5 changes: 3 additions & 2 deletions usr/src/cmd/stat/Makefile
Expand Up @@ -19,7 +19,7 @@
# CDDL HEADER END
#
#
# Copyright 2011 Joyent, Inc. All rights reserved.
# Copyright 2011, 2012, Joyent, Inc. All rights reserved.
# Use is subject to license terms.
#
# cmd/stat/Makefile
Expand All @@ -33,7 +33,8 @@ SUBDIRS= arcstat \
mpstat \
vfsstat \
vmstat \
ziostat
ziostat \
zschedstat

all := TARGET = all
install := TARGET = install
Expand Down
50 changes: 50 additions & 0 deletions usr/src/cmd/stat/zschedstat/Makefile
@@ -0,0 +1,50 @@
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#

include $(SRC)/cmd/Makefile.cmd

PROG= zschedstat
OBJS = zschedstat.o
SRCS =$(OBJS:%.o=%.c) $(COMMON_SRCS)

LDLIBS += -lkstat

lint := LINTFLAGS = -muxs

.KEEP_STATE:

all: $(PROG)

install: all .WAIT $(ROOTPROG)

clean:

$(ROOTBINPROG): $(PROG)
$(INS.file)

lint: lint_SRCS

check:
$(CSTYLE) -pP $(SRCS:%=%)

include $(SRC)/cmd/Makefile.targ

0 comments on commit 92fb61a

Please sign in to comment.