#include "nsd.h"#include <pwd.h>#include <grp.h>Functions | |
| void | NsBlockSignals (int debug) |
| void | NsRestoreSignals (void) |
| void | NsHandleSignals (void) |
| void | NsSendSignal (int sig) |
| int | Ns_GetUserHome (Ns_DString *pds, char *user) |
| int | Ns_GetGid (char *group) |
| int | Ns_GetUserGid (char *user) |
| int | Ns_GetUid (char *user) |
| int Ns_GetGid | ( | char * | group | ) |
---------------------------------------------------------------------- Ns_GetGid --
Get the group id from a group name.
Results: Group id or -1 if not found.
Side effects: None.
----------------------------------------------------------------------
| int Ns_GetUid | ( | char * | user | ) |
---------------------------------------------------------------------- Ns_GetUid --
Get user id for a user name.
Results: Return NS_TRUE if user name is found in /etc/passwd file and NS_FALSE otherwise.
Side effects: None.
----------------------------------------------------------------------
| int Ns_GetUserGid | ( | char * | user | ) |
---------------------------------------------------------------------- Ns_GetUserGid --
Get the group id for a user name
Results: Returns group id of the user name found in /etc/passwd or -1 otherwise.
Side effects: None.
----------------------------------------------------------------------
| int Ns_GetUserHome | ( | Ns_DString * | pds, | |
| char * | user | |||
| ) |
---------------------------------------------------------------------- Ns_GetUserHome --
Get the home directory name for a user name
Results: Return NS_TRUE if user name is found in /etc/passwd file and NS_FALSE otherwise.
Side effects: None.
----------------------------------------------------------------------
| void NsBlockSignals | ( | int | debug | ) |
----------------------------------------------------------------------
NsBlockSignals --
Block signals at startup.
Results: None.
Side effects: Signals will be pending until NsHandleSignals.
----------------------------------------------------------------------
Block SIGHUP, SIGPIPE, SIGTERM, and SIGINT. This mask is inherited by all subsequent threads so that only this thread will catch the signals in the sigwait() loop below. Unfortunately this makes it impossible to kill the server with a signal other than SIGKILL until startup is complete.
NB: Don't block SIGINT in debug mode for Solaris dbx.
Make sure "synchronous" signals (those generated by execution errors like SIGSEGV or SIGILL which get delivered to the thread that caused them) have an appropriate handler installed.
| void NsHandleSignals | ( | void | ) |
----------------------------------------------------------------------
NsHandleSignals --
Loop forever processing signals until a term signal is received.
Results: None.
Side effects: HUP callbacks may be called.
----------------------------------------------------------------------
Wait endlessly for trigger wakeups.
Unblock the signals and exit.
| void NsRestoreSignals | ( | void | ) |
---------------------------------------------------------------------- NsRestoreSignals --
Restore all signals to their default value.
Results: None.
Side effects: A new thread will be created.
----------------------------------------------------------------------
| void NsSendSignal | ( | int | sig | ) |
----------------------------------------------------------------------
NsSendSignal --
Send a signal to the main thread.
Results: None.
Side effects: Main thread in NsHandleSignals will wakeup.
----------------------------------------------------------------------
1.5.1