comparison auto/os/linux @ 7175:56923e8e01a5

Improved the capabilities feature detection. Previously included file sys/capability.h mentioned in capset(2) man page, belongs to the libcap-dev package, which may not be installed on some Linux systems when compiling nginx. This prevented the capabilities feature from being detected and compiled on that systems. Now linux/capability.h system header is included instead. Since capset() declaration is located in sys/capability.h, now capset() syscall is defined explicitly in code using the SYS_capset constant, similarly to other Linux-specific features in nginx.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 18 Dec 2017 21:09:39 +0300
parents 84e53e4735a4
children 7f28b61c92f0
comparison
equal deleted inserted replaced
7174:84e53e4735a4 7175:56923e8e01a5
172 # capabilities 172 # capabilities
173 173
174 ngx_feature="capabilities" 174 ngx_feature="capabilities"
175 ngx_feature_name="NGX_HAVE_CAPABILITIES" 175 ngx_feature_name="NGX_HAVE_CAPABILITIES"
176 ngx_feature_run=no 176 ngx_feature_run=no
177 ngx_feature_incs="#include <sys/capability.h>" 177 ngx_feature_incs="#include <linux/capability.h>
178 #include <sys/syscall.h>"
178 ngx_feature_path= 179 ngx_feature_path=
179 ngx_feature_libs= 180 ngx_feature_libs=
180 ngx_feature_test="struct __user_cap_data_struct data; 181 ngx_feature_test="struct __user_cap_data_struct data;
181 struct __user_cap_header_struct header; 182 struct __user_cap_header_struct header;
182 183
183 header.version = _LINUX_CAPABILITY_VERSION_3; 184 header.version = _LINUX_CAPABILITY_VERSION_3;
184 data.effective = CAP_TO_MASK(CAP_NET_RAW); 185 data.effective = CAP_TO_MASK(CAP_NET_RAW);
185 data.permitted = 0; 186 data.permitted = 0;
186 187
187 (void) capset(&header, &data)" 188 (void) SYS_capset"
188 . auto/feature 189 . auto/feature
189 190
190 191
191 # crypt_r() 192 # crypt_r()
192 193