Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | utils: Define a platform directory separator character used in paths | Martin Willi | 2014-06-04 | 1 | -0/+9 | |
| | ||||||
* | windows: Provide a getpass() implementation | Martin Willi | 2014-06-04 | 2 | -0/+65 | |
| | ||||||
* | chunk: On Windows, chunk_map() opens files in binary mode | Martin Willi | 2014-06-04 | 1 | -2/+7 | |
| | ||||||
* | windows: Don't redeclare inet_ntop/pton if already defined | Martin Willi | 2014-06-04 | 1 | -0/+4 | |
| | ||||||
* | windows: Check for existence of error codes before defining them | Martin Willi | 2014-06-04 | 1 | -0/+4 | |
| | ||||||
* | windows: Overload sleep() cancellable when it is defined in <unistd.h> | Martin Willi | 2014-06-04 | 1 | -1/+3 | |
| | ||||||
* | windows: Provide a close(2) that can close both file handles and sockets | Martin Willi | 2014-06-04 | 2 | -0/+22 | |
| | ||||||
* | chunk: Fallback to recv() on Windows chunk_from_fd() when operating on socket | Martin Willi | 2014-06-04 | 1 | -0/+6 | |
| | ||||||
* | windows: Don't use function macros to overload send/recv() and friends | Martin Willi | 2014-06-04 | 1 | -4/+4 | |
| | | | | | While the macro versions would not catch non-function invocations, we actually have to use catch all to support the sender_t.send() function. | |||||
* | windows: Provide a strndup(3) replacement | Martin Willi | 2014-06-04 | 2 | -0/+20 | |
| | ||||||
* | unit-tests: Uninline dlopen() and friends, make more dynamic, fix dlerror() | Martin Willi | 2014-06-04 | 2 | -58/+136 | |
| | | | | | As the error string contains a newline, we have to remove that before returning the string. | |||||
* | windows: Provide a cancellable usleep(), but with ms resolution only | Martin Willi | 2014-06-04 | 2 | -0/+18 | |
| | ||||||
* | windows: Add a sleep function acting as cancellation point | Martin Willi | 2014-06-04 | 1 | -0/+9 | |
| | ||||||
* | windows: Provide a sched_yield() implementation | Martin Willi | 2014-06-04 | 2 | -0/+10 | |
| | ||||||
* | windows: Provide a time_monotonic() based on GetTickCount64() | Martin Willi | 2014-06-04 | 1 | -0/+21 | |
| | ||||||
* | chunk: Don't depend on pthread directly | Martin Willi | 2014-06-04 | 2 | -13/+13 | |
| | ||||||
* | utils: Don't directly depend on pthread | Martin Willi | 2014-06-04 | 1 | -40/+53 | |
| | ||||||
* | strerror: Don't directly depend on pthread | Martin Willi | 2014-06-04 | 3 | -36/+98 | |
| | ||||||
* | windows: Provide a strdup variant safe when passing zero-length strings | Martin Willi | 2014-06-04 | 1 | -0/+15 | |
| | ||||||
* | stream: Separate TCP/Unix stream helpers from stream/service implementations | Martin Willi | 2014-06-04 | 1 | -0/+6 | |
| | | | | | | This allows us to disable Unix sockets cleanly on Windows. Replaces some read/write calls with recv/send counterparts, as Winsock does not like read/writes. | |||||
* | windows: Map WSAGetLastError() to errno failures in wrapped send/recv/from/to | Martin Willi | 2014-06-04 | 1 | -12/+80 | |
| | ||||||
* | windows: Add send/recv and sendto/recvfrom wrappers supporting MSG_DONTWAIT | Martin Willi | 2014-06-04 | 2 | -0/+135 | |
| | ||||||
* | windows: Implement socketpair() using TCP sockets | Martin Willi | 2014-06-04 | 2 | -0/+69 | |
| | ||||||
* | windows: Add utils_init/deinit functions to initialize Winsock2 | Martin Willi | 2014-06-04 | 4 | -0/+75 | |
| | ||||||
* | windows: Provide a setenv() wrapper | Martin Willi | 2014-06-04 | 1 | -0/+12 | |
| | ||||||
* | windows: Fix up PRI* printf formatters when building against own backend | Martin Willi | 2014-06-04 | 1 | -0/+71 | |
| | ||||||
* | windows: Use localtime/gmtime to implement _r variants | Martin Willi | 2014-06-04 | 1 | -26/+18 | |
| | | | | The _s variants and friends do not seem to work on Windows 7 and always fail. | |||||
* | utils: Printf() defined time output should gmtime/localtime_r() fail | Martin Willi | 2014-06-04 | 1 | -10/+13 | |
| | ||||||
* | backtrace: Inline esc() helper, making it available to all build variants | Martin Willi | 2014-06-04 | 1 | -12/+12 | |
| | ||||||
* | backtrace: Support backtraces on Windows without DbgHelp | Martin Willi | 2014-06-04 | 1 | -27/+61 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While DbgHelp provides a convenient API to create backtraces, any executable linking against DbgHelp gets a more than a significant slow down. Further, it can only lookup global symbols, as it expects PDB files we can't produce with a MinGW build. With some core Kernel32.dll functionality, we can capture stack traces much faster. Together with the optional libbfd, we can print very fine backtraces. When --enable-bfd-backtraces is used on Windows, a libbfd.dll is required for the build. Such a DLL can be created from the binutils sources using: # build binutils with mingw... # extract archive members from binutils libraries x86_64-w64-mingw32-ar x $BINUTILS/bfd/.libs/libbfd.a x86_64-w64-mingw32-ar x $BINUTILS/intl/libintl.a x86_64-w64-mingw32-ar x $BINUTILS/libiberty/libiberty.a # create self-contained libbfd.a, with index x86_64-w64-mingw32-ar qs libbfd.a *.o # create DLL from static library x86_64-w64-mingw32-dlltool -e libbfd.o -l libbfd.lib libbfd.a x86_64-w64-mingw32-gcc -shared libbfd.a libbfd.o -o libbfd.dll | |||||
* | backtrace: Add DbgHelp based Windows support for creating/printing backtraces | Martin Willi | 2014-06-04 | 1 | -12/+195 | |
| | ||||||
* | printf-hook-builtin: Support Windows console colors using TTY escape codes | Martin Willi | 2014-06-04 | 2 | -1/+128 | |
| | ||||||
* | capabilities: Add build support for Windows | Martin Willi | 2014-06-04 | 1 | -3/+37 | |
| | | | | We might extend it in the future using some Windows rights management. | |||||
* | windows: Use _getmaxstdio as replacement for syscall(_SC_OPEN_MAX) | Martin Willi | 2014-06-03 | 1 | -0/+4 | |
| | ||||||
* | windows: replace mkdir() with Windows _mkdir() variant | Martin Willi | 2014-06-03 | 1 | -0/+4 | |
| | ||||||
* | windows: Provide wrappers for dlopen() function family | Martin Willi | 2014-06-03 | 1 | -0/+81 | |
| | ||||||
* | windows: Add a common Windows header for platform specific wrappers | Martin Willi | 2014-06-03 | 5 | -11/+170 | |
| | | | | | Include some more basic system headers in utils.h, so we can use that common header on the different platforms. | |||||
* | enum: Return boolean result for enum_from_name() lookup | Martin Willi | 2014-05-16 | 2 | -5/+27 | |
| | | | | | | | | | | | Handling the result for enum_from_name() is difficult, as checking for negative return values requires a cast if the enum type is unsigned. The new signature clearly differentiates lookup result from lookup value. Further, this actually allows to convert real -1 enum values, which could not be distinguished from "not-found" and the -1 return value. This also fixes several clang warnings where enums are unsigned. | |||||
* | enum: Don't directly include enum.h | Martin Willi | 2014-05-16 | 3 | -4/+5 | |
| | | | | | To allow enum.h to depend on utils.h definitions, avoid its direct inclusion. Instead include utils.h, which includes enum.h as well. | |||||
* | parser-helper: Define debug macros depending on DEBUG_LEVEL | Tobias Brunner | 2014-05-15 | 1 | -3/+20 | |
| | ||||||
* | parser-helper: Make parser_helper_file_t private | Tobias Brunner | 2014-05-15 | 2 | -55/+37 | |
| | ||||||
* | parser-helper: Make parser_helper_log a function | Tobias Brunner | 2014-05-15 | 2 | -9/+28 | |
| | ||||||
* | settings: Reduce log verbosity if files can't be opened | Tobias Brunner | 2014-05-15 | 1 | -1/+1 | |
| | | | | Basically reintroducing 2a38b4556e9fd8102bd6c6c61f2893599a5e8e51. | |||||
* | parser-helper: Add utility class for flex/bison based parsers | Tobias Brunner | 2014-05-15 | 2 | -0/+403 | |
| | ||||||
* | settings: Move to a separate folder | Tobias Brunner | 2014-05-15 | 2 | -1868/+0 | |
| | ||||||
* | utils: Provide a CALLBACK macro, similar to METHOD, but for void* callbacks | Martin Willi | 2014-05-07 | 1 | -0/+13 | |
| | | | | | | Using the same mechanism as the METHOD macro, the CALLBACK macro defines a hybrid function signature. It strictly uses a weak void* for the first function parameter, in contrast to the dynamic METHOD object "this" type. | |||||
* | utils: Enable __atomic* built-ins based on the GCC version | Tobias Brunner | 2014-05-04 | 1 | -0/+7 | |
| | | | | | | | | | | | This solves a problem with GNAT when compiling charon-tkm as __atomic* built-ins are only provided in GCC 4.7 and newer. Currently GNAT 4.6 and GCC 4.7.2 is shipped with Debian wheezy (stable), as used in the testing environment. So while the configure script correctly detected the __atomic* built-ins, and defined HAVE_GCC_ATOMIC_OPERATIONS, this define turned out to be incorrect when charon-tkm was later built with GNAT. | |||||
* | utils: Use GCC's __atomic built-ins if available | Tobias Brunner | 2014-04-24 | 2 | -3/+22 | |
| | | | | | | | | These are available since GCC 4.7 and will eventually replace the __sync operations. They support the memory model defined by C++11. For instance, by using __ATOMIC_RELAXED for some operations on the reference counters we can avoid memory barriers, which are required by __sync operations (whose memory model essentially is __ATOMIC_SEQ_CST). | |||||
* | utils: Add ref_cur() to retrieve the current value of a reference counter | Tobias Brunner | 2014-04-24 | 2 | -3/+24 | |
| | | | | | | | | | | On many architectures it is safe to read the value directly (those using cache coherency protocols, and with atomic loads for 32-bit values) but it is not if that's not the case or if we ever decide to make refcount_t 64-bit (load not atomic on x86). So make sure the operation is actually atomic and that users do not have to care about the size of refcount_t. | |||||
* | leak-detective: LEAK_DETECTIVE_DISABLE completely disables LD | Tobias Brunner | 2014-04-03 | 2 | -15/+18 | |
| | | | | | If lib->leak_detective is non-null some code parts (e.g. the plugin loader) assume LD is actually used. |