Diff

Differences From Artifact [59492d048f]:

To Artifact [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)