#include "fd.h"
#include "string.h"
#include "error.h"
-#include "portable_io.h"
+#include "user.h"
+#include "select.cmdline.h"
/* global list */
#define GLOBAL_LIST_ATOMS \
return -ERRNO_TO_ERROR(-EINVAL);
}
-static int read_uid_file(struct uid_range *admissible_uids)
-{
- size_t size;
- uint32_t n;
- char *filename = get_uid_list_name(), *map;
- int ret = mmap_full_file(filename, O_RDONLY, (void **)&map, &size, NULL);
- unsigned bits;
-
- if (ret < 0) {
- INFO_LOG("failed to map %s\n", filename);
- free(filename);
- return ret;
- }
- num_uids = size / 4;
- INFO_LOG("found %u uids in %s\n", (unsigned)num_uids, filename);
- free(filename);
- /*
- * Compute number of hash table bits. The hash table size must be a
- * power of two and larger than the number of uids.
- */
- bits = 2;
- while (1 << bits < num_uids)
- bits++;
- create_hash_table(bits);
- for (n = 0; n < num_uids; n++) {
- uint32_t uid = read_u32(map + n * sizeof(uid));
- ret = search_uid(uid, admissible_uids, OPEN_USER_TABLE, NULL);
- if (ret < 0)
- goto out;
- }
-out:
- adu_munmap(map, size);
- return ret;
-}
-
int run_select_query(struct uid_range *admissible_uids, struct format_info *fi)
{
int ret;