Changeset 208:d93b6c1e83b7 in roaraudio for libroar/file.c
- Timestamp:
- 07/21/08 13:08:11 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/file.c
r202 r208 3 3 #include "libroar.h" 4 4 5 #define BUFSIZE 8192 6 #define BUFMAX 65536 7 8 ssize_t roar_file_send_raw (int out, int in) { 9 ssize_t r = 0; 10 ssize_t ret; 11 int len; 12 char buf[BUFSIZE]; 13 14 #ifdef ROAR_HAVE_LINUX_SENDFILE 15 while ((ret = sendfile(out, in, NULL, BUFMAX)) > 0) 16 r += ret; 17 #endif 18 19 // TODO: try mmap here! 20 21 while ((len = read(in, buf, BUFSIZE)) > 0) 22 r += write(out, buf, len); 23 24 return r; 25 } 26 5 27 //ll
Note: See TracChangeset
for help on using the changeset viewer.