Don't use buffered IO (fread) when not appropriate
fread reads the entire requested size (BUFSIZ), which causes tools to block if only small amounts of data are available at a time. At best, this causes unnecessary copies and inefficiency, at worst, tools like tee and cat are almost unusable in some cases since they only display large chunks of data at a time.
This commit is contained in:
committed by
Anselm R Garbe
parent
5cb3a1eba1
commit
9a3b12525b
2
crypt.h
2
crypt.h
@@ -8,5 +8,5 @@ struct crypt_ops {
|
||||
|
||||
int cryptcheck(int, char **, struct crypt_ops *, uint8_t *, size_t);
|
||||
int cryptmain(int, char **, struct crypt_ops *, uint8_t *, size_t);
|
||||
int cryptsum(struct crypt_ops *, FILE *, const char *, uint8_t *);
|
||||
int cryptsum(struct crypt_ops *, int, const char *, uint8_t *);
|
||||
void mdprint(const uint8_t *, const char *, size_t);
|
||||
|
Reference in New Issue
Block a user