[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiling ircd2.10.3p1 with Cygwin
On Thu, May 31, 2001 at 04:19:04PM +0100, Dejan Lekic wrote:
>
> ./ircd/s_bsd.c: In function `init_sys':
> ./ircd/s_bsd.c:622: too many arguments to function `setpgrp'
It's the first time I see that error.
We do (void)setpgrp(0, (int)getpid()); in some cases.
SuSv2 defines it as:
int setpgrp(void);
Which is what Linux uses too.
Under BSD, it's:
int setpgrp(pid_t pid, pid_t pgrp);
We only use that in case this fails:
#if defined(HPUX) || defined(SVR4) || defined(DYNIXPTX) || \
defined(_POSIX_SOURCE) || defined(SGI)
>From the features.h file from glibc:
The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.
If none of these are defined, the default is to have _SVID_SOURCE,
_BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to
199506L.
Afaik, cygwin uses glibc too, so should do the same. This is
either a bug in glibc, or cygwin.
It *should* define _POSIX_SOURCE, and you wouldn't call that
function in that case.
I suggest you take this up with cygwin.
As work around, you can try to change common/os.h, and add
#define _POSIX_SOURCE 1
at the top. Doing a #define _GNU_SOURCE might also work for
cygwin.
It used to work perfectly on cygwin. I did try it myself with
some 1.1.
There is one other error you will get, for which I can send a patch.
The rest are just warnings. It shouldn't even generate
those warnings, there is nothing wrong with the code afaics. It
doesn't even generate those warnings if I use -Wall.
What version of gcc is that?
Kurt