~ubuntu-branches/ubuntu/trusty/util-linux/trusty-proposed

« back to all changes in this revision

Viewing changes to sys-utils/unshare.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2011-11-03 15:38:23 UTC
  • mto: (4.5.5 sid) (1.6.4)
  • mto: This revision was merged to the branch mainline in revision 85.
  • Revision ID: package-import@ubuntu.com-20111103153823-10sx16jprzxlhkqf
ImportĀ upstreamĀ versionĀ 2.20.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * 675 Mass Ave, Cambridge, MA 02139, USA.
19
19
 */
20
20
 
21
 
#include <err.h>
22
21
#include <errno.h>
23
22
#include <getopt.h>
24
23
#include <sched.h>
27
26
#include <unistd.h>
28
27
 
29
28
#include "nls.h"
 
29
#include "c.h"
30
30
 
31
31
#ifndef CLONE_NEWSNS
32
32
# define CLONE_NEWNS 0x00020000
54
54
{
55
55
        FILE *out = status == EXIT_SUCCESS ? stdout : stderr;
56
56
 
57
 
        fprintf(out, _("Usage: %s [options] <program> [args...]\n"),
58
 
                program_invocation_short_name);
59
 
 
60
 
        fputs(_("Run program with some namespaces unshared from parent\n\n"
61
 
                "  -h, --help        usage information (this)\n"
62
 
                "  -m, --mount       unshare mounts namespace\n"
63
 
                "  -u, --uts         unshare UTS namespace (hostname etc)\n"
64
 
                "  -i, --ipc         unshare System V IPC namespace\n"
65
 
                "  -n, --net         unshare network namespace\n"), out);
66
 
 
67
 
        fprintf(out, _("\nFor more information see unshare(1).\n"));
 
57
        fputs(_("\nUsage:\n"), out);
 
58
        fprintf(out,
 
59
              _(" %s [options] <program> [args...]\n"), program_invocation_short_name);
 
60
 
 
61
        fputs(_("\nOptions:\n"), out);
 
62
        fputs(_(" -h, --help        usage information (this)\n"
 
63
                " -m, --mount       unshare mounts namespace\n"
 
64
                " -u, --uts         unshare UTS namespace (hostname etc)\n"
 
65
                " -i, --ipc         unshare System V IPC namespace\n"
 
66
                " -n, --net         unshare network namespace\n"), out);
 
67
 
 
68
        fputs(_("\nFor more information see unshare(1).\n"), out);
68
69
        exit(status);
69
70
}
70
71
 
71
72
int main(int argc, char *argv[])
72
73
{
73
 
        struct option longopts[] = {
 
74
        static const struct option longopts[] = {
74
75
                { "help", no_argument, 0, 'h' },
75
76
                { "mount", no_argument, 0, 'm' },
76
77
                { "uts", no_argument, 0, 'u' },