This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFA gdb/utils.c (gdb_realpath) fallback patch for sco3.2v5
- From: rbrown64 at csc dot com dot au
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 20 Feb 2002 19:40:26 +1100
- Subject: RFA gdb/utils.c (gdb_realpath) fallback patch for sco3.2v5
This permits the 0211 snapshot to link & break in main on
i586-pc-sco3.2v5.0.2 (debugging itself).
Possibly this should be done with the configury and set a PATH_MAX
value in config.h using
$ getconf PATH_MAX /
1024
2002-02-20 Rodney Brown <rbrown64@csc.com.au>
* utils.c (gdb_realpath): Add pathconf fallback for sco3.2v5.
*** utils.c.orig Sun Feb 10 14:08:42 2002
--- utils.c Wed Feb 20 19:30:16 2002
***************
*** 2522,2527 ****
char buf[PATH_MAX];
#elif defined (MAXPATHLEN)
char buf[MAXPATHLEN];
#else
#error "Neither PATH_MAX nor MAXPATHLEN defined"
#endif
--- 2522,2529 ----
char buf[PATH_MAX];
#elif defined (MAXPATHLEN)
char buf[MAXPATHLEN];
+ #elif defined (HAVE_UNISTD_H) && defined(HAVE_ALLOCA)
+ char *buf = alloca ((size_t)pathconf ("/", _PC_PATH_MAX));
#else
#error "Neither PATH_MAX nor MAXPATHLEN defined"
#endif