aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.h
Commit message (Expand)AuthorAge
* Add a portable tor_timercmp•••We can't use the platform timercmp, because 1) some platforms don't have them 2) some that do have them only support certain relational operators Nick Mathewson2010-10-15
* Autodetect the number of CPUs when possible if NumCPUs==0•••This is needed for IOCP, since telling the IOCP backend about all your CPUs is a good idea. It'll also come in handy with asn's multithreaded crypto stuff, and for people who run servers without reading the manual. Nick Mathewson2010-09-28
* moved wince related includes and defs to compat.h where possible, removed unu...valerino2010-05-24
* Port Tor to work on Windows CE•••Most of the changes here are switches to use APIs available on Windows CE. The most pervasive change is that Windows CE only provides the wide-character ("FooW") variants of most of the windows function, and doesn't support the older ASCII verions at all. This patch will require use of the wcecompat library to get working versions of the posix-style fd-based file IO functions. [commit message by nickm] valerino2010-05-24
* Merge branch 'asprintf'Nick Mathewson2010-04-02
|\
| * Add a tor_asprintf() function, and use it in a couple of places.•••asprintf() is a GNU extension that some BSDs have picked up: it does a printf into a newly allocated chunk of RAM. Our tor_asprintf() differs from standard asprintf() in that: - Like our other malloc functions, it asserts on OOM. - It works on windows. - It always sets its return-field. Nick Mathewson2010-02-25
* | Merge remote branch 'origin/maint-0.2.1'•••Conflicts: src/common/test.h src/or/test.c Nick Mathewson2010-02-27
|\ \
| * | Update Tor Project copyright yearsNick Mathewson2010-02-27
* | | Add the MIN and MAX macros for platforms that lack themNick Mathewson2010-02-25
* | | Fix 64-bit printf issues in consensus-bw-weights5-merge.•••For my 64-bit Linux system running with GCC 4.4.3-fc12-whatever, you can't do 'printf("%lld", (int64_t)x);' Instead you need to tell the compiler 'printf("%lld", (long long int)x);' or else it doesn't believe the types match. This is why we added U64_PRINTF_ARG; it looks like we needed an I64_PRINTF_ARG too. Nick Mathewson2010-02-25
* | | Add %lld compat defines.Mike Perry2010-02-22
| |/ |/|
* | Implement DisableAllSwap to avoid putting secret info in page files.•••This commit implements a new config option: 'DisableAllSwap' This option probably only works properly when Tor is started as root. We added two new functions: tor_mlockall() and tor_set_max_memlock(). tor_mlockall() attempts to mlock() all current and all future memory pages. For tor_mlockall() to work properly we set the process rlimits for memory to RLIM_INFINITY (and beyond) inside of tor_set_max_memlock(). We behave differently from mlockall() by only allowing tor_mlockall() to be called one single time. All other calls will result in a return code of 1. It is not possible to change DisableAllSwap while running. A sample configuration item was added to the torrc.complete.in config file. A new item in the man page for DisableAllSwap was added. Thanks to Moxie Marlinspike and Chris Palmer for their feedback on this patch. Please note that we make no guarantees about the quality of your OS and its mlock/mlockall implementation. It is possible that this will do nothing at all. It is also possible that you can ulimit the mlock properties of a given user such that root is not required. This has not been extensively tested and is unsupported. I have included some comments for possible ways we can handle this on win32. Jacob Appelbaum2009-10-27
* | Switch over to tor_strtok_r instead of strtok_r.Mike Perry2009-08-09
* | Add a new tor_strtok_r for platforms that don't have one, plus tests.•••I don't think we actually use (or plan to use) strtok_r in a reentrant way anywhere in our code, but would be nice not to have to think about whether we're doing it. Nick Mathewson2009-08-09
|/
* Don't attempt to log messages to a controller from a worker thread.•••This patch adds a function to determine whether we're in the main thread, and changes control_event_logmsg() to return immediately if we're in a subthread. This is necessary because otherwise we will call connection_write_to_buf, which modifies non-locked data structures. Bugfix on 0.2.0.x; fix for at least one of the things currently called "bug 977". Nick Mathewson2009-05-30
* Spell-check Tor.Nick Mathewson2009-05-27
* Update copyright to 2009.Karsten Loesing2009-05-04
* Add and use set/get_uint64 on onion tags. [bug 604; backportable]•••It seems that 64-bit Sparc Solaris demands 64-bit-aligned access to uint64_t, but does not 64-bit-align the stack-allocated char array we use for cpuworker tags. So this patch adds a set/get_uint64 pair, and uses them to access the conn_id field in the tag. svn:r18743 Nick Mathewson2009-03-02
* Fix warning on panther compile, and bug 913. Backport candidate.•••svn:r18203 Nick Mathewson2009-01-21
* Add a better (non-locale-having) ctypes implementation to avoid protocol and ...•••svn:r18189 Nick Mathewson2009-01-20
* Remove svn $Id$s from our source, and remove tor --version --version.•••The subversion $Id$ fields made every commit force a rebuild of whatever file got committed. They were not actually useful for telling the version of Tor files in the wild. svn:r17867 Nick Mathewson2009-01-04
* Remove some code that is #ifdefed out, and that we no longer seem to use, if ...•••svn:r17827 Nick Mathewson2008-12-30
* Use a consistent naming standard for header file guard macros, taking care no...•••svn:r17805 Nick Mathewson2008-12-29
* Remove some cargo-cult gcc hacks around tor_assert and predict_unlikely; inst...•••svn:r17597 Nick Mathewson2008-12-11
* Simplify mmap object layout to avoid confusing static analysis tools, and us ...•••svn:r17490 Nick Mathewson2008-12-05
* Add two lseek wrappers to compat.[ch]: one to return current fd position, and...•••svn:r17454 Nick Mathewson2008-12-02
* Define socklen_t before using it in compat.h•••svn:r17444 Nick Mathewson2008-12-02
* define get_uint8 and set_uint8 macros to make code cleaner.•••svn:r17261 Nick Mathewson2008-11-12
* Patch from Jacob Appelbaum and me to make User option more robust, properly s...•••svn:r17200 Steven Murdoch2008-11-07
* Document some dmalloc stuff and some stupid C tricks.•••svn:r17161 Nick Mathewson2008-10-27
* Add a lockfile to the Tor data directory to avoid situations where two Tors s...•••svn:r16722 Nick Mathewson2008-09-01
* Fix compile on OpenBSD 4.4-current. Bugfix on 0.2.1.5-alpha.•••Reported by Tas. svn:r16713 Roger Dingledine2008-09-01
* commit jake's patch to include strings with socks5 error numbers•••svn:r16657 Roger Dingledine2008-08-25
* r17848@tombo: nickm | 2008-08-22 12:10:11 -0400••• Make definition of tor_mutex_t go into compat.h, so that it is possible to inline mutexes in critical objects. Add init/uninit functions for mutexes allocated inside other structs. svn:r16623 Nick Mathewson2008-08-22
* r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200••• Split out the address manipulation functions from compat and util: they were about 21% of the total of those, and spread out too much. svn:r16208 Nick Mathewson2008-07-25
* r17346@aud-055: nickm | 2008-07-24 15:37:19 +0200••• Make generic address manipulation functions work better. Switch address policy code to use tor_addr_t, so it can handle IPv6. That is a good place to start. svn:r16178 Nick Mathewson2008-07-24
* Stop using __attribute__((nonnull)): It gets us occcasional warnings when we ...•••svn:r15803 Nick Mathewson2008-07-09
* r19795@catbus: nickm | 2008-05-16 14:54:24 -0400••• Rename tor_addr_t manipulation functions for a consistent style. svn:r14639 Nick Mathewson2008-05-16
* r14371@tombo: nickm | 2008-02-21 16:13:18 -0500••• Fix all -Wshorten-64-to-32 warnings that appear on my macbook. svn:r13662 Nick Mathewson2008-02-21
* r18291@catbus: nickm | 2008-02-20 22:35:32 -0500••• Resolve all DOCDOC issues, and document some other undocumented code, and fix a changelog entry. svn:r13638 Nick Mathewson2008-02-21
* r18269@catbus: nickm | 2008-02-20 17:28:24 -0500••• Apply patch from Sebastian Hahn: stop imposing an arbitrary maximum on the number of file descriptors used for busy servers. Bug reported by Olaf Selke. svn:r13626 Nick Mathewson2008-02-20
* r18226@catbus: nickm | 2008-02-19 18:01:01 -0500••• Brown-paper-bag time. We were failing to count all the sockets from accept(). svn:r13595 Nick Mathewson2008-02-19
* r18198@catbus: nickm | 2008-02-19 14:30:30 -0500••• Try to *fix* the socket counting problem, and add an info log to detect whether we really fixed it svn:r13580 Nick Mathewson2008-02-19
* r14181@tombo: nickm | 2008-02-15 16:48:17 -0500••• Fix all but 2 DOCDOC items; defer many XXX020s (particularly those where fixing them would fix no bugs at the risk of introducing some bugs). svn:r13529 Nick Mathewson2008-02-15
* r18051@catbus: nickm | 2008-02-12 15:20:43 -0500••• Re-tune mempool parametes based on testing on peacetime: use smaller chuncks, free them a little more aggressively, and try very hard to concentrate allocations on fuller chunks. Also, lots of new documentation. svn:r13484 Nick Mathewson2008-02-12
* Update some copyright notices: it is now 2008.•••svn:r13412 Nick Mathewson2008-02-07
* r17899@catbus: nickm | 2008-02-05 14:14:06 -0500••• Fix a couple of XXX020 items. Also, disable all "condition" sychronization code, since Tor does not use it yet svn:r13380 Nick Mathewson2008-02-05
* Apparently, our windows code for detecting ipv6 structures has worked for a w...•••svn:r13377 Nick Mathewson2008-02-05
* r17472@catbus: nickm | 2008-01-05 22:10:19 -0500••• Another test for the increasingly bad check-spaces style checker to check: #else\n#if is almost a sure sign of a failure to use #elif. Fortunately, we only did that 3 times. svn:r13039 Nick Mathewson2008-01-06
* clean up copyrights, and assign 2007 copyrights to The Tor Project, Inc•••svn:r12786 Roger Dingledine2007-12-12