summaryrefslogtreecommitdiff
path: root/src/common/compat.h
AgeCommit message (Collapse)Author
2018-06-28Move tor_gethostname to lib/netNick Mathewson
2018-06-28Move lockfile code into lib/fsNick Mathewson
2018-06-28Extract process-management functionality into a new lib/processNick Mathewson
Note that procmon does *not* go here, since procmon needs to integrate with the event loop.
2018-06-28Extract threading code into a new library.Nick Mathewson
Note that the workqueue code does *not* go here: it is logically at a higher level, since it needs to use libevent and the networking stack.
2018-06-27Extract time encoding functions into lib/encodingNick Mathewson
2018-06-27Move various mem* functions to lib/stringNick Mathewson
2018-06-27Move tor_strtok_r to libtor-stringNick Mathewson
2018-06-27Move set/get_uint*() to inline functions in arch/bytes.hNick Mathewson
Also move our ntohll/htonll functions.
2018-06-27Extract functions from compat.c and util.h into a new fs libraryNick Mathewson
2018-06-27Move format_win32_error into lib/log/Nick Mathewson
2018-06-27Move network code to libtor-net.Nick Mathewson
There are some additional changes to come: those points are marked by XXXX.
2018-06-22Remove util_bug dependency on compat.hNick Mathewson
2018-06-22Finally extract the log library and make it build.Nick Mathewson
This patch: - introduces an fdio module for low-level fd functions that don't need to log. - moves the responsibility for opening files outside of torlog.c, so it won't need to call tor_open_cloexec.
2018-06-22Extract strlcpy and strlcmp to libtor-stringNick Mathewson
2018-06-22Extract key string manipulation functions into a new library.Nick Mathewson
2018-06-21Rectify include paths (automated).Nick Mathewson
You have no idea how glad I am that this is automated.
2018-06-21Move more compiler-compatibility stuff into compat_compiler.hNick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Split compiler-compatibility parts of compat.hNick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-04-12Merge branch 'maint-0.3.3'Nick Mathewson
2018-04-12Make get_total_system_memory mockable.Alexander Færøy
This patch makes get_total_system_memory mockable, which allows us to alter the return value of the function in tests. See: https://bugs.torproject.org/24782
2018-03-22Do not page-align mmap length. #25399Alex Xu (Hello71)
2018-01-26Add a new tor_addr_from_getsockname()Nick Mathewson
We use this pattern all over, and this should simplify matters a bit. Part of 18105.
2018-01-17Merge branch 'bug22798_029_squashed'Nick Mathewson
2018-01-17Improve Windows performance with SIO_IDEAL_SEND_BACKLOG_QUERY.Nick Mathewson
Patch written by "Vort" on trac. Addresses ticket 22798.
2017-10-18New function for Tor to treat itself as the "owner" of a socketNick Mathewson
Our socket accounting functions assumed that we'd never be asked to close a socket that we didn't open ourselves. But now we want to support taking control sockets that we inherit -- so we need a way of taking ownership of them, so we don't freak out later on when we close them.
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15Split some long #if lines to make the #endif annotator happyNick Mathewson
2017-05-22fix two typos in commentsRoger Dingledine
closes ticket 22322
2017-03-15Run the copyright update script.Nick Mathewson
2017-03-09Remove fgets() compatbility function and related tests.Alexander Færøy
This patch removes the `tor_fgets()` wrapper around `fgets(3)` since it is no longer needed. The function was created due to inconsistency between the returned values of `fgets(3)` on different versions of Unix when using `fgets(3)` on non-blocking file descriptors, but with the recent changes in bug #21654 we switch from unbuffered to direct I/O on non-blocking file descriptors in our utility module. We continue to use `fgets(3)` directly in the geoip and dirserv module since this usage is considered safe. This patch also removes the test-case that was created to detect differences in the implementation of `fgets(3)` as well as the changes file since these changes was not included in any releases yet. See: https://bugs.torproject.org/21654
2017-03-01Add compatibility function for fgets(3).Alexander Færøy
This patch adds the `tor_fgets()` function to our compatibility layer. `tor_fgets()` adds an additional check for whether the error-bit have been enabled for the given file stream, if that is the case and `errno` is set to `EAGAIN` we make sure that we always return NULL. Unfortunately `fgets(3)` behaves differently on different versions of the C library. See: https://bugs.torproject.org/21416 See: https://bugs.torproject.org/20988
2016-09-09Fix cases where the tests were doing closesocket() on a non-socketNick Mathewson
These seem to have caused warnings on windows. Hmmm.
2016-08-12Fix integer overflows in the conversion tablescypherpunks
2016-08-11Fix a bug in the old-gcc version of ENABLE_GCC_WARNINGNick Mathewson
Fixes bug 19901; bugfix on 0.2.9.1-alpha.
2016-07-08Move our "what time is it now" compat functions into a new moduleNick Mathewson
I'm not moving our "format and parse the time" functions, since those have been pretty volatile over the last couple of years.
2016-05-27Add support for temporarily suppressing a warningNick Mathewson
There are a few places where we want to disable a warning: for example, when it's impossible to call a legacy API without triggering it, or when it's impossible to include an external header without triggering it. This pile of macros uses GCC's c99 _Pragma support, plus the usual macro trickery, to enable and disable warnings.
2016-04-05Fix a comment typo in compat.hteor (Tim Wilson-Brown)
2016-02-27Update the copyright year.Nick Mathewson
2016-02-23Merge branch 'maint-0.2.7'Nick Mathewson
2016-02-23Make clang asan work with FORTIFIED_SOURCE again.Nick Mathewson
Short version: clang asan hates the glibc strcmp macro in bits/string2.h if you are passing it a constant string argument of length two or less. (I could be off by one here, but that's the basic idea.) Closes issue 14821.
2016-01-15Whitespace cleanupNick Mathewson
2016-01-13Add tests for options_actOla Bini
2015-12-15Merge branch 'feature8195_small_squashed'Nick Mathewson
2015-12-15Update KeepCapabilities based on comments from asnNick Mathewson
* The option is now KeepBindCapabilities * We now warn if the user specifically asked for KeepBindCapabilities and we can't deliver. * The unit tests are willing to start. * Fewer unused-variable warnings. * More documentation, fewer misspellings.
2015-12-15Add ability to keep the CAP_NET_BIND_SERVICE capability on LinuxNick Mathewson
This feature allows us to bind low ports when starting as root and switching UIDs. Based on code by David Goulet. Implement feature 8195
2015-12-15Remove obsolete INLINE preprocessor definitioncypherpunks
The INLINE keyword is not used anymore in favor of inline. Windows only supports __inline so an inline preprocessor definition is still needed.
2015-12-15Replace usage of INLINE with inlinecypherpunks
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]