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>
#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"
key_t create_key(void)
{
- srandom(time(NULL));
+ struct timeval now;
+ gettimeofday(&now, NULL);
+ srandom(now.tv_usec);
return random();
}