tmux  3.2a
About: tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal.
  Fossies Dox: tmux-3.2a.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

proc.c File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/utsname.h>
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "tmux.h"
Include dependency graph for proc.c:

Go to the source code of this file.

Data Structures

struct  tmuxproc
struct  tmuxpeer


#define PEER_BAD   0x1


static int peer_check_version (struct tmuxpeer *, struct imsg *)
static void proc_update_event (struct tmuxpeer *)
static void proc_event_cb (int fd, short events, void *arg)
static void proc_signal_cb (int signo, short events, void *arg)
int proc_send (struct tmuxpeer *peer, enum msgtype type, int fd, const void *buf, size_t len)
struct tmuxprocproc_start (const char *name)
void proc_loop (struct tmuxproc *tp, int(*loopcb)(void))
void proc_exit (struct tmuxproc *tp)
void proc_set_signals (struct tmuxproc *tp, void(*signalcb)(int))
void proc_clear_signals (struct tmuxproc *tp, int defaults)
struct tmuxpeerproc_add_peer (struct tmuxproc *tp, int fd, void(*dispatchcb)(struct imsg *, void *), void *arg)
void proc_remove_peer (struct tmuxpeer *peer)
void proc_kill_peer (struct tmuxpeer *peer)
void proc_toggle_log (struct tmuxproc *tp)
pid_t proc_fork_and_daemon (int *fd)

Macro Definition Documentation


#define PEER_BAD   0x1

Definition at line 61 of file proc.c.

Function Documentation

◆ peer_check_version()

static int peer_check_version ( struct tmuxpeer peer,
struct imsg *  imsg 

Definition at line 130 of file proc.c.

References tmuxpeer::flags, log_debug(), MSG_VERSION, PEER_BAD, proc_send(), and PROTOCOL_VERSION.

Referenced by proc_event_cb().

◆ proc_add_peer()

struct tmuxpeer* proc_add_peer ( struct tmuxproc tp,
int  fd,
void(*)(struct imsg *, void *)  dispatchcb,
void *  arg 

◆ proc_clear_signals()

void proc_clear_signals ( struct tmuxproc tp,
int  defaults 

◆ proc_event_cb()

static void proc_event_cb ( int  fd,
short  events,
void *  arg 

◆ proc_exit()

void proc_exit ( struct tmuxproc tp)

◆ proc_fork_and_daemon()

pid_t proc_fork_and_daemon ( int *  fd)

Definition at line 354 of file proc.c.

References daemon(), and fatal().

Referenced by server_start().

◆ proc_kill_peer()

void proc_kill_peer ( struct tmuxpeer peer)

Definition at line 342 of file proc.c.

References tmuxpeer::flags, and PEER_BAD.

Referenced by server_client_dispatch_shell().

◆ proc_loop()

void proc_loop ( struct tmuxproc tp,
int(*)(void)  loopcb 

Definition at line 216 of file proc.c.

References tmuxproc::exit, log_debug(), and tmuxproc::name.

Referenced by client_main(), and server_start().

◆ proc_remove_peer()

void proc_remove_peer ( struct tmuxpeer peer)

Definition at line 329 of file proc.c.

References tmuxpeer::event, tmuxpeer::ibuf, log_debug(), and tmuxpeer::parent.

Referenced by server_client_lost().

◆ proc_send()

◆ proc_set_signals()

◆ proc_signal_cb()

static void proc_signal_cb ( int  signo,
short  events,
void *  arg 

Definition at line 122 of file proc.c.

References tmuxproc::signalcb.

Referenced by proc_set_signals().

◆ proc_start()

struct tmuxproc* proc_start ( const char *  name)

◆ proc_toggle_log()

void proc_toggle_log ( struct tmuxproc tp)

Definition at line 348 of file proc.c.

References log_toggle(), and tmuxproc::name.

Referenced by server_signal().

◆ proc_update_event()

static void proc_update_event ( struct tmuxpeer peer)

Definition at line 147 of file proc.c.

References tmuxpeer::event, tmuxpeer::ibuf, and proc_event_cb().

Referenced by proc_add_peer(), proc_event_cb(), and proc_send().