From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 4 01:51:25 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50EF4106566C for ; Tue, 4 Sep 2012 01:51:25 +0000 (UTC) (envelope-from mrsam@courier-mta.com) Received: from www.courier-mta.com (www.courier-mta.com [216.254.115.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1BAF48FC0C for ; Tue, 4 Sep 2012 01:51:25 +0000 (UTC) Received: from monster.email-scan.com (monster.email-scan.com [::ffff:192.168.0.2]) (TLS: TLS1.0,256bits,RSA_AES_256_CBC_SHA1) by www.courier-mta.com with ESMTPS; Mon, 03 Sep 2012 21:46:18 -0400 id 000000000006008E.0000000050455D6A.00007216 Received: from monster.email-scan.com (localhost [127.0.0.1]) (IDENT: uid 1000) by monster.email-scan.com with ESMTP; Mon, 03 Sep 2012 21:46:17 -0400 id 000000000003E2F7.0000000050455D69.00005CC0 Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Sam Varshavchik To: freebsd-hackers@freebsd.org Date: Mon, 03 Sep 2012 21:46:17 -0400 Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_monster.email-scan.com-23058-1346723177-0001"; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: What happened to my /proc/curproc/file? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Sep 2012 01:51:25 -0000 This is a MIME GnuPG-signed message. If you see this text, it means that your E-mail or Usenet software does not support MIME signed messages. The Internet standard for MIME PGP messages, RFC 2015, was published in 1996. To open this message correctly you will need to install E-mail or Usenet software that supports modern Internet standards. --=_monster.email-scan.com-23058-1346723177-0001 Content-Type: text/plain; format=flowed; delsp=yes; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 7bit Am I the only one who's seeing this weirdness with procfs on 9.0-RELEASE-p3. Unless I'm overlooking something stupid, a process that rmdir(2)s a subdirectory of its current directory ends up with a broken /proc/curproc/file symlink: [mrsam@freebsd ~/stasher/stasher]$ cat t.c #include #include #include void dump(int n) { char buf[2048]; printf("Line %d, rc=%s\n", n, (readlink("/proc/curproc/file", buf, 2048) < 0 ? "err":"ok")); } int main(int argc, char **argv) { dump(__LINE__); mkdir("conftestdir.tst", 0777); rmdir("conftestdir.tst"); dump(__LINE__); } [mrsam@freebsd ~/stasher/stasher]$ cc -o t t.c [mrsam@freebsd ~/stasher/stasher]$ ./t Line 15, rc=ok Line 18, rc=err ??????? --=_monster.email-scan.com-23058-1346723177-0001 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlBFXWkACgkQx9p3GYHlUOIdiwCfTA/gJcjma05KVAyGYIyRNT9R UI8AniF646pssQnIJW6qyIm6G4JcQWhg =bY6o -----END PGP SIGNATURE----- --=_monster.email-scan.com-23058-1346723177-0001--