Overview
Comment: | Added support for checking for a working C11 atomic compiler (unfortunately, GCC 4.7.x and 4.8.x are still broken due to compiler bugs) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | 8f0a3ed18a992f8644dc2195d523567a169c2ad1 |
User & Date: | rkeene on 2016-02-22 22:07:06 |
Other Links: | manifest | tags |
Context
2016-02-22
| ||
22:08 | Updated ignore for generated file check-in: 62bbe8a973 user: rkeene tags: trunk | |
22:07 | Added support for checking for a working C11 atomic compiler (unfortunately, GCC 4.7.x and 4.8.x are still broken due to compiler bugs) check-in: 8f0a3ed18a user: rkeene tags: trunk | |
21:02 | Completed support for killing idle connections check-in: 6e6baf524b user: rkeene tags: trunk | |
Changes
Modified Makefile from [debc382dde] to [5a0201dfad].
1 1 CC = gcc 2 -CFLAGS = -std=gnu11 -Wall -Werror -W -pthread -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 2 +CFLAGS = -std=gnu11 -Wall -Werror -Wno-error=cpp -W -pthread -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 3 3 LDFLAGS = -pthread 4 4 LIBS = -lpthread 5 5 MIMETYPES = /etc/httpd/mime.types 6 6 7 7 PREFIX = /usr/local 8 8 prefix = $(PREFIX) 9 9 bindir = $(prefix)/bin
Modified filed.c from [59492d048f] to [877b095562].
39 39 #include <stdarg.h> 40 40 #include <fcntl.h> 41 41 #include <stdio.h> 42 42 #include <errno.h> 43 43 #include <time.h> 44 44 #include <pwd.h> 45 45 46 +/* 47 + * Determine if the C compiler supports C11 atomics 48 + */ 49 +#if __STDC_VERSION__ >= 201112L 50 +# ifndef __STDC_NO_ATOMICS__ 51 +# define FILED_FEATURE_C11_ATOMICS 1 52 +# endif 53 +#endif 54 + 55 +/* 56 + * If the C compiler does not support C11 atomics, disable TIMEOUT support 57 + * since it relies upon it 58 + */ 59 +#ifndef FILED_FEATURE_C11_ATOMICS 60 +# warning "Automatically defining FILED_DONT_TIMEOUT since your C compiler lacks C11 atomics" 61 +# define FILED_DONT_TIMEOUT 1 62 +#endif 63 + 64 +/* 65 + * These headers are only required for TIMEOUT support 66 + */ 46 67 #ifndef FILED_DONT_TIMEOUT 47 68 #include <stdatomic.h> 48 69 #include <stdbool.h> 49 70 #endif 50 71 51 72 /* Compile time constants */ 52 73 #define FILED_VERSION "1.13" ................................................................................ 61 82 #define BIND_ADDR "::" 62 83 #define CACHE_SIZE 8209 63 84 #define LOG_FILE "-" 64 85 65 86 /* Fuzzing Test Code */ 66 87 #ifdef FILED_TEST_AFL 67 88 #define FILED_DONT_LOG 1 89 +#define FILED_DONT_TIMEOUT 1 68 90 #define pthread_create(a, x, y, z) afl_pthread_create(a, x, y, z) 69 91 #define bind(x, y, z) afl_bind(x, y, z) 70 92 #define socket(x, y, z) 8193 71 93 #define listen(x, y) 0 72 94 #define accept(x, y, z) afl_accept(x, y, z) 73 95 #define close(x) { if (strcmp(#x, "random_fd") == 0) { close(x); } else { exit(0); } } 74 96 #define fclose(x) exit(0)