aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-20 22:23:24 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-20 22:23:24 +0000
commite376d454bb70ed41bbc3eb0358d37fa30c94358d (patch)
treeeb53c600dcde841a7617a19f819ae3e9cfe7fd84 /include
parentae86a338b89c1339588226cb2298e1785aaa7b90 (diff)
downloadbusybox-w32-e376d454bb70ed41bbc3eb0358d37fa30c94358d.tar.gz
busybox-w32-e376d454bb70ed41bbc3eb0358d37fa30c94358d.tar.bz2
busybox-w32-e376d454bb70ed41bbc3eb0358d37fa30c94358d.zip
libbb: introduce and use nonblock_safe_read(). Yay!
Our shells are immune from this nasty O_NONBLOCK now! function old new delta nonblock_safe_read - 78 +78 file_get 276 295 +19 generateMTFValues 428 435 +7 read_line_input 1776 1772 -4 preadbuffer 543 450 -93 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/2 up/down: 104/-97) Total: 7 bytes text data bss dec hex filename 615190 715 23924 639829 9c355 busybox_old 615168 715 23924 639807 9c33f busybox_unstripped
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index a91eac466..eb8b2f620 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -475,6 +475,7 @@ extern void *xzalloc(size_t size);
475extern void *xrealloc(void *old, size_t size); 475extern void *xrealloc(void *old, size_t size);
476 476
477extern ssize_t safe_read(int fd, void *buf, size_t count); 477extern ssize_t safe_read(int fd, void *buf, size_t count);
478extern ssize_t nonblock_safe_read(int fd, void *buf, size_t count);
478extern ssize_t full_read(int fd, void *buf, size_t count); 479extern ssize_t full_read(int fd, void *buf, size_t count);
479extern void xread(int fd, void *buf, size_t count); 480extern void xread(int fd, void *buf, size_t count);
480extern unsigned char xread_char(int fd); 481extern unsigned char xread_char(int fd);
@@ -482,6 +483,7 @@ extern unsigned char xread_char(int fd);
482extern char *reads(int fd, char *buf, size_t count); 483extern char *reads(int fd, char *buf, size_t count);
483// Read one line a-la fgets. Reads byte-by-byte. 484// Read one line a-la fgets. Reads byte-by-byte.
484// Useful when it is important to not read ahead. 485// Useful when it is important to not read ahead.
486// Bytes are appended to pfx (which must be malloced, or NULL).
485extern char *xmalloc_reads(int fd, char *pfx); 487extern char *xmalloc_reads(int fd, char *pfx);
486extern ssize_t read_close(int fd, void *buf, size_t count); 488extern ssize_t read_close(int fd, void *buf, size_t count);
487extern ssize_t open_read_close(const char *filename, void *buf, size_t count); 489extern ssize_t open_read_close(const char *filename, void *buf, size_t count);