From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6106 invoked from network); 12 Oct 2020 17:47:23 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 12 Oct 2020 17:47:23 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 3C15E9CA81; Tue, 13 Oct 2020 03:47:18 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 0EC409CA7A; Tue, 13 Oct 2020 03:46:42 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=iitbombay-org.20150623.gappssmtp.com header.i=@iitbombay-org.20150623.gappssmtp.com header.b="EQCh22cW"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id CDB619CA7A; Tue, 13 Oct 2020 03:46:39 +1000 (AEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by minnie.tuhs.org (Postfix) with ESMTPS id 0879D93D6D for ; Tue, 13 Oct 2020 03:46:39 +1000 (AEST) Received: by mail-pg1-f193.google.com with SMTP id i2so15022000pgh.7 for ; Mon, 12 Oct 2020 10:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=RrOCORqTpMQHCDtI6B0VAu8uZZDBwPKJlcXELuDDjig=; b=EQCh22cWuhQnRRh1DUcavcwV1YHuc7flcZPKxy6a41ZMrRESgikNnuA2hTtofxzjki OeVF9eZ1s2yqBTUh6AJPSeGN3TskGr5JbwfhLL++0g84Jd3ZviVUl+4OEH+MTMCqwcAF 2zHSMtl+dA+cTXrj4XqghXWwPXEgR2tYl+5ce4z7qFc9ELopl8F0cvgFbK2DYKGdBw+G 89thh4fsB46ABmw817z7huxKQ4V1/ldXFKBeR1f3FVEzAymGcw7EnGc/oNfMDVCQ5PiM h4pyyZQfU7Ubf7T+DQW1X8mvasLYTh7MAPHF7pRb5EBTBpTxL6aEQBBps7ePK35ANB5Z 0yfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=RrOCORqTpMQHCDtI6B0VAu8uZZDBwPKJlcXELuDDjig=; b=RAyFDYpxw5Vbqm2kPWC/MU4O6B22wfI2/f6jrXJKivwxc4jBVMFibpmwx9xJf2Y922 1hgSZUMf4iiT2c5OyNOgt/o6E6LyH2zQtcuMfcUMqMccmCp8+dmT5OeyN1QHsgKew33H /gVycw5YEojeSsJhH9yzypI5Kv1yEymTnzFmr8wFCbDi49BidobCPesqGBCV26U59q/4 c1Pvn3PsGdHRRJhsQT+uGUnKfgsMafyCo/L0m1YQPs2fUprar4DKY6Va29/r9+EiPCjx pE/7GRfgBBrKAtEI5BfM7PYoLAoyMgm+X8xc8c4YsWq5QdP+og7i926qtuj2sCXR2gfT KRKg== X-Gm-Message-State: AOAM531f31Fklx/8RgcuFYK6j+o/8gQqOxVv1q+fp4pWRUT0QCBOvV2q Dhgr7aMgpQ+b4NtpIBOUIXl4VCQ3QqEQSIpk X-Google-Smtp-Source: ABdhPJzM8aYwjyTlvM6wMqy6QcXspS6yb+saU5HUox8PZ7y+K6SUE7tj8cW5ZFTmUgo9bdmvkhqMFw== X-Received: by 2002:a17:90a:a591:: with SMTP id b17mr21852006pjq.159.1602524796321; Mon, 12 Oct 2020 10:46:36 -0700 (PDT) Received: from [192.168.1.113] (172-125-77-130.lightspeed.sntcca.sbcglobal.net. [172.125.77.130]) by smtp.gmail.com with ESMTPSA id ck21sm24542302pjb.56.2020.10.12.10.46.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2020 10:46:35 -0700 (PDT) From: Bakul Shah Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Date: Mon, 12 Oct 2020 10:46:33 -0700 References: <20201010232948.5F33818C0A6@mercury.lcs.mit.edu> To: tuhs@minnie.tuhs.org In-Reply-To: Message-Id: <35E93126-1C37-471B-82E6-FEA71A062307@iitbombay.org> X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: [TUHS] FreeBSD disk devices (Re: Choice of Unix for 11/03 and 11/23+ Systems X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" On Oct 12, 2020, at 9:57 AM, Arthur Krewat wrote: > > On 10/11/2020 9:56 PM, Warner Losh wrote: >> unaligned I/O on the block device > Sorry, I have to laugh... isn't that an oxymoron? ;) Actually there are no *block* devices in FreeBSD. And while raw device files such as /dev/r no longer exist, it is the block devices (with their buffering etc.) that are gone. Only raw devices exist now. And FreeBSD raw disk device drivers don't allow unaligned I/O access. Nor should they paper over what is not allowed by the underlying device. Try #include #include #include unsigned char buf[1024]; int main(int c, char**v) { char* a = c > 1? v[1] : "1"; off_t off = (off_t)strtoull(a, 0, 0); ssize_t r = pread(0, buf, sizeof buf, off); if (r < 0) { perror("read"); return 1; } for (int i = 0; i < 4; i++) printf(" %02x", buf[i]); printf("\n"); return 0; }