~ubuntu-branches/ubuntu/trusty/nginx/trusty-proposed

« back to all changes in this revision

Viewing changes to src/os/unix/ngx_freebsd_init.c

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2013-04-25 12:51:45 UTC
  • mfrom: (1.3.28)
  • mto: (1.3.29) (15.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 64.
  • Revision ID: package-import@ubuntu.com-20130425125145-ugl0wor6bq0u5eae
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/*
3
3
 * Copyright (C) Igor Sysoev
 
4
 * Copyright (C) Nginx, Inc.
4
5
 */
5
6
 
6
7
 
19
20
/* FreeBSD 4.9 */
20
21
int     ngx_freebsd_machdep_hlt_logical_cpus;
21
22
 
22
 
/* FreeBSD 5.0 */
23
 
int     ngx_freebsd_kern_ipc_zero_copy_send;
24
 
 
25
23
 
26
24
ngx_uint_t  ngx_freebsd_sendfile_nbytes_bug;
27
25
ngx_uint_t  ngx_freebsd_use_tcp_nopush;
28
 
ngx_uint_t  ngx_freebsd_debug_malloc;
 
26
 
 
27
ngx_uint_t  ngx_debug_malloc;
29
28
 
30
29
 
31
30
static ngx_os_io_t ngx_freebsd_io = {
68
67
      &ngx_freebsd_kern_ipc_somaxconn,
69
68
      sizeof(ngx_freebsd_kern_ipc_somaxconn), 0 },
70
69
 
71
 
    { "kern.ipc.zero_copy.send",
72
 
      &ngx_freebsd_kern_ipc_zero_copy_send,
73
 
      sizeof(ngx_freebsd_kern_ipc_zero_copy_send), 0 },
74
 
 
75
70
    { NULL, NULL, 0, 0 }
76
71
};
77
72
 
81
76
{
82
77
#if (NGX_DEBUG_MALLOC)
83
78
 
84
 
#if __FreeBSD_version >= 500014
 
79
#if __FreeBSD_version >= 500014 && __FreeBSD_version < 1000011
85
80
    _malloc_options = "J";
86
 
#else
 
81
#elif __FreeBSD_version < 500014
87
82
    malloc_options = "J";
88
83
#endif
89
84
 
90
 
    ngx_freebsd_debug_malloc = 1;
 
85
    ngx_debug_malloc = 1;
91
86
 
92
87
#else
93
88
    char  *mo;
95
90
    mo = getenv("MALLOC_OPTIONS");
96
91
 
97
92
    if (mo && ngx_strchr(mo, 'J')) {
98
 
        ngx_freebsd_debug_malloc = 1;
 
93
        ngx_debug_malloc = 1;
99
94
    }
100
95
#endif
101
96
}
104
99
ngx_int_t
105
100
ngx_os_specific_init(ngx_log_t *log)
106
101
{
107
 
    int         version, somaxconn;
 
102
    int         version;
108
103
    size_t      size;
109
104
    ngx_err_t   err;
110
105
    ngx_uint_t  i;
216
211
        ngx_ncpu = ngx_freebsd_hw_ncpu;
217
212
    }
218
213
 
219
 
    somaxconn = version < 600008 ? 32676 : 65535;
220
 
 
221
 
    if (ngx_freebsd_kern_ipc_somaxconn > somaxconn) {
 
214
    if (version < 600008 && ngx_freebsd_kern_ipc_somaxconn > 32767) {
222
215
        ngx_log_error(NGX_LOG_ALERT, log, 0,
223
 
                      "sysctl kern.ipc.somaxconn must be no more than %d",
224
 
                      somaxconn);
 
216
                      "sysctl kern.ipc.somaxconn must be less than 32768");
225
217
        return NGX_ERROR;
226
218
    }
227
219