Skip to content

Commit

Permalink
add degetc
Browse files Browse the repository at this point in the history
  • Loading branch information
acidghost committed Nov 1, 2020
1 parent c9f5e6e commit 7dc3739
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -45,6 +45,10 @@ target_link_libraries(ensock common-preeny dl)
add_library(writeout SHARED src/writeout.c)
target_link_libraries(writeout common-preeny dl)

# De-getc
add_library(degetc SHARED src/degetc.c)
target_link_libraries(degetc common-preeny)

# Random
add_library(desrand SHARED src/desrand.c)
target_link_libraries(desrand common-preeny dl)
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -18,6 +18,7 @@ Preeny has the following modules:
| desrand | Does tricky things with srand() to control randomness. |
| detime | Makes time() always return the same value. |
| desleep | Makes sleep() and usleep() do nothing. |
| degetc | Makes getc() always return '\0' |
| mallocwatch | When ltrace is inconvenient, mallocwatch provides info on heap operations. |
| writeout | Some binaries write() to fd 0, expecting it to be a two-way socket. This makes that work (by redirecting to fd 1). |
| patch | Patches programs at load time. |
Expand Down
7 changes: 7 additions & 0 deletions src/degetc.c
@@ -0,0 +1,7 @@
#include <stdio.h>
#include "logging.h"

int getc(FILE *stream) {
preeny_info("getc blocked\n");
return '\0';
}

0 comments on commit 7dc3739

Please sign in to comment.