[Lldb-commits] [PATCH] D15260: getwd(3) with NULL pointer extension is supported on NetBSD

Kamil Rytarowski via lldb-commits lldb-commits at lists.llvm.org
Sat Dec 5 20:51:41 PST 2015


krytarowski created this revision.
krytarowski added reviewers: emaste, tfiala, clayborg.
krytarowski added subscribers: joerg, lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

The getwd() and getcwd() functions conform to IEEE Std 1003.1-1990
(``POSIX.1'').  The IEEE Std 1003.1-2004 (``POSIX.1'') revision marked
getwd() as legacy and recommended the use of getcwd() instead.  The IEEE
Std 1003.1-2008 (``POSIX.1'') revision removed getwd() from the
specification.

The ability to specify a NULL pointer and have getcwd() allocate memory
as necessary is an extension.

The getwd() function appeared in 4.0BSD.

Repository:
  rL LLVM

http://reviews.llvm.org/D15260

Files:
  packages/Python/lldbsuite/test/api/multithreaded/common.h

Index: packages/Python/lldbsuite/test/api/multithreaded/common.h
===================================================================
--- packages/Python/lldbsuite/test/api/multithreaded/common.h
+++ packages/Python/lldbsuite/test/api/multithreaded/common.h
@@ -56,9 +56,9 @@
   }
 };
 
-/// Allocates a char buffer with the current working directory on Linux/Darwin
+/// Allocates a char buffer with the current working directory
 inline char* get_working_dir() {
-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
     return getwd(0);
 #else
     return get_current_dir_name();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15260.41999.patch
Type: text/x-patch
Size: 648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151206/33f15157/attachment.bin>


More information about the lldb-commits mailing list