Date: Wed, 2 May 2007 15:45:09 -0500 From: "Scot Hetzel" <swhetzel@gmail.com> To: emulation@freebsd.org Subject: linuxolator: LTP lseek03 failure Message-ID: <790a9fff0705021345j2ad9ae98o56aaf357d556fe27@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
------=_Part_18673_30011306.1178138709916 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I have investigated the new LTP test failure for lseek03, and the first test sets whence to 4 (SEEK_HOLE): test 1 lseek(tfile_1554, 1, 4) Failed, errno=25 Inappropriate ioctl for device, expected 22(EINVAL) I looked at linux lseek man page and it showed only the SEEK_SET, SEEK_CUR, SEEK_END as valid values for whence. I then did a search, and while I did find mailing list archives that did have programmers trying to implement the SEEK_HOLE, SEEK_DATA extentions to lseek. But it hasn't been commited to the latest linux kernel (linux-2.6.21.1 from kernel.org). I have created a patch for lseek and llseek that limits whence to SEEK_SET, SEEK_CUR, SEEK_END. Scot -- DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised. ------=_Part_18673_30011306.1178138709916 Content-Type: text/x-diff; name=lseek.patch; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_f1837tf0 Content-Disposition: attachment; filename="lseek.patch" LS0tIGNvbXBhdC9saW51eC9saW51eF9maWxlLmMtb3JpZwlUdWUgQXByIDEwIDAwOjIwOjA4IDIw MDcKKysrIGNvbXBhdC9saW51eC9saW51eF9maWxlLmMJV2VkIE1heSAgMiAwOTo1NDoyMCAyMDA3 CkBAIC0yMzAsMjUgKzIzMCwzNiBAQAogaW50CiBsaW51eF9sc2VlayhzdHJ1Y3QgdGhyZWFkICp0 ZCwgc3RydWN0IGxpbnV4X2xzZWVrX2FyZ3MgKmFyZ3MpCiB7Ci0KLSAgICBzdHJ1Y3QgbHNlZWtf YXJncyAvKiB7Ci0JaW50IGZkOwotCWludCBwYWQ7Ci0Jb2ZmX3Qgb2Zmc2V0OwotCWludCB3aGVu Y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ArMjgwLDE3IEBACiAJYnNkX2FyZ3Mub2Zmc2V0ID0gb2Zm OwogCWJzZF9hcmdzLndoZW5jZSA9IGFyZ3MtPndoZW5jZTsKIAotCWlmICgoZXJyb3IgPSBsc2Vl ayh0ZCwgJmJzZF9hcmdzKSkpCisJLyogbGludXggb25seSBzdXBwb3J0cyBTRUVLX1NFVCwgU0VF S19DVVIsIFNFRUtfRU5EICovCisJc3dpdGNoKGFyZ3MtPndoZW5jZSkgeworCWNhc2UgU0VFS19T RVQ6CisJY2FzZSBTRUVLX0NVUjoKKwljYXNlIFNFRUtfRU5EOgorCSAgICBlcnJvciA9IGxzZWVr KHRkLCAmYnNkX2FyZ3MpOworCSAgICBicmVhazsKKwlkZWZhdWx0OgorCSAgICBlcnJvciA9IEVJ TlZBTDsKKwl9CisJaWYgKGVycm9yKQogCQlyZXR1cm4gZXJyb3I7CiAKIAlpZiAoKGVycm9yID0g Y29weW91dCh0ZC0+dGRfcmV0dmFsLCBhcmdzLT5yZXMsIHNpemVvZiAob2ZmX3QpKSkpCg== ------=_Part_18673_30011306.1178138709916--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0705021345j2ad9ae98o56aaf357d556fe27>