Server Wait On Clients System - API Documentation  v1.6.4
Server Wait On Clients System.
optionproc.c File Reference

Functions to process server lock flag options. More...

#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include <libmgec/libmgec.h>
#include <libmgec/mge-errno.h>
#include <libmgec/mge-message.h>
#include <swoc/libswoccommon.h>
#include <swoc/libswocserver.h>
Include dependency graph for optionproc.c:

Macros

#define _Bool   signed char
 
#define bool   _Bool
 
#define false   0
 
#define true   1
 
#define __bool_true_false_are_defined   1
 

Functions

int sws_show_status (void)
 Display clients with active locks to stdout. More...
 
int sws_show_block_status (void)
 Display status of server blocking. More...
 
int sws_srv_block (void)
 Request server blocking. More...
 
int sws_srv_unblock (void)
 Request removal of server blocking. More...
 
int sws_show_cli_blocklist (void)
 Display list of blocked clients to stdout. More...
 
int sws_server_wait (void)
 Wait until no client locks remain. More...
 
int sws_release (char *lockname)
 Remove a lock. More...
 
int sws_cli_block (char *blockname)
 Set a client to blocked. More...
 
int sws_cli_unblock (char *blockname)
 Unblock a client block. More...
 
int sws_end_daemon (void)
 Terminate the daemon. More...
 
int sws_reload_config (void)
 Request the daemon to reload the config file. More...
 

Variables

char locks_held [12] = "0"
 Holds the number of clients currently holding locks during sws_server_wait(). More...
 

Detailed Description

Functions to process server lock flag options.

Author
Copyright (C) 2016-2019, 2021, 2022 Mark Grant

Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0-only

Version
v1.1.17 ==== 17/09/2022

Macro Definition Documentation

◆ __bool_true_false_are_defined

#define __bool_true_false_are_defined   1

◆ _Bool

#define _Bool   signed char

◆ bool

#define bool   _Bool

◆ false

#define false   0

◆ true

#define true   1

Function Documentation

◆ sws_cli_block()

int sws_cli_block ( char *  blockname)

Set a client to blocked.

On error mge_errno is set.

Parameters
blocknameClient to block.
Returns
0 on success, < zero on failure.

◆ sws_cli_unblock()

int sws_cli_unblock ( char *  blockname)

Unblock a client block.

On error mge_errno is set.

Parameters
blocknameClient to unblock.
Returns
0 on success, < zero on failure.

◆ sws_end_daemon()

int sws_end_daemon ( void  )

Terminate the daemon.

Send a message to the daemon asking it to terminate. On error mge_errno is set.

Returns
0 on success, < zero on failure.

◆ sws_release()

int sws_release ( char *  lockname)

Remove a lock.

On error mge_errno is set.

Parameters
locknameClient whose lock is to be removed.
Returns
0 on success, < zero on failure.

◆ sws_reload_config()

int sws_reload_config ( void  )

Request the daemon to reload the config file.

Send a message to the daemon asking it to reload it's configuration file. On error mge_errno is set.

Returns
0 on success, < zero on failure.

◆ sws_server_wait()

int sws_server_wait ( void  )

Wait until no client locks remain.

On error mge_errno is set.

Returns
0 on success, < zero on failure.

◆ sws_show_block_status()

int sws_show_block_status ( void  )

Display status of server blocking.

On error mge_errno is set.

Returns
0 on success, < zero on failure.

◆ sws_show_cli_blocklist()

int sws_show_cli_blocklist ( void  )

Display list of blocked clients to stdout.

On error mge_errno is set.

Returns
The number of blocked or < zero on error.

◆ sws_show_status()

int sws_show_status ( void  )

Display clients with active locks to stdout.

On error mge_errno is set.

Returns
The number of clients with locks or < zero on error.

◆ sws_srv_block()

int sws_srv_block ( void  )

Request server blocking.

On error mge_errno is set.

Returns
0 on success, < zero on failure.

◆ sws_srv_unblock()

int sws_srv_unblock ( void  )

Request removal of server blocking.

On error mge_errno is set.

Returns
0 on success, < zero on failure.

Variable Documentation

◆ locks_held

char locks_held[12] = "0"

Holds the number of clients currently holding locks during sws_server_wait().

Holds the number of locks currently held during swc_client_wait().

This value can be accessed in a handler if a signal is received.