The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Warner Losh <imp@bsdimp.com>
To: Angelo Papenhoff <aap@papnet.eu>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] C entry keyword
Date: Tue, 30 Oct 2018 07:56:54 -0600	[thread overview]
Message-ID: <CANCZdfo+hXvkoGw1GnYoRAeBPHp-Ex6=PGhHLaDKu7AoKj3oew@mail.gmail.com> (raw)
In-Reply-To: <20181030091259.GA44474@indra.papnet.eu>

[-- Attachment #1: Type: text/plain, Size: 938 bytes --]

I'd imagine you'd use it like so (in more modern C):

void *memcpy(void *src, void *dst, size_t len)
{
char *rv = dst;
top:
while (len--) *dst++ =*src; /* not always a trivial body */
return(rv);
entry bcopy:
rv = dst; /* Swap args and jump to memcpy */
dst = src;
src = 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 <aap@papnet.eu> wrote:

> On 30/10/18, Steve Simon wrote:
> >
> > “entry” 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
>

[-- Attachment #2: Type: text/html, Size: 1379 bytes --]

  parent reply	other threads:[~2018-10-30 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30  8:02 Steve Simon
2018-10-30  8:51 ` Lars Brinkhoff
2018-10-30  9:12 ` Angelo Papenhoff
2018-10-30 13:32   ` Paul Winalski
2018-10-30 13:56   ` Warner Losh [this message]
2018-10-30 17:53     ` Paul Winalski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANCZdfo+hXvkoGw1GnYoRAeBPHp-Ex6=PGhHLaDKu7AoKj3oew@mail.gmail.com' \
    --to=imp@bsdimp.com \
    --cc=aap@papnet.eu \
    --cc=tuhs@minnie.tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).