/*
* 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
* 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
*/
/*
*/
/*
* poolbind - bind processes, tasks, and projects to pools, and query process
* pool bindings
*/
#include <libgen.h>
#include <pool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <locale.h>
#include <libintl.h>
#include <errno.h>
#include <project.h>
#include <zone.h>
#include "utils.h"
#ifndef TEXT_DOMAIN
#endif
static struct {
char *str;
} idtypes[] = {
{ P_PID, "pid" },
{ P_TASKID, "taskid" },
{ P_PROJID, "projid" },
{ P_PROJID, "project" },
{ P_ZONEID, "zoneid" },
{ -1, NULL }
};
void exec_cmd(char *, char *[]);
void
usage(void)
{
gettext("Usage:\n"
" poolbind -p pool_name -e command [arguments...]\n"
" poolbind -p pool_name "
"[-i pid | -i taskid | -i projid | -i zoneid] id ...\n"
" poolbind -q pid ...\n"
" poolbind -Q pid ... \n"));
}
int
{
char *resource_name;
(int)pid, get_errstr());
else
return (PO_SUCCESS);
}
int
{
char c;
int i;
int status;
(void) textdomain(TEXT_DOMAIN);
switch (c) {
case 'Q':
usage();
break;
case 'e':
usage();
break;
case 'i':
break;
}
}
usage();
break;
case 'p':
usage();
break;
case 'q':
usage();
break;
case '?':
default:
usage();
}
}
usage();
usage();
/*
* Check to see that the pools facility is enabled
*/
if (status == POOL_DISABLED)
/*NOTREACHED*/
else
return (error);
}
void
{
get_errstr());
return;
}
/*NOTREACHED*/
}
void
{
int i;
for (i = 0; i < argc; i++) {
char *endp;
char *poolname;
errno = 0;
if (errno != 0 ||
/*
* The string does not completely parse to
* an integer, or it represents an invalid
* zone id.
*/
/*
* It must be a project or zone name.
*/
argv[i]);
continue;
}
/* make sure the zone is booted */
if (id == -1) {
"active\n"), argv[i]);
continue;
}
"id for project: '%s'"), argv[i]);
continue;
}
} else {
continue;
}
}
PO_SUCCESS) {
get_errstr());
}
continue;
}
} else {
}
}
const char **resource_types;
sizeof (const char *))) == NULL) {
}
for (j = 0; j < count; j++)
(void) print_resource_binding(resource_types[j],
}
}
}