comparison src/os/unix/ngx_freebsd_sendfile_chain.c @ 8778:b002ad258f1d

Support for sendfile(SF_NOCACHE). The SF_NOCACHE flag, introduced in FreeBSD 11 along with the new non-blocking sendfile() implementation by glebius@, makes it possible to use sendfile() along with the "directio" directive.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 27 Dec 2021 19:49:26 +0300
parents ec2e6893caaa
children
comparison
equal deleted inserted replaced
8777:f1fcb0fe6975 8778:b002ad258f1d
172 } 172 }
173 173
174 sent = 0; 174 sent = 0;
175 175
176 #if (NGX_HAVE_SENDFILE_NODISKIO) 176 #if (NGX_HAVE_SENDFILE_NODISKIO)
177
177 flags = (c->busy_count <= 2) ? SF_NODISKIO : 0; 178 flags = (c->busy_count <= 2) ? SF_NODISKIO : 0;
179
180 if (file->file->directio) {
181 flags |= SF_NOCACHE;
182 }
183
178 #endif 184 #endif
179 185
180 rc = sendfile(file->file->fd, c->fd, file->file_pos, 186 rc = sendfile(file->file->fd, c->fd, file->file_pos,
181 file_size + header.size, &hdtr, &sent, flags); 187 file_size + header.size, &hdtr, &sent, flags);
182 188