man(1) Manual page archive


     GETWD(3)                                                 GETWD(3)

     NAME
          getwd, getcwd - get current directory

     SYNOPSIS
          char *getwd(buf)
          char *buf;

          char *getcwd(buf, size)
          char *buf;

     DESCRIPTION
          Getwd and getcwd fill buf with a null-terminated string rep-
          resenting the current directory and return buf.

          Getwd is in the style of BSD systems and getcwd in that of
          System V.  If buf is 0, getcwd will call malloc(3) to allo-
          cate size bytes for the buffer.

     SEE ALSO
          pwd(1)

     DIAGNOSTICS
          On error, zero is returned and buf is filled with a diagnos-
          tic message.