Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: off_t (was unix question: files per directory) Message-ID: <16901@mimsy.UUCP> Date: 13 Apr 89 12:48:01 GMT References: <24110@beta.lanl.gov> <8420@xanth.cs.odu.edu> <1430@auspex.auspex.com> Distribution: na Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 12 In article <1430@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >since [lseek] can use [its off_t] argument ... as a >possibly-negative offset relative to the current position in the file or >to the end of the file, it has to be signed. Well, no, not really. Unsigned arithmetic is modular arithmetic; this produces the same result, although not in as intuitive a manner. If (off_t) is (unsigned long) and if that is 32 bits, -(off_t)100 is 4294967196, and (off_t)150 + -(off_t)100 is 50. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris