2 * lxc: linux Container library
4 * (C) Copyright IBM Corp. 2007, 2008
7 * Daniel Lezcano <dlezcano at fr.ibm.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 static const char *const catalogue
[] = {
30 [LXC_ERROR_LOCK
] = "Failed to lock the container",
32 [LXC_ERROR_EMPTY
] = "The container is empty",
33 [LXC_ERROR_ALREADY_EXISTS
] = "The container already exists",
34 [LXC_ERROR_BUSY
] = "The container is busy",
35 [LXC_ERROR_NOT_FOUND
] = "The container was not found",
36 [LXC_ERROR_PERMISSION_DENIED
] = "Permission denied",
37 [LXC_ERROR_WRONG_COMMAND
] = "Wrong command",
39 [LXC_ERROR_CONF_CGROUP
] = "Failed to configure the control group",
40 [LXC_ERROR_CONF_MOUNT
] = "Failed to configure the mount points",
41 [LXC_ERROR_CONF_UTSNAME
] = "Failed to configure the utsname",
42 [LXC_ERROR_CONF_NETWORK
] = "Failed to configure the network",
43 [LXC_ERROR_CONF_ROOTFS
] = "Failed to configure the root fs",
45 [LXC_ERROR_SETUP_CGROUP
] = "Failed to setup the control group",
46 [LXC_ERROR_SETUP_MOUNT
] = "Failed to setup the mount points",
47 [LXC_ERROR_SETUP_UTSNAME
] = "Failed to setup the utsname",
48 [LXC_ERROR_SETUP_NETWORK
] = "Failed to setup the network",
49 [LXC_ERROR_SETUP_CONSOLE
] = "Failed to setup the console",
50 [LXC_ERROR_SETUP_ROOTFS
] = "Failed to setup the root fs",
52 [LXC_ERROR_INTERNAL
] = "Internal system error",
55 const char *const lxc_strerror(int error
)
59 if (error
>= LXC_LAST_ERROR
)
62 return catalogue
[error
];