home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!ira.uka.de!smurf.sub.org!news
- From: urlichs@smurf.sub.org (Matthias Urlichs)
- Newsgroups: comp.unix.wizards
- Subject: Re: A few UNIX questions
- Date: 8 Sep 1992 12:06:24 +0200
- Organization: University of Karlsruhe, FRG
- Lines: 32
- Message-ID: <18htv0INNj8u@smurf.smurf.sub.org>
- References: <32176@adm.brl.mil>
- NNTP-Posting-Host: 127.0.0.1
-
- In comp.unix.wizards, article <32176@adm.brl.mil>,
- mike@BRL.MIL ( Mike Muuss) writes:
- >
- > From: Michael Panosh <mwp.michael@melpn1.prime.com> PrimeService, Australia
- >
- > > Can *anyone* tell me why the file size is a signed integer. Surely there
- > > is no need for negative sized files!!
- >
- > Because lseek() needs to be able to return -1 on error, and not have it
- > look like a valid file offset.
-
- Strictly speaking, that's an artifact of the way lseek() is implemented.
-
- On many if not all UNIXes, system calls are executed somewhat along these
- lines:
- - Get arguments from stack and put them into registers, if necessary
- - put the system call number in another register
- - _Trap
- - If a certain CPU condition code bit is [set/clear], then (Error)
- - Move the return value (in a register) to errno
- - set that register to -1
- - return
-
- I don't really like that way of using system calls, but it's kind of too
- late to change it at this time. :-/
-
- --
- Wherever you go...There you are.
- - Buckaroo Banzai
- --
- Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de /(o\
- Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany -- +49-721-9612521 \o)/
-