summaryrefslogtreecommitdiffstats
path: root/libbb/libbb.h
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-27 11:52:36 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-27 11:52:36 (EST)
commit47daab916286d7ac837ecaadb607b09797822fc2 (patch)
tree4558e6e21a477c2d63740f2425549887198c6f6f /libbb/libbb.h
parent21eb7f75a568f0c6e44836b89ca57f5d7846f5dc (diff)
Thanks for Mike Westerhof <mwester@dls.net>
---------- This patchset updates the libbb stuff to use a vfork() version of gz_open, called gzvopen. This is done because a standard fork will duplicate the entire address space. This will invoke the OOM (out of memory) killer on small-memory machines, because most often by the time we unzip any package, we've read the entire package database into memory already. By using vfork() and immediatly execing the external gunzip utility, we avoid the need to clone the entire address space. Yes, this is actually **LESS** efficient than the original way! But there is no way to (currently) dodge the OOM killer on a per-process basis, so the alternatives are to either change the OOM killer behavior system-wide, or to use this workaround. Mike Westerhof, Dec 2008 git-svn-id: http://opkg.googlecode.com/svn/trunk@190 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libbb/libbb.h')
-rw-r--r--libbb/libbb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libbb/libbb.h b/libbb/libbb.h
index 860dacd..238e5a7 100644
--- a/libbb/libbb.h
+++ b/libbb/libbb.h
@@ -270,6 +270,8 @@ char *fgets_str(FILE *file, const char *terminating_string);
extern int unzip(FILE *l_in_file, FILE *l_out_file);
extern void gz_close(int gunzip_pid);
extern FILE *gz_open(FILE *compressed_file, int *pid);
+extern void gzvclose(int gunzip_pid);
+extern FILE *gzvopen(FILE *compressed_file, int *pid);
extern struct hostent *xgethostbyname(const char *name);
extern int create_icmp_socket(void);