Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!mcnc!decvax!ucbvax!ucbcad!tektronix!hplabs!sri-unix!gds@Mit-Csr.ARPA From: gds@Mit-Csr.ARPA Newsgroups: net.unix-wizards Subject: question about ctime(3) and time(2) in unix v6 Message-ID: <442@sri-arpa.UUCP> Date: Thu, 29-Mar-84 18:34:00 EST Article-I.D.: sri-arpa.442 Posted: Thu Mar 29 18:34:00 1984 Date-Received: Tue, 3-Apr-84 20:11:50 EST Lines: 32 time(2) in unix v6 says it takes as argument a long, and returns suitable information for ctime(3) to return a character pointer. However, I'm getting strange results when I try to do a couple of things. executing main() { long i; char *t; t = ctime(time(&i)); } results in a core dump. The sources to date(1) show time(2) as taking int [2] rather than long. So when I tried the following, I got a bus error core dump. main() { int i[2]; char *t; t = ctime(time(i)); puts(t); } when substituting t[80] for *t, it did not compile, claiming that the line which the assignment to t is on needed an lvalue (i presume it is the "t" that doesn't have one). Am I doing something wrong, or is unix? Should I be loading some special library? -------