- fprintf(stderr, "%s [opts]\n", name);
- fprintf(stderr, " -h: show this help\n");
- fprintf(stderr, " -v: verbose mode\n");
- fprintf(stderr, " -F: foreground mode (default is to daemonize)\n");
- fprintf(stderr, " -p <pid_file>: path to the PID file (used in daemon\n"
- " mode only).\n"
- " Default=%s\n", IVSHMEM_SERVER_DEFAULT_SHM_PATH);
- fprintf(stderr, " -S <unix_socket_path>: path to the unix socket\n"
- " to listen to.\n"
- " Default=%s\n", IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH);
- fprintf(stderr, " -m <shm_path>: path to the shared memory.\n"
- " The path corresponds to a POSIX shm name or a\n"
- " hugetlbfs mount point.\n"
- " default=%s\n", IVSHMEM_SERVER_DEFAULT_SHM_PATH);
- fprintf(stderr, " -l <size>: size of shared memory in bytes. The suffix\n"
- " K, M and G can be used (ex: 1K means 1024).\n"
- " default=%u\n", IVSHMEM_SERVER_DEFAULT_SHM_SIZE);
- fprintf(stderr, " -n <n_vects>: number of vectors.\n"
- " default=%u\n", IVSHMEM_SERVER_DEFAULT_N_VECTORS);
-
- exit(code);
+ printf("Usage: %s [OPTION]...\n"
+ " -h: show this help\n"
+ " -v: verbose mode\n"
+ " -F: foreground mode (default is to daemonize)\n"
+ " -p <pid-file>: path to the PID file (used in daemon mode only)\n"
+ " default " IVSHMEM_SERVER_DEFAULT_PID_FILE "\n"
+ " -S <unix-socket-path>: path to the unix socket to listen to\n"
+ " default " IVSHMEM_SERVER_DEFAULT_UNIX_SOCK_PATH "\n"
+ " -M <shm-name>: POSIX shared memory object to use\n"
+ " default " IVSHMEM_SERVER_DEFAULT_SHM_PATH "\n"
+ " -m <dir-name>: where to create shared memory\n"
+ " -l <size>: size of shared memory in bytes\n"
+ " suffixes K, M and G can be used, e.g. 1K means 1024\n"
+ " default %u\n"
+ " -n <nvectors>: number of vectors\n"
+ " default %u\n",
+ progname, IVSHMEM_SERVER_DEFAULT_SHM_SIZE,
+ IVSHMEM_SERVER_DEFAULT_N_VECTORS);
+}
+
+static void
+ivshmem_server_help(const char *progname)
+{
+ fprintf(stderr, "Try '%s -h' for more information.\n", progname);