*BSD News Article 33769


Return to BSD News archive

Xref: sserve comp.windows.x.i386unix:10928 comp.os.386bsd.apps:1324 comp.os.386bsd.questions:12039
Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!scsing.switch.ch!news.dfn.de!urmel.informatik.rwth-aachen.de!news.rhrz.uni-bonn.de!saph2.physik.uni-bonn.de!juengst
From: juengst@saph1.physik.uni-bonn.de (Henry G. Juengst)
Newsgroups: comp.windows.x.i386unix,comp.os.386bsd.apps,comp.os.386bsd.questions
Subject: Re: __NetBSD__ X11R6 i386
Date: 3 Aug 1994 17:53:23 GMT
Organization: Physikalisches Institut der Universitaet Bonn
Lines: 90
Sender: juengst@saph2.physik.uni-bonn.de (Henry G. Juengst)
Distribution: world
Message-ID: <31olij$61a@news.rhrz.uni-bonn.de>
References: <30dr4j$phk@darum.uni-mannheim.de> <bakulCtsIBF.4BH@netcom.com> <31mgdu$s9d@news.rhrz.uni-bonn.de> <deeken.775902001@iti.informatik.th-darmstadt.de> <31nqad$mii@news.rhrz.uni-bonn.de>
Reply-To: juengst@saph2.physik.uni-bonn.de
NNTP-Posting-Host: saph1.physik.uni-bonn.de


In article <31nqad$mii@news.rhrz.uni-bonn.de>, juengst@saph2.physik.uni-bonn.de (Henry G. Juengst) writes:
>In article <deeken.775902001@iti.informatik.th-darmstadt.de>, deeken@iti.informatik.th-darmstadt.de (Hannes Deeken) writes:
>>juengst@saph2.physik.uni-bonn.de (Henry G. Juengst) writes:
>>
>>>>this you need to either have a proper lseek() declaration in
>>>>imake.c's scope, or a quick and dirty fix is to just  use a
>>
>>>"A proper lseek() declaration in imake.c's scope" ? What did you study ?
>>>Dentistry ?  :-)
>>
>>>Lseek is a function of your OS. So, please add the required #include
>>>statements, use what your OS declares and use a C compiler which handles
>>>prototypes. Do not use an old cc.
>>
>>HUH? That's exactly what he's saying!
>>The "proper lseek() declaration" is found in unistd.h, and it is brought
>>into imake.c's scope by adding an #include directive a la '#include <unistd.h>
>>to the source.
>
>To say 'bring it into imake's scope' and to say 'use the include file
>of the OS' is not the same. The first one could also mean, that one uses
>his/her/its private - proper - declaration. That's what happens in many
>applications. It is not ok to declare a foreign identifer in your own
>source file. The only compatible way is to include the required header
>files of the foreign software.
>
>Anyway, the imake specific problem is in the ftruncate function call,
>but the previous statement is also true for this one.
>
>>BTW: 386BSD, FreeBSD and NetBSD all use gcc, so there's no need to bitch
>>about compilers which don't grok prototypes.
>>
>>>Declarations of OS specific identifiers have nothing to do in applications.
>>
>>No? Applications don't use facilities provided by the OS? Interresting view...
>
>I didn't write "facilities", I wrote "declarations".
>
>I'm pissed off by all those sys_errlist, lseek etc. declarations in too
>many programs. I know that there are some poor systems without complete
>OS specific header files, but for those chests one could declare the
>missing identifiers between #ifdef osname ... #endif.
>
>>
>>
>>Hannes
>
>Henry
>
>>-- 
>>Hans-Christoph Deeken | hannes@flinx.{RoBIN.de,hotb.sub.org} (home)
>>Paul-Wagner-Str. 58   | deeken@iti.informatik.th-darmstadt.de (university)
>>64285 Darmstadt       | IRC: Glenlivet
>>

In addition to my previous statements about proper OS function
declarations in applications I would like to say, that I had a look
into the source file imake.c once again (it's some weeks ago I made X11R6
successfully) and I found the required #include <unistd.h>.

BUT, this header file will be only included on POSIX systems. If one
does _not_ define X_NOT_POSIX, then imake.c defines _POSIX_SOURCE
(forget WIN32 for a moment - or much longer... :-) Now, if imake.c
defines itself as POSIX source, then unistd.h, which I didn't found
in two ANSI C books as standard header file, will be included. In
unistd.h of NetBSD-current you can see that ftruncate will be NOT
declared if _POSIX_SOURCE was defined. And I think ftruncate is not
a posix function. I didn't find it in any book as posix compatible
function (I found other functions successfully), but I'm afraid I don't
have POSIX1003.1(?) here. If anybody has this "standard" it would be
funny to know if it is a posix function.

DG/UX declares ftruncate, if one uses DGUX compatible sources or SYSV
sources. In the history comment in the NetBSD manual pages one can read
that it is a BSD 4.2 function.

BTW, I found in a X/OPEN book, that one should use "long" for the
offset in lseek. ;-)

Keep smiling  ==:-)

Henry

--
juengst@saph2.physik.uni-bonn.de   [131.220.221.12]  (internet)
juengst@boss1.physik.uni-bonn.de   [131.220.221.30]
saph2::juengst                     [13.259]          (decnet)

Any opinions in this mail are my own.