9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Fresh (relatively speaking) Graphviz
Date: Thu,  6 Mar 2008 12:07:15 -0500	[thread overview]
Message-ID: <20080306170803.647D11E8C51@holo.morphisms.net> (raw)
In-Reply-To: <e1c788fb5b98614ad1a258c9293ff194@proxima.alt.za>

> I'm now getting to the 386 syscalls.  The following comment in the
> mkfile needs addressing.  Suggestions?

Change the loop to rename the generated assembly
stub __seek and treat it like any other system call
(no special code; just the name change).

Then add this C function:

	int _seek(vlong*, int, vlong, int);

	vlong
	seek(int fd, vlong off, int whence)
	{
		vlong ret;
		if(_seek(&ret, fd, off, whence) == -1)
			return -1;
		return ret;
	}

You should never ask "how do I write this in assembly?"
You should ask "how do I *not* write this in assembly?"

Russ

P. S.  You might also change gcc not to prefix all the
C functions with underscores.  (I'm sure there's an option.)
Real systems gave that up a long time ago.


      parent reply	other threads:[~2008-03-06 17:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 12:26 lucio
2008-03-05 18:00 ` Russ Cox
2008-03-05 18:51   ` P9GCC: APE library (Was: [9fans] Fresh (relatively speaking) Graphviz) lucio
2008-03-05 18:55   ` [9fans] Fresh (relatively speaking) Graphviz lucio
2008-03-05 20:58     ` Russ Cox
2008-03-05 21:07       ` lucio
2008-03-05 21:14       ` Charles Forsyth
2008-03-05 21:23         ` lucio
2008-03-06  4:47       ` lucio
2008-03-06  4:55         ` P9GCC progress (Was: [9fans] Fresh (relatively speaking) Graphviz) lucio
2008-03-06 17:07         ` Russ Cox [this message]

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=20080306170803.647D11E8C51@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    /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).