diff options
author | Sami Kerola | 2011-09-12 22:01:03 +0200 |
---|---|---|
committer | Sami Kerola | 2011-09-17 15:07:52 +0200 |
commit | b332ef44cfaf226140c7e47e4fefbbe602676519 (patch) | |
tree | 9e336d75e5b7e1f25a232c7ac91c640e600a0dff /sys-utils/ipcmk.c | |
parent | ipcrm: add --all option (diff) | |
download | kernel-qcow2-util-linux-b332ef44cfaf226140c7e47e4fefbbe602676519.tar.gz kernel-qcow2-util-linux-b332ef44cfaf226140c7e47e4fefbbe602676519.tar.xz kernel-qcow2-util-linux-b332ef44cfaf226140c7e47e4fefbbe602676519.zip |
ipcmk: allow high speed ipc creation
This commit will allow user to create quickly plenty of ipc
resources. Earlier the line bellow gave no satisfaction.
for i in $(seq 0 42); do ipcmk -Q; done
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/ipcmk.c')
-rw-r--r-- | sys-utils/ipcmk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c index b4bc5be19..c91908bde 100644 --- a/sys-utils/ipcmk.c +++ b/sys-utils/ipcmk.c @@ -28,7 +28,7 @@ #include <sys/msg.h> #include <sys/sem.h> #include <sys/shm.h> -#include <time.h> +#include <sys/time.h> #include "c.h" #include "nls.h" @@ -36,7 +36,9 @@ key_t create_key(void) { - srandom(time(NULL)); + struct timeval now; + gettimeofday(&now, NULL); + srandom(now.tv_usec); return random(); } |