Hi Zubin, On Fri, Jun 20, 2014 at 11:04:15AM +0530, [email protected] wrote: > --- a/util.c > +++ b/util.c > @@ -563,6 +563,42 @@ string_quote(const char *instr, char *outstr, long len, > int size) > return 0; > } > > + > +/* > + * Print the current working directory of the tracee process > + */ > +static bool > +print_tracee_cwd(struct tcb *tcp) > +{ > + char *linkpath = NULL; > + char cwd[MAXPATHLEN + 2]; > + int retval; > + ssize_t n; > + > + retval = asprintf(&linkpath, "/proc/%u/cwd", tcp->pid); > + if (retval == -1) > + return false;
Do you really like this approach? In cases like this (when a buffer of 21 bytes is surely enough) I'd rather use stack. -- ldv
pgpkastoO4Uhj.pgp
Description: PGP signature
------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
