From owner-freebsd-audit Wed Nov 14 15: 4:27 2001 Delivered-To: freebsd-audit@freebsd.org Received: from Veronica.wmol.com (veronica.wmol.com [208.242.83.241]) by hub.freebsd.org (Postfix) with ESMTP id D263E37B405 for ; Wed, 14 Nov 2001 15:04:22 -0800 (PST) Received: from rain.hill.hom (24.247.81.122.bay.mi.chartermi.net [24.247.81.122]) by Veronica.wmol.com (Vircom SMTPRS 5.0.193) with ESMTP id for ; Wed, 14 Nov 2001 17:54:47 -0500 Date: Wed, 14 Nov 2001 17:57:12 +0000 From: David Hill To: freebsd-audit@freebsd.org Subject: ping.c patch - select() -> kqueue() Message-Id: <20011114175712.46522c21.david@phobia.ms> X-Mailer: Sylpheed version 0.6.4 (GTK+ 1.2.10; i386--freebsd5.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed__14_Nov_2001_17:57:12_+0000_0816f400" Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --Multipart_Wed__14_Nov_2001_17:57:12_+0000_0816f400 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I am not sure if converting ping from using select() to kqueue() is worth anything, but here is a patch. David Hill david@phobia.ms --Multipart_Wed__14_Nov_2001_17:57:12_+0000_0816f400 Content-Type: application/octet-stream; name="ping.c.diff" Content-Disposition: attachment; filename="ping.c.diff" Content-Transfer-Encoding: base64 LS0tIHBpbmcuYy5vcmlnCVR1ZSBTZXAgMjUgMjA6MjI6MzMgMjAwMQorKysgcGluZy5jCVdlZCBO b3YgMTQgMTc6MDU6MzkgMjAwMQpAQCAtODEsNiArODEsOCBAQAogI2luY2x1ZGUgPHRlcm1pb3Mu aD4KICNpbmNsdWRlIDx1bmlzdGQuaD4KIAorI2luY2x1ZGUgPHN5cy90eXBlcy5oPgorI2luY2x1 ZGUgPHN5cy9ldmVudC5oPgogI2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0JCWZkX3NldCByZmRzOworCQlzdHJ1Y3QgdGlt ZXNwZWMgdHM7CiAKIAkJY2hlY2tfc3RhdHVzKCk7Ci0JCUZEX1pFUk8oJnJmZHMpOwotCQlGRF9T RVQocywgJnJmZHMpOwogCQkodm9pZClnZXR0aW1lb2ZkYXkoJm5vdywgTlVMTCk7CiAJCXRpbWVv dXQudHZfc2VjID0gbGFzdC50dl9zZWMgKyBpbnR2bC50dl9zZWMgLSBub3cudHZfc2VjOwogCQl0 aW1lb3V0LnR2X3VzZWMgPSBsYXN0LnR2X3VzZWMgKyBpbnR2bC50dl91c2VjIC0gbm93LnR2X3Vz ZWM7CkBAIC02NTYsNyArNjY0LDExIEBACiAJCX0KIAkJaWYgKHRpbWVvdXQudHZfc2VjIDwgMCkK IAkJCXRpbWVvdXQudHZfc2VjID0gdGltZW91dC50dl91c2VjID0gMDsKLQkJbiA9IHNlbGVjdChz ICsgMSwgJnJmZHMsIE5VTEwsIE5VTEwsICZ0aW1lb3V0KTsKKwkJCQorCQl0cy50dl9zZWMgPSB0 aW1lb3V0LnR2X3NlYzsKKwkJdHMudHZfbnNlYyA9IHRpbWVvdXQudHZfdXNlYyAqIDEwMDA7CisJ CQorCQluID0ga2V2ZW50KGtxLCBOVUxMLCAwLCAma2UsIDEsICZ0cyk7CiAJCWlmIChuIDwgMCkK IAkJCWNvbnRpbnVlOwkvKiBNdXN0IGJlIEVJTlRSLiAqLwogCQlpZiAobiA9PSAxKSB7CkBAIC03 MTQsNiArNzI2LDkgQEAKIAkJCX0KIAkJfQogCX0KKwkKKwljbG9zZShzKTsKKwljbG9zZShrcSk7 CiAJZmluaXNoKCk7CiAJLyogTk9UUkVBQ0hFRCAqLwogCWV4aXQoMCk7CS8qIE1ha2UgdGhlIGNv bXBpbGVyIGhhcHB5ICovCg== --Multipart_Wed__14_Nov_2001_17:57:12_+0000_0816f400-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message