return ret;
}
-#define uid_hash_bits 8
-uint32_t uid_hash_table_size = 1 << uid_hash_bits;
#define PRIME1 0x811c9dc5
#define PRIME2 0x01000193
-void create_hash_table(void)
+uint32_t uid_hash_table_size;
+void create_hash_table(unsigned bits)
{
- uid_hash_table = adu_calloc(uid_hash_table_size
- * sizeof(struct user_info));
+ uid_hash_table_size = 1 << bits;
+ uid_hash_table = adu_calloc(uid_hash_table_size *
+ sizeof(struct user_info));
}
static void free_hash_table(void)
one that the argument being processed is on.
"
+option "hash-table-bits" -
+#~~~~~~~~~~~~~~~~~~~~~~~~~
+"specify the size of the uid hash table"
+int typestr="num"
+dependon="create"
+default="10"
+optional
+details="
+ Use a hash table of size 2^num for the uid entries. If more than
+ 2^num different uids own at least one regular file under base-dir,
+ the command fails. Increase this value if you have more than 1024
+ users. Decreasing the value causes adu to use slightly less memory.
+"
+
+
##############################
section "Options for --select"
##############################
void check_signals(void);
void close_all_tables(void);
char *get_uid_list_name(void);
-void create_hash_table(void);
+void create_hash_table(unsigned bits);
int search_uid(uint32_t uid, enum search_uid_flags flags,
struct user_info **ui_ptr);