Page 855 shutdownshutdownShuts down part of a full-duplex connection SYPNOSIS #include <sys/socket.h> int shutdown(int s,int how); DESCRIPTION The shutdown call causes all or part of a full-duplex connection on the socket associated with s to be shut down. If how is 0, further receives will be disallowed. If how is 1, further sends will be disallowed. If how is 2, further sends and receives will be disallowed. RETURN VALUE On success, 0 is returned. On error, _1 is returned, and errno is set appropriately. ERRORS
HISTORY The shutdown function call appeared in BSD 4.2. SEE ALSO connect(2), socket(2) BSD Man Page, 24 July 1993 sigaction, sigprocmask, sigpending, sigsuspendsigaction, sigprocmask, sigpending, sigsuspendPOSIX signal-handling functions. SYPNOSIS #include <signal.h> int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); int sigprocmask(int how, const sigset_t *set, sigset_t *oldset); int sigpending(sigset_t *set); int sigsuspend(const sigset_t *mask); DESCRIPTION The sigaction system call is used to change the action taken by a process on receipt of a specific signal. signum specifies the signal and can be any valid signal except SIGKILL and SIGSTOP. If act is non_null, the new action for signal signum is installed from act. If oldact is non_null, the previous action is saved in oldact. The sigaction structure is defined as struct sigaction { void (*sa_handler)(int); sigset_t sa_mask; int sa_flags; Page 856 void (*sa_restorer)(void); } sa_handler specifies the action to be associated with signum and can be SIG_DFL for the default action, SIG_IGN to ignore this signal, or a pointer to a signal-handling function. sa_mask gives a mask of signals that should be blocked during execution of the signal handler. In addition, the signal that triggered the handler will be blocked unless the SA_NODEFER or SA_NOMASK flag is used. sa_flags specifies a set of flags that modify the behavior of the signal-handling process. It is formed by the bitwise OR of zero or more of the following:
The sa_restorer element is obsolete and should not be used. The sigprocmask call is used to change the list of currently blocked signals. The behavior of the call is dependent on the value of how, as follows:
If oldset is non_null, the previous value of the signal mask is stored in oldset. The sigpending call allows the examination of pending signals (those that have been raised while blocked). The signal mask of pending signals is stored in set. The sigsuspend call temporarily replaces the signal mask for the process with that given by mask and then suspends the process until a signal is received. RETURN VALUES sigaction, sigprocmask, sigpending, and sigsuspend return 0 on success and -1 on error. ERRORS
NOTES It is not possible to block SIGKILL or SIGSTOP with the sigprocmask call. Attempts to do so will be silently ignored. Setting SIGCHLD to SIG_IGN provides automatic reaping of child processes. The POSIX spec only defines SA_NOCLDSTOP. Use of other sa flags is non_portable. The SA_RESETHAND flag is compatible with the SVR4 flag of the same name. |