Searched refs:size (Results 1 - 25 of 149) sorted by relevance

123456

/systemd/src/basic/
H A Dstrxcpyx.c23 * Returns the * remaining size, and 0 if the string was truncated.
32 size_t strpcpy(char **dest, size_t size, const char *src) { argument
36 if (len >= size) {
37 if (size > 1)
38 *dest = mempcpy(*dest, src, size-1);
39 size = 0;
43 size -= len;
47 return size;
50 size_t strpcpyf(char **dest, size_t size, const char *src, ...) { argument
55 i = vsnprintf(*dest, size, sr
68 strpcpyl(char **dest, size_t size, const char *src, ...) argument
80 strscpy(char *dest, size_t size, const char *src) argument
87 strscpyl(char *dest, size_t size, const char *src, ...) argument
[all...]
H A Dstrxcpyx.h27 size_t strpcpy(char **dest, size_t size, const char *src);
28 size_t strpcpyf(char **dest, size_t size, const char *src, ...) _printf_(3, 4);
29 size_t strpcpyl(char **dest, size_t size, const char *src, ...) _sentinel_;
30 size_t strscpy(char *dest, size_t size, const char *src);
31 size_t strscpyl(char *dest, size_t size, const char *src, ...) _sentinel_;
H A Dalloc-util.c40 void* greedy_realloc(void **p, size_t *allocated, size_t need, size_t size) { argument
50 newalloc = MAX(need * 2, 64u / size);
51 a = newalloc * size;
54 if (a < size * need)
66 void* greedy_realloc0(void **p, size_t *allocated, size_t need, size_t size) { argument
75 q = greedy_realloc(p, allocated, need, size);
80 memzero(q + prev * size, (*allocated - prev) * size);
H A Dformats-util.h29 # error Unknown pid_t size
38 # error Unknown uid_t size
46 # error Unknown gid_t size
54 # error Unknown time_t size
62 # error Unknown rlim_t size
H A Dalloc-util.h75 void* greedy_realloc(void **p, size_t *allocated, size_t need, size_t size);
76 void* greedy_realloc0(void **p, size_t *allocated, size_t need, size_t size);
93 #define alloca_align(size, align) \
97 _ptr_ = alloca((size) + _mask_); \
101 #define alloca0_align(size, align) \
104 size_t _size_ = (size); \
H A Dmemfd-util.h30 int memfd_map(int fd, uint64_t offset, size_t size, void **p);
H A Dmempool.c54 size_t size; local
59 size = PAGE_ALIGN(ALIGN(sizeof(struct pool)) + n*mp->tile_size);
60 n = (size - ALIGN(sizeof(struct pool))) / mp->tile_size;
62 p = malloc(size);
/systemd/src/libsystemd/sd-bus/
H A Dbus-bloom.h37 #define DEFAULT_BLOOM_SIZE (512/8) /* m: filter size */
40 void bloom_add_pair(uint64_t filter[], size_t size, unsigned n_hash, const char *a, const char *b);
41 void bloom_add_prefixes(uint64_t filter[], size_t size, unsigned n_hash, const char *a, const char *b, char sep);
43 bool bloom_validate_parameters(size_t size, unsigned n_hash);
H A Dbus-bloom.c41 size_t size, /* Size of the filter in bytes */
51 assert(size > 0);
55 m = size * 8;
88 void bloom_add_pair(uint64_t filter[], size_t size, unsigned k, const char *a, const char *b) { argument
100 bloom_add_data(filter, size, k, c, n);
103 void bloom_add_prefixes(uint64_t filter[], size_t size, unsigned k, const char *a, const char *b, char sep) { argument
117 bloom_add_data(filter, size, k, c, n);
127 bloom_add_data(filter, size, k, c, e - c + 1);
133 bloom_add_data(filter, size, k, c, e - c);
137 bool bloom_validate_parameters(size_t size, unsigne argument
39 bloom_add_data( uint64_t filter[], size_t size, unsigned k, const void *data, size_t n) argument
[all...]
H A Dbus-introspect.h31 size_t size; member in struct:introspect
H A Dbus-kernel.c82 (*d)->size = offsetof(struct kdbus_item, vec) + sizeof(struct kdbus_vec);
85 (*d)->vec.size = sz;
87 *d = (struct kdbus_item *) ((uint8_t*) *d + (*d)->size);
96 (*d)->size = offsetof(struct kdbus_item, memfd) + sizeof(struct kdbus_memfd);
100 (*d)->memfd.size = sz;
102 *d = (struct kdbus_item *) ((uint8_t*) *d + (*d)->size);
111 (*d)->size = offsetof(struct kdbus_item, str) + length + 1;
115 *d = (struct kdbus_item *) ((uint8_t*) *d + (*d)->size);
125 i->size = offsetof(struct kdbus_item, bloom_filter) +
130 *d = (struct kdbus_item *) ((uint8_t*) i + i->size);
148 add_bloom_arg(void *data, size_t size, unsigned n_hash, unsigned i, const char *t) argument
174 add_bloom_arg_has(void *data, size_t size, unsigned n_hash, unsigned i, const char *t) argument
1473 close_and_munmap(int fd, void *address, size_t size) argument
[all...]
/systemd/src/shared/
H A Dmachine-pool.h29 int setup_machine_directory(uint64_t size, sd_bus_error *error);
H A Dtest-tables.h29 int size,
33 for (i = -1; i < size + 1; i++) {
45 if (boring < 1 || i == size)
50 assert_se(!(i >= 0 && i < size ?
26 _test_table(const char *name, lookup_t lookup, reverse_t reverse, int size, bool sparse) argument
/systemd/src/journal-remote/
H A Djournal-upload-journal.c30 * Write up to size bytes to buf. Return negative on error, and number of
33 static ssize_t write_entry(char *buf, size_t size, Uploader *u) { argument
37 assert(size <= SSIZE_MAX);
49 r = snprintf(buf + pos, size - pos,
51 if (pos + r > size)
57 if (pos + r == size) {
59 buf[size - 1] = '\n';
60 return size;
73 r = snprintf(buf + pos, size - pos,
75 if (r + pos > size)
245 journal_input_callback(void *buf, size_t size, size_t nmemb, void *userp) argument
[all...]
H A Djournal-remote-parse.c76 static char* realloc_buffer(RemoteSource *source, size_t size) { argument
79 b = GREEDY_REALLOC(source->buf, source->size, size);
88 static int get_line(RemoteSource *source, char **line, size_t *size) { argument
95 assert(source->filled <= source->size);
96 assert(source->buf == NULL || source->size > 0);
120 we reallocate it, we'll increase the size at least a bit. */
122 if (source->size - source->filled < LINE_CHUNK &&
127 assert(source->size - source->filled >= LINE_CHUNK ||
128 source->size
152 push_data(RemoteSource *source, const char *data, size_t size) argument
169 fill_fixed_size(RemoteSource *source, void **data, size_t size) argument
[all...]
H A Djournal-remote-parse.h40 size_t size; /* total size of the buffer */ member in struct:RemoteSource
46 size_t data_size; /* and the size of the binary data chunk being processed */
68 int push_data(RemoteSource *source, const char *data, size_t size);
/systemd/src/journal/
H A Dtest-compress-benchmark.c104 size_t j = 0, k = 0, size; local
107 size = permute(i);
109 log_debug("%s %zu %zu", type, i, size);
111 memzero(buf, MIN(size + 1000, MAX_SIZE));
113 r = compress(text, size, buf, size, &j);
115 assert_se(r == 0 || (size < 2048 && r == -ENOBUFS) || streq(type, "random"));
118 assert_se(buf[size] == 0);
120 skipped += size;
125 if (j >= size)
[all...]
/systemd/src/core/
H A Dbus-endpoint.c34 size_t size; local
37 size = ALIGN8(offsetof(struct kdbus_cmd, items));
40 size += ALIGN8(offsetof(struct kdbus_item, str) + strlen(po->name) + 1);
41 size += ALIGN8(offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access));
44 update = alloca0_align(size, 8);
45 update->size = size;
51 n->size = offsetof(struct kdbus_item, str) + strlen(po->name) + 1;
56 n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access);
H A Dbus-policy.c101 struct kdbus_cmd_free cmd_free = { .size = sizeof(cmd_free) };
106 size_t size; local
118 size = offsetof(struct kdbus_cmd_hello, items) +
122 hello = alloca0_align(size, 8);
126 n->size = offsetof(struct kdbus_item, str) + strlen(n->str) + 1;
132 n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access);
143 n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access);
148 hello->size = size;
/systemd/src/libsystemd-network/
H A Dnetwork-internal.c338 void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) { argument
343 assert(size);
345 for (i = 0; i < size; i++)
347 (i < (size - 1)) ? " ": "");
352 int size = 0; local
364 new_addresses = realloc(addresses, (size + 1) * sizeof(struct in_addr));
374 r = inet_pton(AF_INET, addr_str, &(addresses[size]));
378 size ++;
384 return size;
388 size_t size) {
387 serialize_in6_addrs(FILE *f, const struct in6_addr *addresses, size_t size) argument
403 int size = 0; local
438 serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size) argument
465 size_t size = 0, allocated = 0; local
532 serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size) argument
[all...]
H A Ddhcp-option.c30 static int option_append(uint8_t options[], size_t size, size_t *offset, argument
37 size --;
43 if (size < *offset + 1)
51 if (size < *offset + optlen + 2)
71 int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset, argument
84 if (*offset < size) {
86 r = option_append(message->options, size, offset, code, optlen, optval);
92 r = option_append(message->options, size, offset, SD_DHCP_OPTION_END, 0, NULL);
96 *offset = size;
102 file_offset = *offset - size;
[all...]
H A Dnetwork-internal.h68 void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size);
71 size_t size);
77 void serialize_dhcp_routes(FILE *f, const char *key, sd_dhcp_route **routes, size_t size);
80 int serialize_dhcp_option(FILE *f, const char *key, const void *data, size_t size);
/systemd/src/import/
H A Dimport-compress.h49 typedef int (*ImportCompressCallback)(const void *data, size_t size, void *userdata);
53 int import_uncompress_detect(ImportCompress *c, const void *data, size_t size);
54 int import_uncompress(ImportCompress *c, const void *data, size_t size, ImportCompressCallback callback, void *userdata);
57 int import_compress(ImportCompress *c, const void *data, size_t size, void **buffer, size_t *buffer_size, size_t *buffer_allocated);
/systemd/src/network/
H A Dtest-network.c30 int size; local
43 assert_se((size = deserialize_in_addrs(&addresses, addresses_string)) >= 0);
44 assert_se(size == 3);
49 assert_se((size = deserialize_in6_addrs(&addresses6, addresses_string)) >= 0);
50 assert_se(size == 3);
57 size_t size, allocated; local
61 assert_se(deserialize_dhcp_routes(&routes, &size, &allocated, "") >= 0);
62 assert_se(size == 0);
70 assert_se(deserialize_dhcp_routes(&routes, &size, &allocated, routes_string) >= 0);
72 assert_se(size
[all...]
/systemd/src/boot/efi/
H A Dutil.h35 EFI_STATUS efivar_set_raw(const EFI_GUID *vendor, CHAR16 *name, CHAR8 *buf, UINTN size, BOOLEAN persistent);
40 EFI_STATUS efivar_get_raw(const EFI_GUID *vendor, CHAR16 *name, CHAR8 **buffer, UINTN *size);
47 INTN file_read(EFI_FILE_HANDLE dir, CHAR16 *name, UINTN off, UINTN size, CHAR8 **content);

Completed in 75 milliseconds

123456