lxc.h revision 5e97c3fcce787a5bc0f8ceef43aa3e05195b480a
248N/A * lxc: linux Container library 248N/A * (C) Copyright IBM Corp. 2007, 2008 248N/A * This library is free software; you can redistribute it and/or 248N/A * modify it under the terms of the GNU Lesser General Public 248N/A * License as published by the Free Software Foundation; either 248N/A * version 2.1 of the License, or (at your option) any later version. 248N/A * This library is distributed in the hope that it will be useful, 248N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 248N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 248N/A * Lesser General Public License for more details. 248N/A * You should have received a copy of the GNU Lesser General Public 248N/A * License along with this library; if not, write to the Free Software 248N/A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 814N/A Following code is for liblxc. 248N/A * Create the container object. Creates the /lxc/<name> directory 248N/A * and fills it with the files corresponding to the configuration 690N/A * structure passed as parameter. 248N/A * The first container will create the /lxc directory. 248N/A * @name : the name of the container 690N/A * @conf : the configuration data for the container 248N/A * Returns 0 on success, < 0 otherwise 248N/A * Destroy the container object. Removes the files into the /lxc/<name> 248N/A * directory and removes the <name> directory. 248N/A * The last container will remove the /lxc directory. 248N/A * @name : the name of the container to be detroyed 248N/A * Returns 0 on success, < 0 otherwise 248N/A * Start the container previously created with lxc_create. 248N/A * @name : the name of the container 248N/A * @argc : the number of arguments of the command line 248N/A * @argv : an array of char * corresponding to the commande line 248N/A * @prestart : hooks will be called just before the command execs 248N/A * Returns 0 on sucess, < 0 otherwise 248N/A * Create the container and start it directly, using the argc, argv 248N/A * parameter. This command is for application container. 248N/A * At the end of the exec'ed command, the container will * automatically autodestroy. * @name : the name of the container * @conf : the configuration data * @argc : the number of arguments of the command line * @argv : an array of char * corresponding to the commande line * @preexec : hooks will be called just before the command execs * Returns 0 on success, < 0 otherwise * Stop the container previously started with lxc_start or lxc_exec * @name : the name of the container * Returns 0 on success, < 0 otherwise * Monitor the container, each time the state of the container * is changed, a state data is send through a file descriptor passed to * the function with output_fd. * The function will block until the container is destroyed. * @name : the name of the contaier * @output_fd : the file descriptor where to send the states * Returns 0 on success, < 0 otherwise * Show the console of the container. * @name : the name of container * Returns 0 on sucess, < 0 otherwise * Freeze all the tasks running inside the container <name> * @name : the container name * Returns 0 on success, < 0 otherwise * Unfreeze all previously frozen tasks. * @name : the name of the container * Return 0 on sucess, < 0 otherwise * Retrieve the container state * @name : the name of the container * Returns the state of the container on success, < 0 otherwise * Send a signal to all processes of the container. This is the same * behavior of the well-known 'killpg' command except it is related * to all tasks belonging to a container. * @name : the name of the container * @signum : the signal number to be sent * Returns 0 on success, < 0 otherwise * Change the priority of the container * @name : the name of the container * @priority : an integer representing the desired priority * Returns 0 on success, < 0 otherwise * Retrieve the priority of the container * @name : the name of the container * @priority : a pointer to an int where the priority will be stored * Returns 0 on success, < 0 otherwise * Set the maximum memory usable by the container * @name : the name of the container * @memmax : the maximum usable memory in bytes * Returns 0 on sucess, < 0 otherwise * Get the maximum memory usable by the container * @name : the name of the container * @memmax : a pointer to a size_t where the value will be stored * Returns 0 on sucess, < 0 otherwise * Get the memory statistics of the container * @name : the name of the container * @memstat : a pointer to a structure defining the memory statistic * Returns 0 on sucess, < 0 otherwise * Set the cpuset for the container * @name : the name of the container * @cpumask : a bitmask representing the cpu maps * @len : the len of the bitmask * @shared : a boolean specifying if the cpu could be shared with * processes not belonging to the container * Returns 0 on sucess, < 0 otherwise * Get the actual cpuset for the container * @cpumask : a bitmask representing the cpu maps * @len : the len of the bitmask * @shared : a boolean specifying if the cpu is shared with * processes not belonging to the container * Returns 0 on sucess, < 0 otherwise * Get the cpu usage of the container * @name : the name of the container * @usage : a value to be filled with the current container cpu usage * Returns 0 on sucess, < 0 otherwise