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=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13232 invoked from network); 9 May 2023 03:33:48 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 9 May 2023 03:33:48 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob0.topicbox.com (Postfix) with ESMTP id D453F324EA for ; Mon, 8 May 2023 23:33:46 -0400 (EDT) (envelope-from bounce.mM60ccbc9ae01219d2e2f46c4f.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id CDDFB1A3E50A; Mon, 8 May 2023 23:33:46 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=NNL9/DuW header.a=rsa-sha256 header.s=20221208 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=karisawa@gmail.com smtp.helo=mail-yb1-f173.google.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:from:date:message-id:to :content-type:list-help:list-id:list-post:list-subscribe :reply-to:subject:content-transfer-encoding:list-unsubscribe; s= sysmsg-1; t=1683603226; bh=KMMiiKcP4OJ3ChzrVLd4Ca2UyApaSYCJeOeco 7GdzRk=; b=kZ6QKru/ZeCrwkBgPopnXhL3Hsa0CCMQdJta+nMcypyzg305ktDFO kz3COoHaEzvZ5eDhEiPTfpujt1q+I4EY43MLg/VDY1GUhjIDKK2crzgofvIwFvNR LWnTzZqYCIdj+CY3evQ81YvEtDmaesAavFbT89XgQWCqaCCbJ4WGm4= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1683603226; b=uA3D6i3RfTj4lrzvii75tapIqGJJe46fT6WZ2OxjIVqZBy0gFR dxPHjg0dHDDZa/ZauyGHkEYnUSXjIh6H7g192bC4AXL1GpMUxfP3wnG2487PkOqu 587BMeF6pjIvygVfvj/9RP9ZdaULEaEitXIXIL+5GeJuAnyd1xGVoWoxE= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=NNL9/DuW header.a=rsa-sha256 header.s=20221208 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=karisawa@gmail.com smtp.helo=mail-yb1-f173.google.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=NNL9/DuW header.a=rsa-sha256 header.s=20221208 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.219.173 (mail-yb1-f173.google.com); spf=pass smtp.mailfrom=karisawa@gmail.com smtp.helo=mail-yb1-f173.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=Y0jYHSmT; x-me-sender=none; x-ptr=pass smtp.helo=mail-yb1-f173.google.com policy.ptr=mail-yb1-f173.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h= mime-version:from:date:message-id:to:content-type:list-help :list-id:list-post:list-subscribe:reply-to:subject :content-transfer-encoding:list-unsubscribe; s=dkim-1; t= 1683603226; x=1683689626; bh=fr3mJo/6JlqAxt3Lu0vbtDM7XHSedWLm7sE 12eINIFQ=; b=clkVjc/T6U3Z4nBs/7TdgjUvt5yKl1SaKgOehKjO4RCvdO00xXc QrC98l5ilQ1NfOP4cnPy5ynZ1XtRJlNXW6W2OnIsFrsQQMW6VOh/Lda1t+3NzbM4 nzys3KfVd3l22722YvTx+7L6n0onbG5jA1EqBn5bZEPJTpkZHdUf1PH8= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id CA1421A3E0CA for <9fans@9fans.net>; Mon, 8 May 2023 23:33:21 -0400 (EDT) (envelope-from karisawa@gmail.com) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 1FA8A2DAD2B; Mon, 8 May 2023 23:33:21 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1683603201; b=mOv6M8XeIBFTTOBUEMQeXZ901nai2LlB8KG8AmtYiOmFY5IU5x J8MzOi/hRlHXw6/ejOIw+uL3hkobJc4IiLTIvfiMAtvyVob8xqRViVMPsAe8O75u mxXAvZtkq80PfB6pe3Z9SAojuHxfty66g7tDXSr9pdAbqzYmxitMY0YuMboLww0X RfwxTM7765DTyqJoTbYTbu3/36HHunzTvYXoOEUIf5/RDmC9oty2O04B7CjX17LN nzGjdqcZf2CE8yRaxA1tnCUxa52q3BNR5kymYiXJ3WLhoJGffDR8BCio1FPAB7w5 8RT0z+WgxtWyvojvsEKTkNAiyLuU3PrGZ7OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:from:date:message-id:subject:to :content-type; s=arcseal; t=1683603201; bh=UJHirxov+kr+Pk3aP/IWF fMZbBhs/hhHOlxIO0oWNm4=; b=JgYQhS4waqBKxOj2Yz51J5fCJ9XHXPz9oNSi6 dpJ7iPY+8jHmlSOHEiSgu+5Ar2ZDxqlVDmX7dNyFMScrcBdh6AxKbdraKbsS1O0L zeg9TBcHMoVgHPfrl6o5YDdYCXwmHGlz5Zlpu0Dh6c5WeYmWYpzDE+EYdE3XqT/d 6ZO7b+AnhfRIi67UuxEl19dbN5b+CCxuYr2jgDVRudXvxDO1lgytT709ck+Bw5iH 0+dFsK1eiV1X8RORx8YSQq227HXTTI3+PMMEcIGUx6jUF2Oc+kd7LTSKZvX/gfJa vrUtmlnUxRJ/TZBS+dDBPDXt0MGuNPCD2J0W277guWncyOZ7w== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=NNL9/DuW header.a=rsa-sha256 header.s=20221208 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.219.173 (mail-yb1-f173.google.com); spf=pass smtp.mailfrom=karisawa@gmail.com smtp.helo=mail-yb1-f173.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=Y0jYHSmT; x-me-sender=none; x-ptr=pass smtp.helo=mail-yb1-f173.google.com policy.ptr=mail-yb1-f173.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-100 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefledgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepggfhfffkuffvtgesrgdtreertddtjeenucfhrhho mhepnjjnnjjnuceokhgrrhhishgrfigrsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpefhvdeijeeggffguddtteefhfehueekudekhfeugefhudevleefieetvddvuedv feenucffohhmrghinhepshhiiigvrdgtrghtnecukfhppedvtdelrdekhedrvdduledrud ejfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvtdelrdek hedrvdduledrudejfedphhgvlhhopehmrghilhdqhigsuddqfhdujeefrdhgohhoghhlvg drtghomhdpmhgrihhlfhhrohhmpeeokhgrrhhishgrfigrsehgmhgrihhlrdgtohhmqe X-ME-VSScore: -100 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'karisawa@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="karisawa@gmail.com"; helo=mail-yb1-f173.google.com; client-ip=209.85.219.173 Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Mon, 8 May 2023 23:33:20 -0400 (EDT) (envelope-from karisawa@gmail.com) Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-b9d881ad689so7006864276.2 for <9fans@9fans.net>; Mon, 08 May 2023 20:33:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683603200; x=1686195200; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UJHirxov+kr+Pk3aP/IWFfMZbBhs/hhHOlxIO0oWNm4=; b=Y0jYHSmTDaqlFUKVJLW/fdF29iiMjuLlpv6YDH9tUPeSBIfjoRvZrsspfFQz767JgX IZmtzi4/WpUwlyM9bsjNqt/ADr7ailZzuH5/+6akV2uSSceD9Nrrh6U67vdrKPhhuT4R pGowTTq/Vk9KTdXJ9fGbS+n49tVQ6F4sJw5fk3uShdDO0B7VUJCGTzAGyCykV/Ej2jSg 0N5przGYES6nIpbj7dbYrxLhbYzAZrmRzAcwJzR3igbUPPjDrIdFRqtgY91o9gYuU9RD mkWzaWRoyHC+alaUFGk4kt8dAFFeHNBBJq/56tUTkJjwTvS9mfq9EWRsKP6ZfQhqBRni y0Ww== X-Gm-Message-State: AC+VfDyvRnQdevfKy0Xb1rNAvr+DUHCxgU1SI2eszC8Nmc38WD+UjP/D AGUeChgWVxSRk15fHmAeuMx6ZYzTTfNllp8njA7JniRDOv4= X-Google-Smtp-Source: ACHHUZ5Z9O5oyIvwQqLArhnpy0XCF9RW+wOga5hLuQqbOveSHriZ9VF3c+sjSE8O2Et2FIaZHXeqNGKj3vx4ESM+6AY= X-Received: by 2002:a25:aacd:0:b0:ba1:ce5c:3a1d with SMTP id t71-20020a25aacd000000b00ba1ce5c3a1dmr13999757ybi.34.1683603200443; Mon, 08 May 2023 20:33:20 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?5pyJ5r6k5YGl5rK7?= Date: Tue, 9 May 2023 12:31:57 +0900 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=000000000000b4892405fb3a6aab Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 438514a8-ee1a-11ed-970b-8e3b83880bc6 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZjEzZjY1N2JlYjdiMTJjMC1NNjBjY2JjOWFlMDEyMTlkMmUyZjQ2?= =?UTF-8?B?YzRmPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Subject: [9fans] wctl Content-Transfer-Encoding: 7bit List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M60ccbc9ae01219d2e2f46c4f:1:5acFSKbIxJJM4CgMi4jFlK9lrzuuGaJsxiWXC7MicLE --000000000000b4892405fb3a6aab Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, 9fans In writing a program I met a problem on finding window size. cat /dev/wctl shows something like this: hebe% cat /dev/wctl 456 91 1214 603 current visible hebe% Need DEL key to stop. I want to get this info without manual intervention. I tried a experimental code: #include #include void main(void) { char buf[256]; int fd,n; fd =3D open("/dev/wctl",OREAD); print("%d\n",fd); //n =3D readn(fd,buf,1);//NG. buffer too small //n =3D readn(fd,buf,48);//NG. truncated //n =3D readn(fd,buf,56);//NG. truncated //n =3D readn(fd,buf,70);//NG. truncated n =3D readn(fd,buf,71);//OK, n=3D71 //n =3D readn(fd,buf,111);//OK. n=3D71 //n =3D readn(fd,buf,117);//OK. n=3D71 //n =3D readn(fd,buf,128);//NG. hungup /* I donn't know the reasnalbe value m for readn(fd,buf,m) */ if(n < 0){ print("%r\n"); } buf[n] =3D 0; print("n=3D%d\n%s\n",n,buf); close(fd); exits(nil); } I don't know whether m in readn(fd,buf,m) depends on something or not. If depends. then how to know getting OK value? Kenji Arisawa ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tf13f657beb7b12c0-M60ccb= c9ae01219d2e2f46c4f Delivery options: https://9fans.topicbox.com/groups/9fans/subscription --000000000000b4892405fb3a6aab Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello, 9fans

In writing a program I= met a problem on finding window size.
cat /dev/wctl
shows someth= ing like this:
hebe% cat /dev/wctl
        4= 56          91        1214 &nb= sp;       603     current     visible hebe%
Need DEL key to stop. I want to get this info without manua= l intervention.

I tried a experimental code:

#include= <u.h>
#include <libc.h>

void
main(void){ char buf[256];
int fd,n;
fd =3D open("/dev/wctl"= ;,OREAD);
print("%d\n",fd);
//n =3D readn(fd,buf,1);/= /NG. buffer too small
//n =3D readn(fd,buf,48);//NG. truncated
= //n =3D readn(fd,buf,56);//NG. truncated
//n =3D readn(fd,buf,70);//N= G. truncated
n =3D readn(fd,buf,71);//OK, n=3D71
//n =3D readn(= fd,buf,111);//OK.  n=3D71
//n =3D readn(fd,buf,117);//OK.  = n=3D71
//n =3D readn(fd,buf,128);//NG. hungup
/* I donn't k= now the reasnalbe value m for readn(fd,buf,m) */
if(n < 0){
= print("%r\n");
}
buf[n] =3D 0;
print("n= =3D%d\n%s\n",n,buf);
close(fd);
exits(nil);
}
I don't know whether m in readn(fd,buf,m) depends on something or n= ot.
If depends. then how to know getting OK value?

Kenji Ar= isawa

= --000000000000b4892405fb3a6aab--