ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
system.c File Reference

Go to the source code of this file.

Functions

int platform_execute_subprocess (const char *executable, const char **argv, char *output_buffer, size_t output_size, bool(*cancel)(void *), void *data)
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)
ssize_t platform_write (int fd, const void *buf, size_t count)

Function Documentation

◆ platform_execute_subprocess()

int platform_execute_subprocess ( const char * executable,
const char ** argv,
char * output_buffer,
size_t output_size,
bool(* cancel )(void *),
void * data )

Definition at line 35 of file system.c.

35 {
36 (void)executable;
37 (void)argv;
38 (void)output_buffer;
39 (void)output_size;
40 (void)cancel;
41 (void)data;
42 return -1;
43}

Referenced by gpg_sign_with_key(), update_banner_install_update(), update_check_get_aur_helper(), yt_dlp_extract_with_options(), and yt_dlp_is_available().

◆ platform_get_pid()

pid_t platform_get_pid ( void )

Definition at line 67 of file system.c.

67 {
68 return 1; // WASM runs in browser - no process ID concept
69}

Referenced by asciichat_instr_runtime_get(), and options_state_init().

◆ platform_getenv()

const char * platform_getenv ( const char * name)

Definition at line 45 of file system.c.

45 {
46 (void)name;
47 // Environment variables not supported in WASM browser context
48 // Calling getenv() causes "memory access out of bounds" errors
49 return NULL;
50}

Referenced by client_audio_pipeline_process_duplex(), crypto_handshake_client_key_exchange(), ed25519_verify_signature(), http_renderer_process(), path_validate_user_path(), and prompt_unknown_host().

◆ platform_setenv()

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

Definition at line 56 of file system.c.

56 {
57 (void)name;
58 (void)value;
59 return -1; // Not supported in WASM
60}

Referenced by __attribute__(), and env_pop_prompt_response().

◆ platform_strerror()

const char * platform_strerror ( int errnum)

Definition at line 52 of file system.c.

52 {
53 return strerror(errnum);
54}

Referenced by config_load_and_apply().

◆ platform_unsetenv()

int platform_unsetenv ( const char * name)

Definition at line 62 of file system.c.

62 {
63 (void)name;
64 return -1; // Not supported in WASM
65}

Referenced by env_pop_prompt_response().

◆ platform_write()

ssize_t platform_write ( int fd,
const void * buf,
size_t count )

Override platform_write to route STDOUT

Definition at line 78 of file system.c.

78 {
79 if (!buf || count == 0) {
80 // Don't warn about these - it's a valid case (empty write)
81 return 0;
82 }
83
84 // Use the default write()
85 return write(fd, buf, count);
86}