1271294Sngie/*
2271294Sngie * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska H��gskolan
3271294Sngie * (Royal Institute of Technology, Stockholm, Sweden).
4271294Sngie * All rights reserved.
5271294Sngie *
6271294Sngie * Redistribution and use in source and binary forms, with or without
7271294Sngie * modification, are permitted provided that the following conditions
8271294Sngie * are met:
9271294Sngie *
10271294Sngie * 1. Redistributions of source code must retain the above copyright
11271294Sngie *    notice, this list of conditions and the following disclaimer.
12271294Sngie *
13271294Sngie * 2. Redistributions in binary form must reproduce the above copyright
14271294Sngie *    notice, this list of conditions and the following disclaimer in the
15271294Sngie *    documentation and/or other materials provided with the distribution.
16271294Sngie *
17271294Sngie * 3. Neither the name of the Institute nor the names of its contributors
18271294Sngie *    may be used to endorse or promote products derived from this software
19271294Sngie *    without specific prior written permission.
20271294Sngie *
21271294Sngie * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22271294Sngie * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23271294Sngie * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24271294Sngie * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25271294Sngie * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26271294Sngie * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27271294Sngie * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28271294Sngie * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29271294Sngie * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include <config.h>
35
36#ifdef HAVE_UNISTD_H
37#include <unistd.h>
38#endif
39#ifdef HAVE_SYS_PARAM_H
40#include <sys/param.h>
41#endif
42
43#include "roken.h"
44
45ROKEN_LIB_FUNCTION char* ROKEN_LIB_CALL
46getcwd(char *path, size_t size)
47{
48    char xxx[MaxPathLen];
49    char *ret;
50    ret = getwd(xxx);
51    if(ret)
52	strlcpy(path, xxx, size);
53    return ret;
54}
55