From: Al Viro <viro@ZenIV.linux.org.uk>
To: George Spelvin <linux@horizon.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Is there a reason hard links from /proc/$PID/fd/$NUM are disallowed?
Date: Sun, 4 Dec 2011 21:00:27 +0000 [thread overview]
Message-ID: <20111204210027.GA2203@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20111204204044.10290.qmail@science.horizon.com>
On Sun, Dec 04, 2011 at 03:40:44PM -0500, George Spelvin wrote:
> I was trying to save a large file that was in mid-download that I had
> accidentally deleted (as part of making space in /tmp to hold the file!).
>
> Since it was being held open by the download process, I tried
>
> ln /proc/$PID/fd/$FD /tmp/bigfile.mp4
You do realize that link(2) does *NOT* follow links, do you? linkat(2)
does, if you explicitly ask for that:
linkat(AT_FDCWD, "/proc/42/fd/1", AT_FDCWD, "/tmp/foo", AT_SYMLINK_FOLLOW)
will do it just fine.
next prev parent reply other threads:[~2011-12-04 21:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-04 20:40 Is there a reason hard links from /proc/$PID/fd/$NUM are disallowed? George Spelvin
2011-12-04 21:00 ` Al Viro [this message]
2011-12-04 21:38 ` George Spelvin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111204210027.GA2203@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox