plabel.c revision f875b4ebb1dd9fdbeb043557cab38ab3bf7f6e01
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * CDDL HEADER START
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * The contents of this file are subject to the terms of the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Common Development and Distribution License (the "License").
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * You may not use this file except in compliance with the License.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * See the License for the specific language governing permissions
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * and limitations under the License.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * When distributing Covered Code, include this CDDL HEADER in each
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * If applicable, add the following below this CDDL HEADER, with the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * fields enclosed by brackets "[]" replaced with your own identifying
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * information: Portions Copyright [yyyy] [name of copyright owner]
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * CDDL HEADER END
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Use is subject to license terms.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#pragma ident "%Z%%M% %I% %E% SMI"
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * plabel - gets process label.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossstatic int look(char *);
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossstatic int perr(char *);
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossstatic void usage(void);
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Rossstatic unsigned int opt_flag = 0;
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross /* Error if labeling is not active. */
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross gettext("%s: Trusted Extensions must be enabled\n"), cmd);
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross while ((opt = getopt(argc, argv, "sS")) != EOF) {
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross char pid[11]; /* 32 bit pids go to 4294967295 plus a NUL */
while (argc-- > 0) {
if (rc == 0)
return (rc);
int fd;
char *str;
goto retry;
usage(void)
perr(char *s) {
s = procname;
perror(s);