Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
fd_set_nonblock.c File Reference

Implements OP_FD_SET_NONBLOCK to toggle O_NONBLOCK on a file descriptor. More...

Go to the source code of this file.

Functions

 free_value (onv)
 free_value (fdv)
 push_value (vm, make_int(ok ? 1 :0))

Variables

case OP_FD_SET_NONBLOCK
Value fdv = pop_value(vm)
int ok = 0
void onv
 break

Detailed Description

Implements OP_FD_SET_NONBLOCK to toggle O_NONBLOCK on a file descriptor.

Behavior:

  • Pops on (int, 0/1) and fd (int); sets or clears O_NONBLOCK via fcntl; pushes 1 on success, 0 otherwise.
  • On non-UNIX platforms, returns 0 (unsupported).

Errors:

  • If types are wrong, prints an error and returns 0.

Definition in file fd_set_nonblock.c.

Function Documentation

◆ free_value() [1/2]

free_value(fdv)

◆ free_value() [2/2]

free_value(onv)

◆ push_value()

push_value(vm,
make_int(ok ? 1 :0) )

Variable Documentation

◆ break

break

Definition at line 49 of file fd_set_nonblock.c.

◆ fdv

void fdv = pop_value(vm)

Definition at line 25 of file fd_set_nonblock.c.

◆ ok

int ok = 0

Definition at line 26 of file fd_set_nonblock.c.

◆ onv

void onv

Definition at line 44 of file fd_set_nonblock.c.

◆ OP_FD_SET_NONBLOCK

case OP_FD_SET_NONBLOCK

Definition at line 22 of file fd_set_nonblock.c.