1. 20 May, 2013 5 commits
    • Julius Plenz's avatar
      Assert the existence of original functions · e979b3dd
      Julius Plenz authored
      The friendly folks at #musl again:
      
      21:17 < dalias> if you init the pointers both from the ctor and the "lazy
         init", then the assertion-failure/abort would happen during construction
         (either your ctor or somebody else's ctor calling your functions)
      21:17 < dalias> so the program would exit "before it even gets started"
      21:17 < dalias> and this is not so bad
      
      21:18 < dalias> normally i consider it really bad practice for a library to
         abort the program
      21:18 < dalias> but this happens during ctors, and there truely is no way to
         proceed
      21:18 < dalias> if you've already replaced the program's library functions
         (open, etc.) with your copies, and then find that you can't actually supply
         working ones
      e979b3dd
    • Julius Plenz's avatar
      Supply “lazy initializers” in every intercepted function · 1a36b32e
      Julius Plenz authored
      The friendly folks at #musl say:
      
      20:52 < dalias> i think it's good to have both that and the ctor
      20:52 < Feh> This should increase robustness if it is in every function.
      20:52 < dalias> because...
      20:52 < dalias> several of these functions are required to be async-signal-safe
      20:53 < dalias> so if the first call happened to be from a signal handler,
         you'd be in trouble if you didn't already have the ctor
      20:54 < dalias> in theory another ctor in another lib or the app could run
         before yours and install and run a signal handler :-p but that's pretty
         unlikely and pathological
      20:54 < dalias> so i think having both the ctor and the lazy-init keeps you
         safe in situations that will arise in the real world
      1a36b32e
    • Julius Plenz's avatar
      7a0b64d5
    • Julius Plenz's avatar
      Space change · 4781a41b
      Julius Plenz authored
      4781a41b
    • Aleksandr's avatar
      We don't want to mix 64 bit file opens with 32 bit file opens; · 2acc4993
      Aleksandr authored
      (This fixes issue #3.)
      2acc4993
  2. 10 May, 2013 2 commits
  3. 06 May, 2013 1 commit
  4. 02 May, 2013 4 commits
  5. 29 Apr, 2013 6 commits
  6. 27 Apr, 2013 1 commit
  7. 24 Apr, 2013 1 commit
  8. 23 Apr, 2013 1 commit
  9. 22 Apr, 2013 2 commits
  10. 09 Apr, 2013 1 commit
  11. 05 Apr, 2013 1 commit
  12. 20 Mar, 2013 2 commits
  13. 16 Oct, 2012 6 commits
  14. 24 Jul, 2012 1 commit
  15. 12 Jul, 2012 2 commits
  16. 08 Feb, 2012 3 commits
    • Julius Plenz's avatar
      Update README · 404fa61a
      Julius Plenz authored
      404fa61a
    • Julius Plenz's avatar
      little code cleanup · 477e69c8
      Julius Plenz authored
      477e69c8
    • Julius Plenz's avatar
      handle stdout correctly if it's a file · fd9969ec
      Julius Plenz authored
      When you invoke "tar cfv <tarball> <files>", then tar will close all
      active file descriptors it has, forks, then opens the target tarball
      as fd 1 (stdout). Then, it'll exec "gzip -", which *inherits* a stdout
      which is a file.
      
      Now we duplicate this stdout if it's a regular file so that we can
      advise it later. (The original will be closed via the _exit() routine,
      probably, which uses direct syscall that we cannot intercept.)
      fd9969ec
  17. 07 Feb, 2012 1 commit
    • Julius Plenz's avatar
      Intercept dup2() · e033127e
      Julius Plenz authored
      Thus, also shell redirection -- which makes heavy use of dup2() --  is handled
      correctly:
      
          $ cachestats /tmp/foo
          open: No such file or directory
          $ nocache sh -c 'echo foo > /tmp/foo'
          $ cachestats /tmp/foo
          pages in cache: 0/1 (0.0%)  [filesize=0.0K, pagesize=4K]
      e033127e