5 /* chunks of 64KB to be added to blob-buffer */
6 #define BUFF_SIZE 0x10000
7 /* exceed maximum blob buff-length */
8 #define BUFF_CHUNKS (((BLOB_ATTR_LEN_MASK + 1) / BUFF_SIZE) + 1)
10 int main(int argc
, char **argv
)
13 static struct blob_buf buf
;
14 blobmsg_buf_init(&buf
);
15 int prev_len
= buf
.buflen
;
17 for (i
= 0; i
< BUFF_CHUNKS
; i
++) {
18 struct blob_attr
*attr
= blob_new(&buf
, 0, BUFF_SIZE
);
20 fprintf(stderr
, "SUCCESS: failed to allocate attribute\n");
23 if (prev_len
< buf
.buflen
) {
24 prev_len
= buf
.buflen
;
27 fprintf(stderr
, "ERROR: buffer length did not increase\n");