Pathnames followed by "..." when printed using printpathn

Dmitry V. Levin ldv at altlinux.org
Wed May 28 16:31:54 UTC 2014


On Wed, May 28, 2014 at 08:12:05PM +0530, Zubin Mithra wrote:
> Hello,
> 
> >> (The current implementation is just a PoC and I haven't committed
> anything
> >> yet, I'll post a link to the commit as soon as I push it in.)
> >
> > This is your own repo, you can commit often!
> 
> I've added in the code for converting all paths that are printed via
> printpathn(hence, all paths via printpath too). Please find the code at [1].

It would be more convenient to comment the code posted to the list, so I
won't go into details, just write generic comments.

First, printing absolute paths is not the same as printing canonicalized
paths.  The first is straightforward, the second is more complicated and
may produce unexpected results.  For example, do you really want to follow
symlinks when decoding path names passed to open(2)?

Second, readlink("/proc/%u/cwd") may fail for other reasons than
ENAMETOOLONG, including ENOENT (either /proc is not mounted or the process
has been killed).  If for whatever reason it returned a value <= 0, there
is no way to convert a relative path to an absolute one.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20140528/1ae2688e/attachment.bin>


More information about the Strace-devel mailing list