Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Oct 1995 16:33:51 -0400
From:      "Garrett A. Wollman" <wollman@lcs.mit.edu>
To:        Terry Lambert <terry@lambert.org>
Cc:        hackers@freebsd.org
Subject:   Re: SYSCALL IDEAS [Was: cvs commit: src/sys/kern sysv_msg.c sysv_sem.c sysv_shm.c]
Message-ID:  <9510272033.AA23654@halloran-eldar.lcs.mit.edu>
In-Reply-To: <199510272009.NAA23809@phaeton.artisoft.com>
References:  <199510271903.FAA24658@godzilla.zeta.org.au> <199510272009.NAA23809@phaeton.artisoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
[CC list trimmed.  I don't read -hackers.]

<<On Fri, 27 Oct 1995 13:09:46 -0700 (MST), Terry Lambert <terry@lambert.org> said:

> But this implies that if there is not a prototype in scope, a function
> that uses a type that is not correct without a prototype in scope should
> not generate a bogus call reference.

Not at all.  IT IS THE CALLER'S RESPONSIBILITY TO PASS THE CORRECT
TYPES AND ALWAYS HAS BEEN.

In particular, it is incorrect to call lseek() with a `where' argument
of any type other than `off_t', and if a prototype is not in scope,
the the programmer damn well better use a cast to ensure that the
correct type is being used.

>> [Bruce wrote:]
>> Consider a 68K compiler that passes the first 2 pointer args (if any)
>> in a0-a1 and the first 2 integer args (if any) in d0-d1 and the other
>> args on the stack.  How are you going to push the args in syscall()?
>> Hint: you'll need to know the arg types of all syscalls.

> That's an evil way to pass arguments, then.  8-(.

That's a fast way to pass arguments on a slow architecture.  If you
don't like it, tough, because I /know/ that there are compilers out
there that do this, or something nearly like it.  (And don't forget
the SPARC, where under Sun's compiler all aggregates are passed by
hidden reference.)

-GAWollman

--
Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
Opinions not those of| It is a bond more powerful than absence.  We like people
MIT, LCS, ANA, or NSA| who like Shashish.  - Claude McKenzie + Florent Vollant



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9510272033.AA23654>