1/*
2 * Copyright (c) 2007, 2008, 2009, 2011, ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#include <unistd.h>
11#include <string.h>
12#include <vfs/vfs_path.h>
13#include "posixcompat.h"
14
15char *getcwd(char *buf, size_t size)
16{
17    char *cwd = getenv("PWD");
18    if(cwd == NULL) {
19        return NULL;
20    }
21    strncpy(buf, cwd, size);
22    return buf;
23}
24