> On Sun, Dec 04, 2011 at 03:58:36PM +0100, Romain Francoise wrote:
>> I think I spoke too fast. KERN_FILE_BYPID only gives you the inode number
>> of the cwd and the mountpoint of the filesystem where it's located.
>
> Hmmmmm. That sucks... looks like getcwd() works by walking each vnode on
> the way up to build a path.
>
> Can we do this on ANY platform apart from Linux?

On OS X you can get the pwd of a process you own like this:

    struct proc_vnodepathinfo vpi;
    int ret;
    ret = proc_pidinfo(pid, PROC_PIDVNODEPATHINFO, 0, &vpi, sizeof(vpi));
    if (ret == sizeof(vpi)) {
        return vpi.pvi_cdir.vip_path;
    }

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to