Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ames!amdcad!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: comp.lang.c Subject: Re: pointer alignment when int != char * Message-ID: <27824@sun.uucp> Date: Sat, 12-Sep-87 21:06:24 EDT Article-I.D.: sun.27824 Posted: Sat Sep 12 21:06:24 1987 Date-Received: Sun, 13-Sep-87 10:47:38 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> <3812@spool.WISC.EDU> <688@sugar.UUCP> Organization: Sun Microsystems, Inc. - Mtn View, CA Lines: 43 > You implement a non-byte-oriented lseek. Lseek is permitted to use a > magic cookie. Oh, really? I quote from POSIX draft 11: 6.5.3 Reposition Read/Write File Pointer Function: lseek() ... 6.5.3.2 Description ...The "lseek()" function shall set the file pointer of "fildes" as follows: If "whence" is SEEK_SET, the pointer is set to "offset" bytes. If "whence" is SEEK_CUR, the pointer is set to its current value plus "offset" bytes. If "whence" is SEEK_END, the pointer is set to the size of the file plus "offset" bytes. ... 6.5.3.3 Returns Upon successful completion, the function shall return the resulting pointer location as measured in bytes from the beginning of the file. OK, who *does* permit "lseek" to use a magic cookie? Certainly not the ANSI C draft standard, as that doesn't contain any description of "lseek". > Or you implement a byte-oriented one and return an error > code when you use it incorrectly. Lseek is permitted to fail on non-seekable > files. Even UNIX has these (pipes, terminals...) What does "use it incorrectly" mean here? Use it on any text file? Use it on any file that doesn't support it? By the time you're done, it's not clear you'd have anything better than what you have now. -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)