[PATCH] af_alg: fix my typo in afalg_buffer

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (afalg_buffer): Fix typo I recently introduced. (afalg_stream): Simplify and avoid the need for a runtime test at the end. --- ChangeLog| 5 + lib/af_alg.c | 19 ++- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog

[PATCH] af_alg: recover better from crypto failures

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (afalg_stream): Recover from crypto failures if the input stream is seekable, by repositioning the stream back to where it was, possibly by just calling sendfile with an offset arg. This lets us return -EAFNOSUPPORT instead of -EIO in some cases, which lets our callers try again

Re: Android/Termux pthread_cancel

2018-05-09 Thread Paul Eggert
On 05/08/2018 08:27 PM, Devin Hussey wrote: Hello, I noticed a bit of an issue with Gnulib and Android when trying to compile nano on Termux. Android, and by extension, Termux, is missing pthread_cancel, pthread_testcancel, pthread_setcancelstate, and pthread_setcanceltype. A workaround is

[PATCH] af_alg: distiguish I/O errors better

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (afalg_buffer, afalg_stream): Return -EAFNOSUPPORT, not -EIO, if it’s OK for the caller to try again with user-mode code. (afalg_stream) [!_WIN32 || __CYGWIN__]: Return -EIO (not possibly some other error number) if fflush fails, as the caller should not try again that case. ---

[PATCH] af_alg: avoid gotos

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (afalg_buffer, afalg_stream): Rewrite to avoid gotos, as they were a source of unreliability and made the code a bit harder to follow. --- ChangeLog| 5 lib/af_alg.c | 76 ++-- 2 files changed, 37 insertions(+), 44

[PATCH] af_alg: don’t leak file descriptors into children

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (alg_socket): Use SOCK_CLOEXEC when creating sockets. This code should be compiled only on recent GNU/Linux platforms so we shouldn’t have to also depend on the accept4 module. --- ChangeLog| 5 + lib/af_alg.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff

[PATCH] af_alg: fix file descriptor leak

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (afalg_stream): Close leak. --- ChangeLog| 3 +++ lib/af_alg.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41bc0fbac..a738b5990 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2018-05-09 Paul Eggert

[PATCH] af_alg: coalesce socket creation

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (alg_socket): New function. (afalg_buffer, afalg_stream): Use it. This avoids some code duplication and gotos. --- ChangeLog| 5 lib/af_alg.c | 81 ++-- 2 files changed, 32 insertions(+), 54 deletions(-) diff --git

[PATCH] af_alg: Pacify --enable-gcc-warnings on GCC 8

2018-05-09 Thread Paul Eggert
* lib/af_alg.c (afalg_buffer, afalg_stream): Reorder local decls and checking to pacify gcc -Wjump-misses-init on GCC 8. --- ChangeLog| 6 ++ lib/af_alg.c | 40 +--- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog

Re: af_alg benchmarks and performance

2018-05-09 Thread Assaf Gordon
Hello Matteo and all, Let me emphasize that I'm not against this feature, but I just think it should be disabled by default, and enabled explicitly with a "configure" flag when downstream users want it and deemed it worthwhile. On 09/05/18 02:57 AM, Matteo Croce wrote: [...] All this kernel

Android/Termux pthread_cancel

2018-05-09 Thread Devin Hussey
Hello, I noticed a bit of an issue with Gnulib and Android when trying to compile nano on Termux. Android, and by extension, Termux, is missing pthread_cancel, pthread_testcancel, pthread_setcancelstate, and pthread_setcanceltype. A workaround is in

Re: af_alg benchmarks and performance

2018-05-09 Thread Matteo Croce
On Wed, May 9, 2018 at 9:29 AM, Paul Eggert wrote: >> Fortunately other non deprecated algos like sha256 are way >> faster. > > > Faster than when --with-openssl is used? Can you show me how to benchmark > that? > Faster than the C code. The performance of af_alg and openssl

Re: af_alg benchmarks and performance

2018-05-09 Thread Paul Eggert
Fortunately other non deprecated algos like sha256 are way faster. Faster than when --with-openssl is used? Can you show me how to benchmark that? After reading Assaf's comments I confess that I'm not getting the point of the recent changes. As I understand it, the hardware support in