summaryrefslogtreecommitdiffstats
path: root/sys-utils
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:26:14 +0100
committerKarel Zak2006-12-07 00:26:14 +0100
commitd03dd60840f0a08464d5266539ad356aefe24b03 (patch)
tree0a9ad240a7a88eb6b11b152974a7a51a0df79b75 /sys-utils
parentImported from util-linux-2.12pre tarball. (diff)
downloadkernel-qcow2-util-linux-d03dd60840f0a08464d5266539ad356aefe24b03.tar.gz
kernel-qcow2-util-linux-d03dd60840f0a08464d5266539ad356aefe24b03.tar.xz
kernel-qcow2-util-linux-d03dd60840f0a08464d5266539ad356aefe24b03.zip
Imported from util-linux-2.12a tarball.
Diffstat (limited to 'sys-utils')
-rw-r--r--sys-utils/ipcs.c32
-rw-r--r--sys-utils/readprofile.14
-rw-r--r--sys-utils/readprofile.c15
3 files changed, 26 insertions, 25 deletions
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 05559b90f..b6f16b72a 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -262,7 +262,7 @@ void do_shm (char format)
struct ipc_perm *ipcp = &shmseg.shm_perm;
struct passwd *pw;
- maxid = shmctl (0, SHM_INFO, (struct shmid_ds *) &shm_info);
+ maxid = shmctl (0, SHM_INFO, (struct shmid_ds *) (void *) &shm_info);
if (maxid < 0) {
printf (_("kernel not configured for shared memory\n"));
return;
@@ -271,18 +271,18 @@ void do_shm (char format)
switch (format) {
case LIMITS:
printf (_("------ Shared Memory Limits --------\n"));
- if ((shmctl (0, IPC_INFO, (struct shmid_ds *) &shminfo)) < 0 )
+ if ((shmctl (0, IPC_INFO, (struct shmid_ds *) (void *) &shminfo)) < 0 )
return;
/* glibc 2.1.3 and all earlier libc's have ints as fields
of struct shminfo; glibc 2.1.91 has unsigned long; ach */
- printf (_("max number of segments = %ld\n"),
- (long) shminfo.shmmni);
- printf (_("max seg size (kbytes) = %ld\n"),
- (long) (shminfo.shmmax >> 10));
- printf (_("max total shared memory (kbytes) = %ld\n"),
- (long) shminfo.shmall << 2);
- printf (_("min seg size (bytes) = %ld\n"),
- (long) shminfo.shmmin);
+ printf (_("max number of segments = %lu\n"),
+ (unsigned long) shminfo.shmmni);
+ printf (_("max seg size (kbytes) = %lu\n"),
+ (unsigned long) (shminfo.shmmax >> 10));
+ printf (_("max total shared memory (pages) = %lu\n"),
+ (unsigned long) shminfo.shmall);
+ printf (_("min seg size (bytes) = %lu\n"),
+ (unsigned long) shminfo.shmmin);
return;
case STATUS:
@@ -360,12 +360,12 @@ void do_shm (char format)
printf ("%-10d %-10.10s", shmid, pw->pw_name);
else
printf ("%-10d %-10d", shmid, ipcp->uid);
- printf ("%-10o %-10ld %-10ld %-6s %-6s\n",
+ printf ("%-10o %-10lu %-10ld %-6s %-6s\n",
ipcp->mode & 0777,
/*
* earlier: int, Austin has size_t
*/
- (long) shmseg.shm_segsz,
+ (unsigned long) shmseg.shm_segsz,
/*
* glibc-2.1.3 and earlier has unsigned short;
* Austin has shmatt_t
@@ -389,7 +389,7 @@ void do_sem (char format)
struct passwd *pw;
union semun arg;
- arg.array = (ushort *) &seminfo;
+ arg.array = (ushort *) (void *) &seminfo;
maxid = semctl (0, 0, SEM_INFO, arg);
if (maxid < 0) {
printf (_("kernel not configured for semaphores\n"));
@@ -399,7 +399,7 @@ void do_sem (char format)
switch (format) {
case LIMITS:
printf (_("------ Semaphore Limits --------\n"));
- arg.array = (ushort *) &seminfo; /* damn union */
+ arg.array = (ushort *) (void *) &seminfo; /* damn union */
if ((semctl (0, 0, IPC_INFO, arg)) < 0 )
return;
printf (_("max number of arrays = %d\n"), seminfo.semmni);
@@ -491,7 +491,7 @@ void do_msg (char format)
struct ipc_perm *ipcp = &msgque.msg_perm;
struct passwd *pw;
- maxid = msgctl (0, MSG_INFO, (struct msqid_ds *) &msginfo);
+ maxid = msgctl (0, MSG_INFO, (struct msqid_ds *) (void *) &msginfo);
if (maxid < 0) {
printf (_("kernel not configured for message queues\n"));
return;
@@ -499,7 +499,7 @@ void do_msg (char format)
switch (format) {
case LIMITS:
- if ((msgctl (0, IPC_INFO, (struct msqid_ds *) &msginfo)) < 0 )
+ if ((msgctl (0, IPC_INFO, (struct msqid_ds *) (void *) &msginfo)) < 0 )
return;
printf (_("------ Messages: Limits --------\n"));
printf (_("max queues system wide = %d\n"), msginfo.msgmni);
diff --git a/sys-utils/readprofile.1 b/sys-utils/readprofile.1
index 74fff4925..678a5889e 100644
--- a/sys-utils/readprofile.1
+++ b/sys-utils/readprofile.1
@@ -34,8 +34,8 @@ Available command line options are the following:
Specify a mapfile, which by default is
.B /usr/src/linux/System.map.
You should specify the map file on cmdline if your current kernel isn't the
-last one you compiled. If the name of the map file ends with `.gz' it
-is decompressed on the fly.
+last one you compiled, or if you keep System.map elsewhere. If the name of
+the map file ends with `.gz' it is decompressed on the fly.
.TP
.RB -p " pro-file"
diff --git a/sys-utils/readprofile.c b/sys-utils/readprofile.c
index d6ce884e3..de3de946a 100644
--- a/sys-utils/readprofile.c
+++ b/sys-utils/readprofile.c
@@ -132,10 +132,11 @@ main(int argc, char **argv) {
FILE *map;
int proFd;
char *mapFile, *proFile, *mult=0;
- unsigned long len=0, add0=0, indx=1;
+ unsigned long len=0, indx=1;
+ unsigned long long add0=0;
unsigned int step;
unsigned int *buf, total, fn_len;
- unsigned long fn_add, next_add; /* current and next address */
+ unsigned long long fn_add, next_add; /* current and next address */
char fn_name[S_LEN], next_name[S_LEN]; /* current and next name */
char mode[8];
int c;
@@ -292,7 +293,7 @@ main(int argc, char **argv) {
}
while (fgets(mapline,S_LEN,map)) {
- if (sscanf(mapline,"%lx %s %s",&fn_add,mode,fn_name) != 3) {
+ if (sscanf(mapline,"%llx %s %s",&fn_add,mode,fn_name) != 3) {
fprintf(stderr,_("%s: %s(%i): wrong map line\n"),
prgname, mapFile, maplineno);
exit(1);
@@ -316,7 +317,7 @@ main(int argc, char **argv) {
while (fgets(mapline,S_LEN,map)) {
unsigned int this=0;
- if (sscanf(mapline,"%lx %s %s",&next_add,mode,next_name)!=3) {
+ if (sscanf(mapline,"%llx %s %s",&next_add,mode,next_name)!=3) {
fprintf(stderr,_("%s: %s(%i): wrong map line\n"),
prgname,mapFile, maplineno);
exit(1);
@@ -342,7 +343,7 @@ main(int argc, char **argv) {
printf ("%s:\n", fn_name);
header_printed = 1;
}
- printf ("\t%lx\t%u\n", (indx - 1)*step + add0, buf[indx]);
+ printf ("\t%llx\t%u\n", (indx - 1)*step + add0, buf[indx]);
}
this += buf[indx++];
}
@@ -355,7 +356,7 @@ main(int argc, char **argv) {
fn_len = next_add-fn_add;
if (fn_len && (this || optAll)) {
if (optVerbose)
- printf("%08lx %-40s %6i %8.4f\n", fn_add,
+ printf("%016llx %-40s %6i %8.4f\n", fn_add,
fn_name,this,this/(double)fn_len);
else
printf("%6i %-40s %8.4f\n",
@@ -368,7 +369,7 @@ main(int argc, char **argv) {
}
/* trailer */
if (optVerbose)
- printf("%08x %-40s %6i %8.4f\n",
+ printf("%016x %-40s %6i %8.4f\n",
0,"total",total,total/(double)(fn_add-add0));
else
printf("%6i %-40s %8.4f\n",