This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Add comment about realpath(NULL)


Hello,

I've added the attached comment to the gdb_realpath() function. Implementation is left as an exercise for the reader.

Andrew
Wed Nov 13 19:51:05 2002  Andrew Cagney  <cagney@redhat.com>

	* utils.c (gdb_realpath): Add comment mentioning realpath with a
 	NULL buffer.

Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.85
diff -u -r1.85 utils.c
--- utils.c	12 Nov 2002 20:26:05 -0000	1.85
+++ utils.c	14 Nov 2002 00:47:42 -0000
@@ -2739,6 +2739,15 @@
   }
 #endif
 
+  /* FIXME: cagney/2002-11-13:
+
+     Method 2a: Use realpath() with a NULL buffer.  Some systems, due
+     to the problems described in in method 3, have modified their
+     realpath() implementation so that it will allocate a buffer when
+     NULL is passed in.  Before this can be used, though, some sort of
+     configure time test would need to be added.  Otherwize the code
+     will likely core dump.  */
+
   /* Method 3: Now we're getting desperate!  The system doesn't have a
      compile time buffer size and no alternative function.  Query the
      OS, using pathconf(), for the buffer limit.  Care is needed

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]