summaryrefslogtreecommitdiff
path: root/tirpc
diff options
context:
space:
mode:
authorJaime Caamano Ruiz <jcaamano@suse.com>2020-06-16 13:00:52 -0400
committerSteve Dickson <steved@redhat.com>2020-06-17 10:58:37 -0400
commite7c34df8f57331063b9d795812c62cec3ddfbc17 (patch)
treeb0abe1765cb7d440584b7fb5114109ec5de27186 /tirpc
parentc300af4954948019eb58bd2cefdf373cb2994eff (diff)
downloadti-rpc-e7c34df8f57331063b9d795812c62cec3ddfbc17.tar.gz
libtirpc: replace array with list for per-fd lockslibtirpc-1-2-7-rc3
Currently per-fd locks for the clients are pre-allocated up to the soft limit of maximum allowed open file desciptors per process as defined in __rpc_dtbsize(): if (getrlimit(RLIMIT_NOFILE, &rl) == 0) { return (tbsize = (int)rl.rlim_cur); } This limit can be arbitrarily large for any given process resulting in unreasonable memory allocation. For example, for systemd PID1 process this limit is set to 1073741816 since version 240. systemd is an indirect user of this library as it fetches information about users, groups, etc... This patch proposes a list implementation of per-fd locks based on glibc doubly linked lists. It also includes support for a fixed array based pre-allocation up to a compile-time defined limit of locks for equivalence to the previous implementation. Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'tirpc')
-rw-r--r--tirpc/reentrant.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tirpc/reentrant.h b/tirpc/reentrant.h
index 5f5c96e..5bb581a 100644
--- a/tirpc/reentrant.h
+++ b/tirpc/reentrant.h
@@ -57,6 +57,7 @@
#define mutex_unlock(m) pthread_mutex_unlock(m)
#define cond_init(c, a, p) pthread_cond_init(c, a)
+#define cond_destroy(c) pthread_cond_destroy(c)
#define cond_signal(m) pthread_cond_signal(m)
#define cond_broadcast(m) pthread_cond_broadcast(m)
#define cond_wait(c, m) pthread_cond_wait(c, m)