From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: tuhs-bounces@minnie.tuhs.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 6743fe69 for ; Tue, 30 Oct 2018 15:16:37 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id ED031A2230; Wed, 31 Oct 2018 01:16:35 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 382AEA1F9E; Wed, 31 Oct 2018 01:16:05 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 6C552A1FAF; Tue, 30 Oct 2018 23:57:12 +1000 (AEST) Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) by minnie.tuhs.org (Postfix) with ESMTPS id 860F0A1F9E for ; Tue, 30 Oct 2018 23:57:06 +1000 (AEST) Received: by mail-vk1-f177.google.com with SMTP id t127so2261570vke.8 for ; Tue, 30 Oct 2018 06:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1WimIhzs0mvBXIGBEU3G2UTrQK8CvvR85L6P34pR29M=; b=hOq7F401SdBeqDCTrStGjb2de8Z14224cK9OXV/4/LFOf+w08LRxqjuB1tJ5S4PqHu Pogu5fAOd8C+bfqV3umbOydj7puCGhkKAMx03zTZpxFhyeB0F9p+XcOCRyJIB2FdmMc+ gcIqIELw7XekioaelmSy0zrgWsUsiB8y1Fq31HZWWlN4CgZFVTMZXCLYg8FHT+JeDay9 BiOH0tmOsFLk+EfIqtgkrQiC5/qYlxq830zP1uSjOt5PCNj3at0o6BdsZdCHYH/ddrZt 8dgfX86rBR7p4yPSif0LYOemQ9lHUus7sGqMRXIFi8Yd5s7jp6isCsoi4w6NcBGibJ6V j6EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1WimIhzs0mvBXIGBEU3G2UTrQK8CvvR85L6P34pR29M=; b=lXxl59THBddEKymzgjUFimXJhnHWZb6JfXvax4ZQHPiEsYs/WTq9UkYRjx+wJd5IzB bQJrDf35pqR1rQClF3XsGB/GOkMAuudBSd3DD6wRZVvtQyns/Tjl8wL0sGubBsRjYybz 9iTM8IRABCm6z/8gbqbU8M2OatTjE8HorV9NoucxKQ1tk95NhtCKzu3xGBIuZyKmiW0J 5rlVKDMdPwdN2ZzQsSxOuS0cGPB3vAK4bsNyFXnomHwM5XrLypQHm6s0Dnc8GJXzAY+d bjBzq6hhiyLyQhbWTPkNE3b8FHAtCA1EEYAKquI+gziBSSj/d0ekYgFiDGhnixnTvLho Exrw== X-Gm-Message-State: AGRZ1gJZSZXdjMyDetsImsRsUCm+3g9HmUilML+Bc/fL6Qos+BeH+Em8 boX0Oa7nI096xEfVVlLX+5TmjkmPwIXymVRDwjubBc5s X-Google-Smtp-Source: AJdET5f1EqdoKamtthcYC5QYe6+JoCqx7UZNTqCe/0e4RPcpQQmzIhNcqWvljIIRERcPxNAfDTKbY2YafTvNlUq2gnA= X-Received: by 2002:a1f:9255:: with SMTP id u82mr7813087vkd.85.1540907825307; Tue, 30 Oct 2018 06:57:05 -0700 (PDT) MIME-Version: 1.0 References: <47BC5434-D668-48D1-AA45-361B6D1E2E3A@quintile.net> <20181030091259.GA44474@indra.papnet.eu> In-Reply-To: <20181030091259.GA44474@indra.papnet.eu> From: Warner Losh Date: Tue, 30 Oct 2018 07:56:54 -0600 Message-ID: To: Angelo Papenhoff Content-Type: multipart/alternative; boundary="0000000000008f3aeb0579728fef" Subject: Re: [TUHS] C entry keyword X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000008f3aeb0579728fef Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'd imagine you'd use it like so (in more modern C): void *memcpy(void *src, void *dst, size_t len) { char *rv =3D dst; top: while (len--) *dst++ =3D*src; /* not always a trivial body */ return(rv); entry bcopy: rv =3D dst; /* Swap args and jump to memcpy */ dst =3D src; src =3D rv; goto top: } Variations on this theme are often done in assembler for these routines, though the example is an attempt to cope with the diversity of interfaces that grew up after v6 unix was released in the world, so it's not likely this particular example inspired it... Warner On Tue, Oct 30, 2018 at 4:00 AM Angelo Papenhoff wrote: > On 30/10/18, Steve Simon wrote: > > > > =E2=80=9Centry=E2=80=9D was a reserved word in K&R Ed.1, > > my personal favourite C trivia. I have never seen it used outside > fortran on mainframes though. > > I think PL/1 on Multics uses it, which is probably how it "got into" C. > > aap > --0000000000008f3aeb0579728fef Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'd imagine you'd use it like so (in more modern C= ):

void *memcpy(void *src, void *dst, size_t len)
<= div>{
char *rv =3D dst;
top:
while (len--) *d= st++ =3D*src; /* not always a trivial body */
return(rv);
entry bcopy:
rv =3D dst; /* Swap args and jump to memcpy */
dst =3D src;
src =3D rv;
goto top:
}<= /div>

Variations on this theme are often done in assembl= er for these routines, though the example is an attempt to cope with the di= versity of interfaces that grew up after v6 unix was released in the world,= so it's not likely this particular example inspired it...
Warner

On Tue, Oct 30, 2018 at 4:00 AM Angelo Papenhoff <aap@papnet.eu> wrote:
On 30/10/18, Steve Simon wrote:
>
> =E2=80=9Centry=E2=80=9D was a reserved word in K&R Ed.1,
> my personal favourite C trivia. I have never seen it used outside fort= ran on mainframes though.

I think PL/1 on Multics uses it, which is probably how it "got into&qu= ot; C.

aap
--0000000000008f3aeb0579728fef--