ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
system.c File Reference

System utilities (environment) for WASM/Emscripten. More...

Go to the source code of this file.

Functions

const char * platform_getenv (const char *name)
 
const char * platform_strerror (int errnum)
 
int platform_setenv (const char *name, const char *value)
 
int platform_unsetenv (const char *name)
 
pid_t platform_get_pid (void)
 

Detailed Description

System utilities (environment) for WASM/Emscripten.

Definition in file wasm/system.c.

Function Documentation

◆ platform_get_pid()

pid_t platform_get_pid ( void  )

Definition at line 35 of file wasm/system.c.

35 {
36 return 1; // WASM runs in browser - no process ID concept
37}

Referenced by asciichat_instr_runtime_get(), and options_state_init().

◆ platform_getenv()

const char * platform_getenv ( const char *  name)

Definition at line 13 of file wasm/system.c.

13 {
14 (void)name;
15 // Environment variables not supported in WASM browser context
16 // Calling getenv() causes "memory access out of bounds" errors
17 return NULL;
18}

Referenced by client_audio_pipeline_process_duplex(), client_crypto_handshake(), crypto_handshake_client_key_exchange(), ed25519_verify_signature(), get_discovery_database_dir(), parse_ssh_private_key(), path_validate_user_path(), and prompt_unknown_host().

◆ platform_setenv()

int platform_setenv ( const char *  name,
const char *  value 
)

Definition at line 24 of file wasm/system.c.

24 {
25 (void)name;
26 (void)value;
27 return -1; // Not supported in WASM
28}

Referenced by __attribute__().

◆ platform_strerror()

const char * platform_strerror ( int  errnum)

Definition at line 20 of file wasm/system.c.

20 {
21 return strerror(errnum);
22}

Referenced by file_read_error_message(), and file_write_error_message().

◆ platform_unsetenv()

int platform_unsetenv ( const char *  name)

Definition at line 30 of file wasm/system.c.

30 {
31 (void)name;
32 return -1; // Not supported in WASM
33}