Jiffin Tony Thottan 1ead86a8bc libgfapi: adding 'follow' flag to glfs_h_lookupat()
Previously glfs_h_lookupat won't follow the symlink, this patch
introduces new flag `follow` which will resolve the same. Applications
linking against the new library will need to use the new glfs_h_lookupat
API call.

In order to stay compatible with existing binaries that use the previous
glfs_h_lookupat() function, the old symbol needs to stay available.

Verification that there are two versions of glfs_h_lookupat:

  $ objdump -T /usr/lib64/libgfapi.so.0 | grep -w glfs_h_lookupat
  0000000000015070 g    DF .text  000000000000021e  GFAPI_3.7.4 glfs_h_lookupat
  0000000000015290 g    DF .text  0000000000000008 (GFAPI_3.4.2) glfs_h_lookupat

Testing with a binary (based on anonymous_fd_read_write.c from ./tests/)
that was linked against the old library:

  $ objdump -T ./lookupat | grep -w glfs_h_lookupat
  0000000000000000      DF *UND*  0000000000000000  GFAPI_3.4.2 glfs_h_lookupat

Enable debugging for 'ld.so' so that we can check that the GFAPI_3.4.2
version of the symbol gets loaded:

  $ export LD_DEBUG_OUTPUT=lookupat.ld.log LD_DEBUG=all
  $ ./lookupat
  $ grep -w glfs_h_lookupat lookupat.ld.log.2543
  2543:     symbol=glfs_h_lookupat;  lookup in file=./lookupat [0]
  2543:     symbol=glfs_h_lookupat;  lookup in file=/lib64/libgfapi.so.0 [0]
  2543:     binding file ./lookupat [0] to /lib64/libgfapi.so.0 [0]: normal symbol `glfs_h_lookupat' [GFAPI_3.4.2]

Change-Id: I8bf9b1c19a0585f681bc1a7f84aad1ccd0f75f6a
BUG: 1252410
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/11883
Reviewed-by: soumya k <skoduri@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
2015-08-24 09:21:51 -07:00
..
2012-07-18 12:12:25 -07:00
2012-07-18 12:12:25 -07:00

This is an example application which uses libgfapi. It is
a complete autotools based build system which demonstrates the
required changes in configure.ac, Makefile.am etc to successfuly
detect for and build an application against libgfapi.

There are two approaches to building a libgfapi based application:

1. In the presence of pkg-config in your build system.
This is the recommended approach which is also used in this example.
For this approach to work, you need to build glusterfs by passing
--pkgconfigdir=/usr/lib64/pkgconfig (or the appropriate directory)
in your distro. This already happens if you build RPMs with the
glusterfs.spec provided in glusterfs.git. You will also need to
install glusterfs-api RPM.

2. In the absence of pkg-config in your build system.
Make sure your LDFLAGS includes -L/path/to/lib where libgfapi.so is
installed and -I/path/to/include/glusterfs where the 'api' directory
containing the headers are available.

glfsxmp.c
=========

glfsxmp.c is an example application which uses libgfapi

Compilation Steps For glfsxmp.c
===============================

1. $./autogen.sh
2. $./configure

Note: Before running ./configure , as mentioned above, you need to
      take care of #1 or #2 i.e. pkg-config path or LDFLAGS and
      -I/<path> with correct values.

3. $make glfsxmp