diff options
| author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-05-11 18:23:14 +0530 | 
|---|---|---|
| committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-18 19:12:49 +0530 | 
| commit | e1ae573f73d69fe1a244ed1493793961dd4cf811 (patch) | |
| tree | 3a378fd3585ef663ccf54ff07dd73ae0f85688f9 /libglusterfsclient/src/libglusterfsclient.c | |
| parent | 35bf3f058473b61605fd28cd9cbee7726adedf9d (diff) | |
libglusterfsclient: Add telldir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.c')
| -rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.c | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index b4a7e6e546a..29ef163dfd2 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -6468,6 +6468,28 @@ out:          return;  } +off_t +glusterfs_telldir (glusterfs_dir_t dirfd) +{ +        libglusterfs_client_fd_ctx_t    *fd_ctx = NULL; +	off_t                           off = -1; + +        fd_ctx = libgf_get_fd_ctx ((fd_t *)dirfd); +        if (!fd_ctx) { +                errno = EBADF; +                goto out; +        } + +        pthread_mutex_lock (&fd_ctx->lock); +        { +                off = fd_ctx->offset; +        } +        pthread_mutex_unlock (&fd_ctx->lock); + +out: +        return off; +} +  static struct xlator_fops libgf_client_fops = {  };  | 
