[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
question about getcwd
From: |
Bruno Haible |
Subject: |
question about getcwd |
Date: |
Mon, 19 Feb 2007 00:36:18 +0100 |
User-agent: |
KMail/1.5.4 |
Hi Jim, Paul,
Does the following accurately describe the behaviour of getcwd() in gnulib?
I'm asking because lib/getcwd.c mentions a certain GNU extension, whereas
lib/getcwd.h merely refers to the POSIX spec.
/* Get the name of the current working directory, and put it in SIZE bytes
of BUF.
Return BUF if successful, or NULL if the directory couldn't be determined
or SIZE was too small.
See the POSIX:2001 specification
<http://www.opengroup.org/susv3xsh/getcwd.html>.
Additionally, the gnulib module 'getcwd' guarantees the following GNU
extension: If BUF is NULL, an array is allocated with 'malloc'; the array
is SIZE bytes long, unless SIZE == 0, in which case it is as big as
necessary. */
extern char * getcwd (char *buf, size_t size);
Bruno
- question about getcwd,
Bruno Haible <=