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

Implements OP_SOCK_UNIX_LISTEN to create a UNIX domain listening socket. More...

Go to the source code of this file.

Functions

 free_value (backlogv)
 free_value (pathv)
 push_value (vm, make_int(fd > 0 ? fd :0))

Variables

case OP_SOCK_UNIX_LISTEN
Value pathv = pop_value(vm)
int fd = 0
 break

Detailed Description

Implements OP_SOCK_UNIX_LISTEN to create a UNIX domain listening socket.

Behavior:

  • Pops path (string); creates/binds/listens on AF_UNIX socket; pushes fd (>0) or 0 on failure.
  • The path may be unlinked before bind to avoid EADDRINUSE.

Errors:

  • On wrong type or OS errors, prints an error and pushes 0. Non-UNIX platforms return 0.

Definition in file socket_unix_listen.c.

Function Documentation

◆ free_value() [1/2]

free_value(backlogv)

◆ free_value() [2/2]

free_value(pathv)

◆ push_value()

push_value(vm,
make_int(fd > 0 ? fd :0) )

Variable Documentation

◆ break

break

Definition at line 63 of file socket_unix_listen.c.

◆ fd

int fd = 0

Definition at line 26 of file socket_unix_listen.c.

◆ OP_SOCK_UNIX_LISTEN

case OP_SOCK_UNIX_LISTEN

Definition at line 22 of file socket_unix_listen.c.

◆ pathv

Value pathv = pop_value(vm)

Definition at line 25 of file socket_unix_listen.c.