aboutsummaryrefslogtreecommitdiff
path: root/nscd/nscd.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-04-19 16:42:41 +0000
committerUlrich Drepper <drepper@redhat.com>2008-04-19 16:42:41 +0000
commitc52137d39101515cacb67a2bcd43b77bd06284e0 (patch)
tree301583f49438de52f3a7cf54676d958b4158ec8f /nscd/nscd.h
parent87a71b8d67e501d422528b8435e733e8e78a165a (diff)
downloadglibc-c52137d39101515cacb67a2bcd43b77bd06284e0.zip
glibc-c52137d39101515cacb67a2bcd43b77bd06284e0.tar.gz
glibc-c52137d39101515cacb67a2bcd43b77bd06284e0.tar.bz2
[BZ #5209, BZ #5381]
2008-04-15 Ulrich Drepper <drepper@redhat.com> [BZ #5209] * sysdeps/unix/sysv/linux/times.c: New file. [BZ #5381] * nscd/nscd.h: Define enum in_flight, mem_in_flight, and mem_in_flight_list variables. Add new parameter to mempool_alloc prototype. * nscd/mem.c (mempool_alloc): Take additional parameter. Initialize appropriate mem_in_flight element. (gc): Take allocations which have not yet been committed to the database into account. * nscd/cache.c (cache_add): Add new parameter to mempool_alloc call. Reset mem_in_flight before returning. * nscd/connections.c (nscd_run_worker): Initialize mem_in_flight and cue it up in mem_in_flight_list. * nscd/aicache.c: Adjust mempool_alloc call. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/initgrcache.c: Likewise. * nscd/pwdcache.c: Likewise. * nscd/servicescache.c: Likewise. * nscd/Makefile (nscd-flags): Until ld is fixed, use -fpic instead of -fpie. * nscd/connections.c (handle_request): Provide better error message in case SELinux forbids the service. * version.h (VERSION): Bump to 2.8.90.
Diffstat (limited to 'nscd/nscd.h')
-rw-r--r--nscd/nscd.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/nscd/nscd.h b/nscd/nscd.h
index ec2d945..cbea8e1 100644
--- a/nscd/nscd.h
+++ b/nscd/nscd.h
@@ -181,6 +181,31 @@ extern uid_t old_uid;
extern gid_t old_gid;
+/* Memory allocation in flight. Each thread can have a limited number
+ of allocation in flight. No need to create dynamic data
+ structures. We use fixed indices. */
+enum in_flight
+ {
+ IDX_result_data = 0,
+ /* Keep the IDX_record_data entry last at all times. */
+ IDX_record_data = 1,
+ IDX_last
+ };
+extern __thread struct mem_in_flight
+{
+ struct
+ {
+ int dbidx;
+ nscd_ssize_t blocklen;
+ void *blockaddr;
+ } block[IDX_last];
+
+ struct mem_in_flight *next;
+} mem_in_flight;
+/* Global list of the mem_in_flight variables of all the threads. */
+extern struct mem_in_flight *mem_in_flight_list;
+
+
/* Prototypes for global functions. */
/* nscd.c */
@@ -271,7 +296,8 @@ extern void readdservbyport (struct database_dyn *db, struct hashentry *he,
struct datahead *dh);
/* mem.c */
-extern void *mempool_alloc (struct database_dyn *db, size_t len);
+extern void *mempool_alloc (struct database_dyn *db, size_t len,
+ enum in_flight idx);
extern void gc (struct database_dyn *db);