summaryrefslogtreecommitdiff
path: root/tirpc/reentrant.h
Commit message (Collapse)AuthorAgeFilesLines
* libtirpc: replace array with list for per-fd lockslibtirpc-1-2-7-rc3Jaime Caamano Ruiz2020-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Add a pthread key initializer constantChuck Lever2014-01-231-0/+2
| | | | | | | | | | | | | Clean up: replace the naked "-1" with a symbolic constant that helps document what is going on. The name matches the name of the other pthread initializer constants. Also, since pthread_key_t is an unsigned integer, use a type cast to eliminate the implicit cast that occurs every time foo_key is compared to -1. This eliminates a number of compiler warnings. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fixed last remaining license issuesTom 'spot' Callaway2010-08-311-79/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Three files in libtirpc have the "BSD with advertising" or "BSD 4 clause" license on them (Free, but GPL incompatible). Thankfully, two of the three files (tirpc/libc_private.h and tirpc/nss_tls.h) aren't necessary on Linux at all. They were copied from FreeBSD, but FreeBSD (and NetBSD) include those headers, so they can be conditionalized out in the code. The third header, tirpc/reentrant.h originally came from FreeBSD, but had been modified to point to the Linux pthread equivalent functions. I'm pretty sure that would cause the code to break on FreeBSD/NetBSD. This patch does the following: - Zeros out tirpc/libc_private.h (This file should be deleted from the source control) - Zeros out tirpc/nss_tls.h (This file should be deleted from the source control) - Takes a fresh copy of tirpc/reentrant.h from FreeBSD CVS to inherit the new license (the advertising clause has been dropped in FreeBSD) - Updates tirpc/reentrant.h so that it contains the correct definition mappings for Linux, conditionalized only for Linux. - Updates all source files which #include libc_private.h so that the include is conditionalized on FreeBSD or NetBSD. I honestly don't think these files even need to be included on those platforms, but I'd rather be safe than sorry here. Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc-0.1.10 - tsd destory at unloadIan Kent2009-04-201-0/+1
| | | | | | | | | | | | | | | | | If tsd keys are created that use a function local to the library and are not destroyed at library unload this can lead to a SEGV if the library is unloaded before the last thread is unloaded. Also, calling free() on an address previously belonging to the now unloaded library might not be very good either. I'm not to clear about what happens to data areas used by shared libraries in terms of their presence or otherwise in the lifcycle of a shared library. This patch assumes that all threads using the library have exited prior to the library being unloaded but may be worth more thought. Signed-off-by: Ian Kent <ikent@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Initial commit of libtirpc 0.1.7Steve Dickson2007-04-201-0/+126
Signed-off-by: Steve Dickson <steved@redhat.com>