123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /* shttpd - functions for control threads
- Copyright (C) 2018 Ariadne Devos
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
- #ifndef _sHT_CONTROL_H
- #define _sHT_CONTROL_H
- struct sHT_node
- {
- union {
- /* Only for killing misbehaving processes */
- int pid_err;
- /* Only for sHT_start_worker */
- int worker_fd_err;
- };
- /* Our end of it. A non-blocking SOCK_SEQPACKET, UNIX domain socket. */
- int controlfd;
- };
- /* errno values vary by architecture */
- enum sHT_node_errno
- {
- sHT_NODE_OTHER = 0,
- sHT_NODE_EINVAL,
- sHT_NODE_EMFILE,
- sHT_NODE_ENFILE,
- sHT_NODE_EAGAIN,
- sHT_NODE_ENOMEM,
- sHT_NODE_EPERM,
- };
- /* Possible error values:
- -EINVAL (bug)
- -EMFILE (process file descriptor limit)
- -ENFILE (process file descriptor limit)
- -EAGAIN (too many processes)
- -ENOMEM (lack of kernel memory)
- -EPERM (not allowed, configuration bug)
- Others that are not listed in the man pages
- */
- struct sHT_node
- sHT_start_worker(int workerfd);
- #endif
|