1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include <sys/types.h>
5 
6 #include "missing_keyctl.h"
7 
8 /* TAKE_FD but for key_serial_t instead of fds */
9 #define TAKE_KEY_SERIAL(key_serial)                             \
10         ({                                                      \
11                 key_serial_t *_key_serialp_ = &(key_serial);    \
12                 key_serial_t _key_serial_ = *_key_serialp_;     \
13                 *_key_serialp_ = -1;                            \
14                 _key_serial_;                                   \
15         })
16 
17 int keyring_read(key_serial_t serial, void **ret, size_t *ret_size);
18