summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
Commit message (Expand)AuthorAgeFilesLines
...
* cluster/afr: Make sure latency-arg is passed to afrPranith Kumar K2018-04-182-2/+3
* libglusterfs: fix comparison of a NULL dict with a non-NULL dictXavi Hernandez2018-04-181-8/+8
* core/build/various: python3 compat, prepare for python2 -> python3Kaleb S. KEITHLEY2018-04-122-2/+2
* experimental/cloudsync: Download xlator for archival featureSusant Palai2018-04-102-2/+24
* mount/fuse: Add support for multi-threaded fuse readersKrutika Dhananjay2018-04-021-0/+1
* Quota: heal directory on newly added bricks when quota limit is reachedSanoj Unnikrishnan2018-03-284-2/+229
* storage/posix: Add active-fd-count option in glusterPranith Kumar K2018-03-214-0/+6
* glusterd: TLS verification fails while using intermediate CAMohit Agrawal2018-03-193-2/+49
* cleanup: xlator_t structure's 'client_latency' variable is not usedSven Fischer2018-03-191-8/+7
* protocol: Fix 4.0 client, parsing older iatt in dictShyamsundarR2018-03-104-0/+104
* protocol: Added iatt conversion to older formatShyamsundarR2018-03-101-0/+47
* core: provide infra to make any xlator pass-throughAmar Tumballi2018-03-093-12/+41
* libglusterfs: Fix coverity issue FORWARD_NULLPoornima G2018-03-021-7/+4
* libglusterfs: Fix volume_options_t structKaushal M2018-03-022-1/+18
* libglusterfs: move compat RPC/XDR #defines to eliminate warningsKaleb S. KEITHLEY2018-02-272-20/+13
* options: framework for options levelsN Balachandran2018-02-271-0/+10
* performance/io-threads: nuke everything from a client when it disconnectsVarsha Rao2018-02-271-4/+5
* rpcsvc: scale rpcsvc_request_handler threadsMilind Changire2018-02-261-0/+7
* xlators/features/namespace: Add namespace xlator and link into brick graphVarsha Rao2018-02-213-1/+11
* posix/afr: handle backward compatibility for rchecksum fopRavishankar N2018-02-193-0/+10
* metrics: set latency min value during xlator initAmar Tumballi2018-02-162-1/+9
* Fetch backup volfile servers from glusterd2Prashanth Pai2018-02-164-0/+138
* libglusterfs/syncop: Add syncop_entrylkRaghavendra G2018-02-133-0/+43
* gfapi: return pre/post attributes from glfs_ftruncateKinglong Mee2018-02-123-2/+16
* gfapi: return pre/post attributes from glfs_fsync/fdatasyncKinglong Mee2018-02-123-4/+17
* gfapi: return pre/post attributes from glfs_pread/pwriteKinglong Mee2018-02-123-5/+24
* io-threads: Implement put fopPoornima G2018-02-121-0/+4
* performance/io-threads: expose io-thread queue depthsVarsha Rao2018-02-082-1/+40
* cluster/dht: avoid overwriting client writes during migrationSusant Palai2018-02-021-0/+5
* statedump: sanity check of mem_acct and rec for xlatorKinglong Mee2018-01-311-2/+2
* glusterd: Update op-version for masterShyamsundarR2018-01-301-1/+3
* rpc: Showing some unusual timer error logs during brick stopMohit Agrawal2018-01-301-15/+3
* quiesce, gfproxy: Implement failover across multiple gfproxy nodesPoornima G2018-01-302-1/+5
* gfapi : New APIs have been added to use lease feature in glusterSoumya Koduri2018-01-261-0/+1
* build: use libtirpc by default, even if ipv6 is not the defaultKaleb S. KEITHLEY2018-01-261-1/+2
* dentry fop serializer: added new server side xlator for dentry fop serializationSakshi Bansal2018-01-241-0/+1
* libglusterfs: Reset errno before callv4.1devNigel Babu2018-01-231-1/+4
* libgfapi: Add new api for supporting mandatory-locksAnoop C S2018-01-221-2/+3
* md-cache: Implement dynamic configuration of xattr list for cachingPoornima G2018-01-223-0/+21
* protocol: make on-wire-change of protocol using new XDR definition.Amar Tumballi2018-01-191-209/+0
* gfapi : added glfs_setfsleaseid() for setting lease idSoumya Koduri2018-01-191-0/+1
* cluster/afr: Adding option to take full file lockkarthik-us2018-01-191-0/+2
* rpc/*: auth-header changesAmar Tumballi2018-01-171-0/+5
* dict: add another type to handle backward compatibilityAmar Tumballi2018-01-174-6/+35
* locks: added inodelk/entrylk contention upcall notificationsXavier Hernandez2018-01-161-0/+17
* dict: fix VALIDATE_DATA_AND_LOG callAtin Mukherjee2018-01-071-2/+2
* libglusterfs: Include key name in data type validationN Balachandran2018-01-051-27/+27
* dict: add more types for valuesAmar Tumballi2018-01-053-6/+162
* libglusterfs: export minimum necessary symbolsKaleb S. KEITHLEY2018-01-022-2/+1093
* posix: Introduce flags for validity of iatt membersRavishankar N2017-12-291-10/+49
9' href='#n619'>619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
/*
   Copyright (c) 2007-2010 Gluster, Inc. <http://www.gluster.com>
   This file is part of GlusterFS.

   GlusterFS is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published
   by the Free Software Foundation; either version 3 of the License,
   or (at your option) any later version.

   GlusterFS is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see
   <http://www.gnu.org/licenses/>.
*/


/* LD PRELOAD'able library
 * A very simple library that intercepts booster supported system calls
 * and prints a log message to stdout.
 *
 * Combined with the ld-preload-test, we cam determine whether all system calls
 * are getting redirected into this library when LD_PRELOAD'ed. This helps us
 * conduct a basic test to ensure that the required syscalls actually will
 * be intercepted by the booster library.
 */

#include <dlfcn.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <utime.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <attr/xattr.h>
#include <sys/sendfile.h>

/* Err number that is assigned to errno so that test application can
 * verify that the function was intercepted correctly.
 */
#define PRELOAD_ERRNO_VERF      6449
#define set_errno()             (errno = PRELOAD_ERRNO_VERF)

inline void
intercept (char *call, int tabs)
{
        while (tabs > 0) {
                fprintf (stdout, "\t");
                --tabs;
        }

        fprintf (stdout, "Intercepted by %s", call);
}

int
creat64 (const char *pathname, mode_t mode)
{
        intercept ("creat64", 2);
        set_errno ();
        return -1;
}

int
creat (const char *pathname, mode_t mode)
{
        intercept ("creat", 2);
        set_errno ();
        return -1;
}


int
close (int fd)
{
        intercept ("close", 2);
        set_errno ();
        return -1;
}

int
open64 (const char *pathname, int flags, ...)
{
        intercept ("open64", 2);
        set_errno ();
        return -1;
}


int
open (const char *pathname, int flags, ...)
{
        intercept ("open", 2);
        set_errno ();
        return -1;
}

ssize_t
read (int fd, void *buf, size_t count)
{
        intercept ("read", 2);
        set_errno ();
        return -1;
}

ssize_t
readv (int fd, const struct iovec *vector, int count)
{
        intercept ("readv", 2);
        set_errno ();
        return -1;
}

ssize_t
pread (int fd, void *buf, size_t count, unsigned long offset)
{
        intercept ("pread", 2);
        set_errno ();
        return -1;
}


ssize_t
pread64 (int fd, void *buf, size_t count, uint64_t offset)
{
        intercept ("pread64", 2);
        set_errno ();
        return -1;
}

ssize_t
write (int fd, const void *buf, size_t count)
{
        intercept ("write", 2);
        set_errno ();
        return -1;
}

ssize_t
writev (int fd, const struct iovec *vector, int count)
{
        intercept ("writev", 2);
        set_errno ();
        return -1;
}

ssize_t
pwrite (int fd, const void *buf, size_t count, unsigned long offset)
{
        intercept ("pwrite", 2);
        set_errno ();
        return -1;
}

ssize_t
pwrite64 (int fd, const void *buf, size_t count, uint64_t offset)
{
        intercept ("pwrite64", 2);
        set_errno ();
        return -1;
}


off_t
lseek (int fildes, unsigned long offset, int whence)
{
        intercept ("lseek", 2);
        set_errno ();
        return -1;
}

off_t
lseek64 (int fildes, uint64_t offset, int whence)
{
        intercept ("lseek64", 2);
        set_errno ();
        return -1;
}


int
dup (int fd)
{
        intercept ("dup", 2);
        set_errno ();
        return -1;
}

int
dup2 (int oldfd, int newfd)
{
        intercept ("dup2", 2);
        set_errno ();
        return -1;
}

int
mkdir (const char *pathname, mode_t mode)
{
        intercept ("mkdir", 2);
        set_errno ();
        return -1;
}

int
rmdir (const char *pathname)
{
        intercept ("rmdir", 2);
        set_errno ();
        return -1;
}

int
chmod (const char *pathname, mode_t mode)
{
        intercept ("chmod", 2);
        set_errno ();
        return -1;
}

int
chown (const char *pathname, uid_t owner, gid_t group)
{
        intercept ("chown", 2);
        set_errno ();
        return -1;
}

int
fchmod (int fd, mode_t mode)
{
        intercept ("fchmod", 2);
        set_errno ();
        return -1;
}

int
fchown (int fd, uid_t uid, gid_t gid)
{
        intercept ("fchown", 2);
        set_errno ();
        return -1;
}

int fsync (int fd)
{
        intercept ("fsync", 2);
        set_errno ();
        return -1;
}


int
ftruncate (int fd, off_t length)
{
        intercept ("ftruncate", 1);
        set_errno ();
        return -1;
}


int
ftruncate64 (int fd, off_t length)
{
        intercept ("ftruncate64", 1);
        set_errno ();
        return -1;
}

int
link (const char *oldpath, const char *newname)
{
        intercept ("link", 2);
        set_errno ();
        return -1;
}

int
rename (const char *oldpath, const char *newpath)
{
        intercept ("rename", 2);
        set_errno ();
        return -1;
}

int
utimes (const char *path, const struct timeval times[2])
{
        intercept ("utimes", 2);
        set_errno ();
        return -1;
}

int
utime (const char *path, const struct utimbuf *buf)
{
        intercept ("utime", 2);
        set_errno ();
        return -1;
}


int
mknod (const char *path, mode_t mode, dev_t dev)
{
        intercept ("mknod", 2);
        set_errno ();
        return -1;
}

int
__xmknod (int ver, const char *path, mode_t mode, dev_t *dev)
{
        inter