---
name: "MSVCRT__getcwd"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/MSVCRT__getcwd"
---

# MSVCRT\_\_getcwd(3w)

## NAME

**MSVCRT\_\_getcwd** (MSVCRT.@)

## SYNOPSIS

char\* CDECL  MSVCRT\_\_getcwd\
  (\
   char\* *buf*,\
   int   *size*\
  )

## DESCRIPTION

Get the current working directory.

## PARAMS

*buf* **\[Out\]**  Destination for current working directory.

*size* **\[In\]**  Size of *buf* in characters.

## RETURNS

**Success:** If *buf* is **NULL**, returns an allocated string containing the path. Otherwise populates *buf* with the path and returns it.

**Failure:** **NULL**. errno indicates the error.

## IMPLEMENTATION

Not declared in a Wine header. The function is either undocumented, or missing from Wine.

Implemented in **"dlls/msvcrt/dir.c"**.

Debug channel **"msvcrt"**.
