Date: Sun, 14 Nov 1999 00:07:52 +2400 From: "Peter Edwards" <peter.edwards@ireland.com> To: current@freebsd.org Cc: peter.edwards@openet-telecom.com Subject: fstat(1) breakage + fix Message-ID: <1829F7D8FD893D1178D000807CFB3258@peter.edwards.ireland.com>
next in thread | raw e-mail | index | archive | help
> THIS IS A MESSAGE IN 'MIME' FORMAT. Your mail reader does not support MIME. > Please read the first section, which is plain text, and ignore the rest. --Interpart.Boundary.11.22.33.M2Y13749 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, fstat(1) should be able to take a set of filenames as arguments to limit the results of its output to the specified files. However, it doesn't work at the moment, because of the existance of udev_t. (It compares the st_dev from the stat structure used by stat(2) with in-kernel dev_t structures. As it stands, "fstat <filename>" will never produce any output other than a header.) I've attached a patch that appears reliable. Can someone review it (and possibly commit??) -- Peter. _____________________________________ Get your free E-mail at http://www.ireland.com --Interpart.Boundary.11.22.33.M2Y13749 Content-Type: application/octet-stream; name="fstat.c.patch" Content-Disposition: attachment; filename="fstat.c.patch" Content-Transfer-Encoding: base64 Content-Description: fstat.c.patch KioqIC91c3Ivc3JjL3Vzci5iaW4vZnN0YXQvZnN0YXQuYy5vbGQJVHVlIEF1ZyAzMSAwMjox MjoxMyAxOTk5Ci0tLSAvdXNyL3NyYy91c3IuYmluL2ZzdGF0L2ZzdGF0LmMJRnJpIE5vdiAx MiAyMzo1NzoyNCAxOTk5CioqKioqKioqKioqKioqKgoqKiogNjEsNjYgKioqKgotLS0gNjEs NjcgLS0tLQogICNpbmNsdWRlIDxzeXMvZmlsZWRlc2MuaD4KICAjaW5jbHVkZSA8c3lzL3F1 ZXVlLmg+CiAgI2luY2x1ZGUgPHN5cy9waXBlLmg+CisgI2luY2x1ZGUgPHN5cy9jb25mLmg+ CiAgI2RlZmluZQlLRVJORUwKICAjaW5jbHVkZSA8c3lzL2ZpbGUuaD4KICAjaW5jbHVkZSA8 dWZzL3Vmcy9xdW90YS5oPgoqKioqKioqKioqK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pbm9kZS5pX3NpemU7CioqKioqKioqKioq KioqKgoqKiogNzI3LDczMiAqKioqCi0tLSA3MzQsNzU2IC0tLS0KICAJcmV0dXJuOwogIGJh ZDoKICAJcHJpbnRmKCIqIGVycm9yXG4iKTsKKyB9CisgCisgCisgLyoKKyAgKiBSZWFkIHRo ZSBzcGVjaW5mbyBzdHJ1Y3R1cmUgaW4gdGhlIGtlcm5lbCAoYXMgcG9pbnRlZCB0byBieSBh IGRldl90KQorICAqIGluIG9yZGVyIHRvIHdvcmsgb3V0IHRoZSBhc3NvY2lhdGVkIHVkZXZf dAorICAqLworIHN0YXRpYyB1ZGV2X3QgZGV2MnVkZXYoZGV2KQorICAgICBkZXZfdCBkZXY7 CisgeworIAlzdHJ1Y3Qgc3BlY2luZm8gc2k7CisgCWlmIChrdm1fcmVhZChrZCwgKHVfbG9u ZylkZXYsIChjaGFyICopJnNpLCBzaXplb2Ygc2kpID09IHNpemVvZiBzaSkgeworIAkJcmV0 dXJuIHNpLnNpX3VkZXY7CisgCX0gZWxzZSB7CisgCQlkcHJpbnRmKHN0ZGVyciwgImNhbid0 IGNvbnZlcnQgZGV2X3QgJXggdG8gYSB1ZGV2X3RcbiIsIGRldik7CisgCQlyZXR1cm4gLTE7 CisgCX0KICB9CiAgCiAgLyoK --Interpart.Boundary.11.22.33.M2Y13749-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1829F7D8FD893D1178D000807CFB3258>