php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
fpm_sockets.h
Go to the documentation of this file.
1 /* (c) 2007,2008 Andrei Nigmatulin */
2
3#ifndef FPM_MISC_H
4#define FPM_MISC_H 1
5
6#include <sys/types.h>
7#include <sys/socket.h>
8#if defined(__FreeBSD__)
9#include <sys/sysctl.h>
10#endif
11#include <sys/un.h>
12#include <unistd.h>
13#include <fcntl.h>
14
15#include "fpm_worker_pool.h"
16
17/*
18 On Linux, FreeBSD, OpenBSD, DragonFlyBSD and macOS, backlog negative values are truncated to SOMAXCONN
19*/
20#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__linux__) || \
21 defined(__DragonFly__) || defined(__APPLE__)
22#define FPM_BACKLOG_DEFAULT -1
23#else
24#define FPM_BACKLOG_DEFAULT 511
25#endif
26
27#define FPM_ENV_SOCKET_SET_MAX 256
28#define FPM_ENV_SOCKET_SET_SIZE 128
29
31int fpm_sockets_init_main(void);
32int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq);
33int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen);
34
35
36static inline int fd_set_blocked(int fd, int blocked) /* {{{ */
37{
38 int flags = fcntl(fd, F_GETFL);
39
40 if (flags < 0) {
41 return -1;
42 }
43
44 if (blocked) {
46 } else {
48 }
49 return fcntl(fd, F_SETFL, flags);
50}
51/* }}} */
52
53#endif
int fpm_sockets_init_main(void)
int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq)
enum fpm_address_domain fpm_sockets_domain_from_address(char *addr)
int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen)
fpm_address_domain
#define O_NONBLOCK
Definition network.c:282
int fd
Definition phpdbg.h:282