aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_util.c
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2015-08-20 17:28:04 -0500
committerPeter Seebach <peter.seebach@windriver.com>2015-08-21 11:12:55 -0500
commit0deb5e20ad9bea4426e67cc5fe86acefdd715c09 (patch)
tree9d9c83a3e421bfdae4357a2206608b91103670a4 /pseudo_util.c
parent79cd74c8643eeaef52e9f78135f60a9652bcf65c (diff)
downloadpseudo-0deb5e20ad9bea4426e67cc5fe86acefdd715c09.tar.gz
pseudo-0deb5e20ad9bea4426e67cc5fe86acefdd715c09.tar.bz2
pseudo-0deb5e20ad9bea4426e67cc5fe86acefdd715c09.zip
New option: Use extended attributes to store db values.
This is a moderately experimental feature which stores values in an extended attribute called 'user.pseudo_data' instead of in the database. Still missing: Database<->filesystem synchronization for this. For at least some workloads, this can dramatically improve performance. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Diffstat (limited to 'pseudo_util.c')
-rw-r--r--pseudo_util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pseudo_util.c b/pseudo_util.c
index 865222a..7142670 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -82,6 +82,10 @@ static struct pseudo_variables pseudo_env[] = {
*/
static int pseudo_util_initted = -1; /* Not yet run */
+/* bypass wrapper logic on path computations */
+int (*pseudo_real_lstat)(const char *path, struct stat *buf) = lstat;
+int (*pseudo_real_fstat)(int, struct stat *buf) = fstat;
+
#if 0
static void
dump_env(char **envp) {
@@ -512,7 +516,7 @@ pseudo_append_element(char *newpath, char *root, size_t allocated, char **pcurre
/* if lstat fails, that's fine -- nonexistent files aren't symlinks */
if (!leave_this) {
int is_link;
- is_link = (lstat(newpath, &buf) != -1) && S_ISLNK(buf.st_mode);
+ is_link = (pseudo_real_lstat(newpath, &buf) != -1) && S_ISLNK(buf.st_mode);
if (link_recursion >= PSEUDO_MAX_LINK_RECURSION && is_link) {
pseudo_diag("link recursion too deep, not expanding path '%s'.\n", newpath);
is_link = 0;