PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches

Keys for sharing file descriptors between processes. More...

Collaboration diagram for Keys:

Detailed Description

Keys for sharing file descriptors between processes.

Keys are used with the share() and claim() system calls to send files between processes.

Each key is a one-time use randomly generated base64URL encoded string that globally identifies a shared file.

See also
https://en.wikipedia.org/wiki/Base64

Data Structures

struct  key_entry_t
 Key entry. More...
 

Functions

uint64_t key_share (char *key, uint64_t size, file_t *file, clock_t timeout)
 Generates a key that can be used to retrieve the file within the specified timeout.
 
file_tkey_claim (const char *key)
 Claims a shared file using the provided key.
 

Function Documentation

◆ key_share()

uint64_t key_share ( char *  key,
uint64_t  size,
file_t file,
clock_t  timeout 
)

Generates a key that can be used to retrieve the file within the specified timeout.

Parameters
keyOutput buffer to store the generated key.
sizeThe size of the output buffer.
fileThe file to share.
timeoutThe time until the shared file expires. If CLOCKS_NEVER, it never expires.
Returns
On success, a key that can be used to claim the file. On failure, ERR and errno is set.

Definition at line 87 of file key.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ key_claim()

file_t * key_claim ( const char *  key)

Claims a shared file using the provided key.

Parameters
keyThe key identifying the shared file.
Returns
On success, the claimed file. On failure, NULL and errno is set.

Definition at line 148 of file key.c.

Here is the call graph for this function:
Here is the caller graph for this function: