Browse Source

added check for madvise

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@810 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.7
Jan Kneschke 16 years ago
parent
commit
6e424095f2
  1. 2
      SConstruct
  2. 2
      configure.in
  3. 2
      src/network_writev.c

2
SConstruct

@ -144,7 +144,7 @@ if 1:
checkFuncs(autoconf, Split('fork stat lstat strftime dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
strdup strerror strstr strtol sendfile getopt socket \
gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
getuid select signal pathconf\
getuid select signal pathconf madvise\
writev sigaction sendfile64 send_file kqueue port_create localtime_r'))
checkTypes(autoconf, Split('pid_t size_t off_t'))

2
configure.in

@ -442,7 +442,7 @@ esac
AC_CHECK_FUNCS([dup2 getcwd inet_ntoa inet_ntop memset mmap munmap strchr \
strdup strerror strstr strtol sendfile getopt socket \
gethostbyname poll sigtimedwait epoll_ctl getrlimit chroot \
getuid select signal pathconf\
getuid select signal pathconf madvise\
writev sigaction sendfile64 send_file kqueue port_create localtime_r])
AC_MSG_CHECKING(for Large File System support)

2
src/network_writev.c

@ -245,10 +245,12 @@ int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkq
#ifdef LOCAL_BUFFERING
buffer_copy_string_len(c->mem, c->file.mmap.start, c->file.mmap.length);
#else
#ifdef HAVE_MADVISE
if (0 != madvise(c->file.mmap.start, c->file.mmap.length, MADV_WILLNEED)) {
log_error_write(srv, __FILE__, __LINE__, "ssbd", "madvise failed:",
strerror(errno), c->file.name, c->file.fd);
}
#endif
#endif
/* chunk_reset() or chunk_free() will cleanup for us */

Loading…
Cancel
Save