summaryrefslogtreecommitdiff
path: root/libbb/copyfd.c
Commit message (Collapse)AuthorAgeFilesLines
* libbb: use sendfile() to copy data between file descriptorsBartosz Golaszewski2014-11-271-31/+56
| | | | | | | | | | | | | | | | | | | | | | | Busybox already uses sendfile in httpd. This patch proposes to use it globally to copy data between file descriptors. It speeds up the copying on slow systems a lot - below are the times needed to copy a 450Mb file with and without this option enabled on a BeagleBone Black: sendfile: user 0m0.000s sys 0m8.170s read/write 4k: user 0m0.470s sys 0m16.300s function old new delta bb_full_fd_action 394 474 +80 Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/copyfd.c: fix the case of copy buffer <= 4kbDenys Vlasenko2010-06-261-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tar: fix --to-command wrt short writesDenys Vlasenko2010-06-261-5/+16
| | | | | | | | | | | | function old new delta bb_copyfd_exact_size 51 98 +47 bb_full_fd_action 362 394 +32 get_header_tar 1546 1558 +12 data_extract_to_command 430 439 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 100/0) Total: 100 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb/copyfd.c: don't mmap a largish buffer if we only want to copy a few kbDenys Vlasenko2010-03-191-0/+3
| | | | | | | function old new delta bb_full_fd_action 283 295 +12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use FAST_FUNC: regparm on i386, otherwise no-onDenis Vlasenko2008-06-271-4/+4
| | | | | | | text data bss dec hex filename 808035 611 6868 815514 c719a busybox_old 804472 611 6868 811951 c63af busybox_unstripped
* explain why we use mmap instead of mallocDenis Vlasenko2007-12-021-0/+2
|
* Introduce FEATURE_COPYBUF_KB.Denis Vlasenko2007-12-021-8/+24
| | | | | | | | People who want smaller stack at any cost may use it to reduce cp's stack usage (FEATURE_COPYBUF_KB=1). Desktop people may get faster copy of big files (FEATURE_COPYBUF_KB=32 is ~30% faster than 4kb)
* bb_full_fd_action: remove potential xmalloc from NOFORK pathDenis Vlasenko2007-04-111-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cat: stop using stdio.h opens libbb: introduce & use open[3]_or_warn function old new delta open3_or_warn - 54 +54 bb_cat 115 144 +29 open_or_warn - 25 +25 unlzma 2404 2412 +8 chattr_main 334 339 +5 xstrtoul_range_sfx 251 255 +4 telnet_main 1514 1510 -4 static.opt 4 - -4 qgravechar 122 118 -4 fuser_add_pid 61 54 -7 fuser_add_inode 154 147 -7 writeFileToTarball 1542 1534 -8 refresh 1156 1148 -8 do_show 856 846 -10 read_leases 212 200 -12 setup_redirects 236 222 -14 iproute_list_or_flush 1582 1568 -14 read_config 427 411 -16 write_leases 284 264 -20 hash_file 338 318 -20 copy_file 1760 1740 -20 do_iproute 2610 2588 -22 bb_full_fd_action 320 269 -51 open_to_or_warn 103 49 -54 fuser_main 1660 1596 -64 .rodata 131160 131096 -64 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 4/19 up/down: 125/-423) Total: -298 bytes
* make a few struct bb_applet members conditionalDenis Vlasenko2007-04-101-2/+2
| | | | | | rename sllep_and_die -> xfunc_die make fflush_stdout_and_exit NOFORK-safe fix some buglets found by randomconfig
* audit small applets and mark some of them as NOFORK.Denis Vlasenko2007-04-101-7/+4
| | | | | Put big scary warnings in relevant places.
* make xfunctions optionally longjump instead of exit.Denis Vlasenko2007-04-091-2/+2
| | | | | use it for making NOFORK more practical. touch: make it a NOFORK applet
* Trailing whitespace removal over entire treeDenis Vlasenko2007-01-111-1/+1
|
* tar et al: die if bb_copyfd_size copies less than asked for.Denis Vlasenko2006-12-221-6/+26
| | | | (we have bb_copyfd_exact_size now for that kind of usage)
* tee: fix bug: argv[-1] is a no-no!Denis Vlasenko2006-11-251-17/+30
| | | | | bb_full_fd_action: optimize die_if_ferror: "<applet>: filename" isn't a good err msg, add "..I/O error"
* tar: cry murder and bail out if file shrinks under us while we tar it upDenis Vlasenko2006-11-241-2/+1
|
* correct largefile support, add comments about it.Denis Vlasenko2006-10-081-5/+5
|
* style fixesDenis Vlasenko2006-09-171-5/+4
|
* Cleaup read() and write() variants, plus a couple of new functions likeRob Landley2006-07-161-8/+8
| | | | xlseek and fdlength() for the new mkswap.
* - move buffer allocation schemes to libbb.hBernhard Reutner-Fischer2006-04-031-1/+0
| | | | - include the correct headers: applets need busybox.h while lib* need libbb.h
* Robert P. Day removed 8 gazillion occurrences of "extern" on functionRob Landley2006-03-061-2/+2
| | | | definitions. (That should only be on prototypes.)
* Bug fix from Kim B. Heino, manifested via:Rob Landley2006-02-131-0/+1
| | | | echo > foo && zip foo.zip foo && ./busybox unzip foo.zip
* avoid signed<->unsigned warning"Vladimir N. Oleynik"2006-01-311-1/+1
|
* just whitespaceTim Riker2006-01-251-2/+2
|
* My last change to this file broke tar x. Sigh. (Trying to make sure we workRob Landley2005-11-121-4/+5
| | | | | on file sizes between 2 and 4 gigs on 32 bit machines. For supporting >4 gigs, just use a 64 bit machine already...)
* Fix bug 424: doing full_read breaks things like cat which should return aRob Landley2005-11-041-1/+1
| | | | | | | | | chunk of data when they get it and not block until they've buffered 4k. The use case was cat /proc/psaux, but you can also reproduce this by running non-busybox cat by itself and typing things at the command line. Then run busybox cat. Notice how cat is _supposed_ to echo each line back to us as we hit enter?
* When cp ran out of space it didn't return a nonzero error code. Fixes bug 493.Rob Landley2005-11-041-57/+27
|
* Correct errors preventing busybox tar from working properly,Eric Andersen2005-04-271-6/+11
| | | | fixing bug http://bugs.uclibc.org/view.php?id=231
* Rework to fix http://bugs.uclibc.org/view.php?id=107Eric Andersen2005-04-161-32/+41
|
* Remove trailing whitespace. Update copyright to include 2004.Eric Andersen2004-03-151-1/+1
|
* bb_full_fd_action was incorrectly returning an error message causingGlenn L McGrath2004-02-231-2/+2
| | | | major breaking.
* Sometimes i get carried away with the use of function pointers, im sureGlenn L McGrath2004-02-211-5/+5
| | | | it seemed like a good idea at the time.
* When a size of 0 is passed to copyfd_size, dont do anything, it wasGlenn L McGrath2003-11-241-1/+4
| | | | reading untill eof which breaks tar
* Fix warningGlenn L McGrath2003-11-221-2/+6
|
* As we no longer use function pointers for read in common archiving codeGlenn L McGrath2003-11-211-25/+36
| | | | | | | archive_xread can be replaced with bb_full_read, and archive_copy_file with bb_copyfd* bb_copyfd is split into two functions bb_copyfd_size and bb_copyfd_eof, they share a common backend.
* Update a bunch of docs. Run a script to update my email addr.Eric Andersen2003-07-141-1/+1
|
* Major coreutils update.Manuel Novoa III2003-03-191-45/+31
|
* Merge copyfd and copy_file_chunkGlenn L McGrath2002-12-131-15/+42
|
* Major rework of the directory structure and the entire build system.Eric Andersen2001-10-241-1/+1
| | | | -Erik
* Rewrote copyfd to use library functions, terminate, and copy correct data.Matt Kraai2001-05-181-24/+16
|
* This patch from Adam Heath <doogie@debian.org>, makes print_fileEric Andersen2001-05-151-0/+67
(used by cat, grep, sed, etc) quite a bit faster.