PatchworkOS  966e257
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 64-bit one-time use randomly generated token that globally identifies a shared file.

Data Structures

struct  key_entry_t
 Key entry. More...
 

Functions

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

Function Documentation

◆ key_share()

uint64_t key_share ( key_t key,
file_t file,
clock_t  timeout 
)

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

Parameters
keyOutput pointer to store the generated key.
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 62 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 ( key_t key)

Claims a shared file using the provided key.

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

Definition at line 142 of file key.c.

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