File: getcwd.c

package info (click to toggle)
lfc-postgres 1.7.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 13,676 kB
  • ctags: 10,779
  • sloc: ansic: 146,136; sh: 13,176; perl: 11,142; python: 5,529; cpp: 5,113; sql: 1,790; makefile: 861; fortran: 113
file content (45 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * $Id: getcwd.c,v 1.1 2005/03/31 13:13:00 baud Exp $
 */

/*
 * Copyright (C) 2001-2002 by CERN/IT/PDP/DM
 * All rights reserved
 */

#ifndef lint
static char sccsid[] = "@(#)$RCSfile: getcwd.c,v $ $Revision: 1.1 $ $Date: 2005/03/31 13:13:00 $ CERN/IT/PDP/DM Jean-Philippe Baud";
#endif /* not lint */

#if defined(_WIN32)
#include <direct.h>
#endif
/* getcwd.c      Remote File I/O - get current working directory        */

#define RFIO_KERNEL     1       /* KERNEL part of the routines          */

#include "rfio.h"               /* Remote File I/O general definitions  */

char DLL_DECL *rfio_getcwd(char *buf, int size)
{
   char *p;
   INIT_TRACE("RFIO_TRACE");
   TRACE(1, "rfio", "rfio_getcwd()");

   if ( rfio_HsmIf_GetCwdType() > 0 ) {
          /*
           * HSM file
           */
          TRACE(1, "rfio", "rfio_getcwd: current working directory is an HSM path");
          END_TRACE();
          rfio_errno = 0;
          return(rfio_HsmIf_getcwd(buf, size));
   }
   TRACE(1, "rfio", "rfio_getcwd: using local getcwd()");

   END_TRACE();
   rfio_errno = 0;
   p = getcwd(buf, size);
   if ( ! p ) serrno = 0;
   return(p);
}