Subject: lseek declaration is POSIX?
To: None <netbsd-users@NetBSD.ORG>
From: Jesus M. Gonzalez <jgb@ordago.uc3m.es>
List: netbsd-users
Date: 11/21/1994 10:00:42
	Hi again!

	Porting another tcl/tk tool to NetBSD 1.0/i386, I found what seems
to be problem with PSIX compilance. Could somebody tell me where
exactly is the problem?

cc -c tkcanvas/tkCanvArc.c -o tkcanvas/tkCanvArc.o -O3 -I/usr/local/test/tcl-tk/tk3.6 -I/usr/local/test/tcl-tk/tcl7.3 -I/usr/local/install/tcl-tk/include -I/usr/X11R6/include -I/usr/local/install/pbmplus/include -I. -DPicassoLib=\"/usr/local/install/tcl-tk/picasso3.8/lib/tcl\" -DHAS_INRIM=0 
In file included from /usr/local/test/tcl-tk/tk3.6/tkConfig.h:73, from tkcanvas/tkCanvArc.c:29:
/usr/local/test/tcl-tk/tcl7.3/compat/unistd.h:57: conflicting types for `lseek'
/usr/include/sys/types.h:84: previous declaration of `lseek

	So, I looked tcl7.3/compat/unistd.h, and it says:

/*
 * Strict POSIX stuff goes here.  Extensions go down below, in the
 * ifndef _POSIX_SOURCE section.
 */
 ...
extern long lseek _ANSI_ARGS_((int fd, long offset, int whence));

	And /usr/include/sys/types.h:

typedef quad_t          off_t;          /* file offset */
  ... 
/* 
 * This belongs in unistd.h, but is placed here to ensure that programs
 * casting the second parameter of lseek to off_t will get the correct
 * version of lseek.
 */
#ifndef KERNEL 
#include <sys/cdefs.h>
__BEGIN_DECLS
off_t    lseek __P((int, off_t, int));
__END_DECLS
#endif

	So, what is wrong? Has this something to do with ``our'' bigger
off_t. Isn't this defined by POSIX? (I saw some days ago a discossion about
the type for off_t, but since I'm not a POSIX nor ANSI C guru, I didn't paid
a lot of attention... Sorry.

		Jesus.

-- 
Jesus M. Gonzalez Barahona    | Universidad Carlos III (Madrid, Spain)
tel: +34 1 624 94 58          | e-mail: jgb@inf.uc3m.es
fax: +34 1 624 94 30          |         jgb@ordago.uc3m.es
(Sometimes our headers are not o.k., please reply to any of this addresses)
.From within Universidad Carlos III, you can better use jgb@ordago.uc3m.es