Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!sri-unix!sri-spam!ames!aurora!labrea!decwrl!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.lang.c,comp.unix.wizards Subject: Re: pointer alignment when int != char * Message-ID: <27183@sun.uucp> Date: Thu, 3-Sep-87 14:25:00 EDT Article-I.D.: sun.27183 Posted: Thu Sep 3 14:25:00 1987 Date-Received: Sat, 5-Sep-87 12:14:32 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> <3812@spool.WISC.EDU> <625@sugar.UUCP> Sender: news@sun.uucp Lines: 25 Xref: mnetor comp.lang.c:4139 comp.unix.wizards:4063 > Are you saying that the ANSI 'C' library includes all the UNIX date/time > functions, but doesn't include lseek? That is precisely what I am saying, because it is true. I find the presence of the date/time functions in the C standard somewhat questionable, as that sort of date/time conversion is usually an OS function - both the internal format used to represent dates and/or times, and the printable format generally used, are OS-dependent. "lseek" isn't in the standard, but then neither are "open", "close", "read", nor "write". This is as it should be; a portable program can't expect any more from those routines than from their standard I/O equivalents. Consider a system that supports records in files that being with a byte count, and use FORTRAN carriage control at the beginning of the record in text files - in such a system, "read" and "write" would have to perform the same sort of translation on data in order to make UNIX programs work without change, "lseek" would have to work with cookies rather than byte offsets, and if you wanted to be able to use "read" or "write" to get at the "raw" binary data in the file, you'd have to have a text/binary flag on "open", or something such as that. If you want a standard that ensures UNIX-flavored behavior, use POSIX, not ANSI C. Both types of standard have their roles, but they are different roles. Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com