Обсуждение: Re: [HACKERS] Bug in postgresql-6.3.2 (AIX specific)

Поиск
Список
Период
Сортировка

Re: [HACKERS] Bug in postgresql-6.3.2 (AIX specific)

От
Andreas Zeugswetter
Дата:
>     int accept(int s, struct sockaddr *addr, int *addrlen);
>
> So AIX has the last parameter defined as size_t, huh?

Yes, and this is consistently done with all size parameters. (therefore also with fread, fwrite ...)
But only if _NONSTD_TYPES is not defined. I don't know where that would come from.
(it's not in any /usr/include header)

typedef unsigned long   size_t;

#ifdef  _NONSTD_TYPES
extern int      fread();
#else
extern size_t   fread(void *, size_t, size_t, FILE *);
#endif

Andreas


Re: [HACKERS] Bug in postgresql-6.3.2 (AIX specific)

От
The Hermit Hacker
Дата:
On Fri, 22 May 1998, Andreas Zeugswetter wrote:

> >     int accept(int s, struct sockaddr *addr, int *addrlen);
> >
> > So AIX has the last parameter defined as size_t, huh?
>
> Yes, and this is consistently done with all size parameters. (therefore also with fread, fwrite ...)
> But only if _NONSTD_TYPES is not defined. I don't know where that would come from.
> (it's not in any /usr/include header)
>
> typedef unsigned long   size_t;
>
> #ifdef  _NONSTD_TYPES
> extern int      fread();
> #else
> extern size_t   fread(void *, size_t, size_t, FILE *);
> #endif

Hrmmm...just checked, and, under FreeBSD:

> grep fread *.h
stdio.h:size_t   fread __P((void *, size_t, size_t, FILE *));

where size_t is defined to be an unsigned int, vs long on AIX...

i sort of suspect that the use of size_t is more the norm then the
exception, if you all check your fread defines...?

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org