summaryrefslogtreecommitdiff
path: root/sys-utils
diff options
context:
space:
mode:
authorLaMont Jones <lamont@debian.org>2011-01-31 20:15:49 -0700
committerLaMont Jones <lamont@debian.org>2011-01-31 20:15:49 -0700
commit11292d25510e67c83c6580401eccd42d6d6da931 (patch)
treeca5850da93c90f8798d7ff115e0124edffb8bb97 /sys-utils
parent4f9e177060fb5ad6e574598aefdf2d5f50a8b54f (diff)
parent9f55bf3794ca98852dd1f352f993dea60d83a2e1 (diff)
downloadutil-linux-old-11292d25510e67c83c6580401eccd42d6d6da931.tar.gz
Merge remote branch 'origin/master'
Conflicts: mount/mount.8 mount/mount.c
Diffstat (limited to 'sys-utils')
-rw-r--r--sys-utils/flock.12
-rw-r--r--sys-utils/fsfreeze.82
-rw-r--r--sys-utils/ipcmk.14
-rw-r--r--sys-utils/lscpu.c60
-rw-r--r--sys-utils/unshare.12
-rw-r--r--sys-utils/unshare.c1
6 files changed, 42 insertions, 29 deletions
diff --git a/sys-utils/flock.1 b/sys-utils/flock.1
index 2dda8200..55be5d8c 100644
--- a/sys-utils/flock.1
+++ b/sys-utils/flock.1
@@ -92,7 +92,7 @@ Fail (with an exit code of 1) if the lock cannot be acquired within
\fB\-o\fP, \fB\-\-close\fP
Close the file descriptor on which the lock is held before executing
\fIcommand\fP. This is useful if \fIcommand\fP spawns a child process
-which should not be hold ing the lock.
+which should not be holding the lock.
.TP
\fB\-c\fP, \fB\-\-command\fP \fIcommand\fP
Pass a single \fIcommand\fP to the shell with \fB\-c\fP.
diff --git a/sys-utils/fsfreeze.8 b/sys-utils/fsfreeze.8
index b09d1869..a10c053b 100644
--- a/sys-utils/fsfreeze.8
+++ b/sys-utils/fsfreeze.8
@@ -22,7 +22,7 @@ is intended to be used with hardware RAID devices that support the creation
of snapshots.
.PP
.B fsfreeze
-is unncessary for
+is unnecessary for
.B device-mapper
devices. The device-mapper (and LVM)
automatically freezes filesystem on the device when a snapshot creation is requested.
diff --git a/sys-utils/ipcmk.1 b/sys-utils/ipcmk.1
index d3af47e6..afeacafb 100644
--- a/sys-utils/ipcmk.1
+++ b/sys-utils/ipcmk.1
@@ -47,5 +47,5 @@ display a short help message and exit
.SH "AUTHOR"
Hayden A. James (hayden.james@gmail.com)
.SH "AVAILABILITY"
-The ipcmk command is part of the util\-linux\-ng package and is available from
-ftp://ftp.kernel.org/pub/linux/utils/util\-linux\-ng/.
+The ipcmk command is part of the util-linux package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index ca2adb86..66f6126f 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -72,11 +72,10 @@ const char *hv_vendors[] = {
[HYPER_MSHV] = "Microsoft"
};
-/* CPU modes (bits) */
+/* CPU modes */
enum {
- MODE_REAL = (1 << 1),
- MODE_TRANSPARENT = (1 << 2),
- MODE_LONG = (1 << 3)
+ MODE_32BIT = (1 << 1),
+ MODE_64BIT = (1 << 2)
};
/* cache(s) description */
@@ -341,6 +340,26 @@ int lookup(char *line, char *pattern, char **value)
return 1;
}
+/* Don't init the mode for platforms where we are not able to
+ * detect that CPU supports 64-bit mode.
+ */
+static int
+init_mode(void)
+{
+ int m = 0;
+
+#if defined(__alpha__) || defined(__ia64__)
+ m |= MODE_64BIT; /* 64bit platforms only */
+#endif
+ /* platforms with 64bit flag in /proc/cpuinfo, define
+ * 32bit default here */
+#if defined(__i386__) || defined(__x86_64__) || \
+ defined(__s390x__) || defined(__s390__)
+ m |= MODE_32BIT;
+#endif
+ return m;
+}
+
static void
read_basicinfo(struct lscpu_desc *desc)
{
@@ -359,40 +378,39 @@ read_basicinfo(struct lscpu_desc *desc)
/* details */
while (fgets(buf, sizeof(buf), fp) != NULL) {
- /* IA64 */
if (lookup(buf, "vendor", &desc->vendor)) ;
else if (lookup(buf, "vendor_id", &desc->vendor)) ;
- /* IA64 */
else if (lookup(buf, "family", &desc->family)) ;
else if (lookup(buf, "cpu family", &desc->family)) ;
else if (lookup(buf, "model", &desc->model)) ;
else if (lookup(buf, "stepping", &desc->stepping)) ;
else if (lookup(buf, "cpu MHz", &desc->mhz)) ;
- else if (lookup(buf, "flags", &desc->flags)) ;
+ else if (lookup(buf, "flags", &desc->flags)) ; /* x86 */
+ else if (lookup(buf, "features", &desc->flags)) ; /* s390 */
else if (lookup(buf, "bogomips", &desc->bogomips)) ;
else
continue;
}
+ desc->mode = init_mode();
+
if (desc->flags) {
snprintf(buf, sizeof(buf), " %s ", desc->flags);
if (strstr(buf, " svm "))
desc->virtflag = strdup("svm");
else if (strstr(buf, " vmx "))
desc->virtflag = strdup("vmx");
-
- if (strstr(buf, " rm "))
- desc->mode |= MODE_REAL;
- if (strstr(buf, " tm "))
- desc->mode |= MODE_TRANSPARENT;
if (strstr(buf, " lm "))
- desc->mode |= MODE_LONG;
+ desc->mode |= MODE_32BIT | MODE_64BIT; /* x86_64 */
+ if (strstr(buf, " zarch "))
+ desc->mode |= MODE_32BIT | MODE_64BIT; /* s390x */
}
fclose(fp);
if (path_exist(_PATH_SYS_SYSTEM "/cpu/kernel_max"))
- maxcpus = path_getnum(_PATH_SYS_SYSTEM "/cpu/kernel_max");
+ /* note that kernel_max is maximum index [NR_CPUS-1] */
+ maxcpus = path_getnum(_PATH_SYS_SYSTEM "/cpu/kernel_max") + 1;
else if (!sysrootlen)
/* the root is '/' so we are working with data from the current kernel */
@@ -799,31 +817,25 @@ print_readable(struct lscpu_desc *desc, int hex)
print_s(_("Architecture:"), desc->arch);
- if (desc->mode & (MODE_REAL | MODE_TRANSPARENT | MODE_LONG)) {
+ if (desc->mode) {
char buf[64], *p = buf;
- if (desc->mode & MODE_REAL) {
- strcpy(p, "16-bit, ");
- p += 8;
- }
- if (desc->mode & MODE_TRANSPARENT) {
+ if (desc->mode & MODE_32BIT) {
strcpy(p, "32-bit, ");
p += 8;
}
- if (desc->mode & MODE_LONG) {
+ if (desc->mode & MODE_64BIT) {
strcpy(p, "64-bit, ");
p += 8;
}
*(p - 2) = '\0';
print_s(_("CPU op-mode(s):"), buf);
}
-#ifdef __BYTE_ORDER
-#if (__BYTE_ORDER == __LITTLE_ENDIAN)
+#if !defined(WORDS_BIGENDIAN)
print_s(_("Byte Order:"), "Little Endian");
#else
print_s(_("Byte Order:"), "Big Endian");
#endif
-#endif
print_n(_("CPU(s):"), desc->ncpus);
if (desc->online)
diff --git a/sys-utils/unshare.1 b/sys-utils/unshare.1
index f1f2dd63..d27c35ed 100644
--- a/sys-utils/unshare.1
+++ b/sys-utils/unshare.1
@@ -22,7 +22,7 @@ setting hostname, domainname will not affect rest of the system
(\fBCLONE_NEWUTS\fP flag),
.TP
.BR "IPC namespace"
-process will have indpendent namespace for System V message queues, semaphore
+process will have independent namespace for System V message queues, semaphore
sets and shared memory segments (\fBCLONE_NEWIPC\fP flag),
.TP
.BR "network namespace"
diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
index 6b6177c5..12a725e3 100644
--- a/sys-utils/unshare.c
+++ b/sys-utils/unshare.c
@@ -76,6 +76,7 @@ int main(int argc, char *argv[])
{ "uts", no_argument, 0, 'u' },
{ "ipc", no_argument, 0, 'i' },
{ "net", no_argument, 0, 'n' },
+ { NULL, 0, 0, 0 }
};
int unshare_flags = 0;