Re: [PHP4BETA] PF_INET
| From: | Sascha Schumann | Date: | Mon, 22 Nov 1999 21:58:40 +0000 |
| Subject: | Re: [PHP4BETA] PF_INET | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-6705@lists.php.net to get a copy of this message | ||
On Mon, Nov 22, 1999 at 10:50:03PM +0100, Jonathan Perret wrote:
> >On Sat, Nov 20, 1999 at 02:49:24AM +0100, Jonathan Perret wrote:
> >>
> >> In Beta 3, ext/ftp/ftp.c has two occurrences of PF_INET (instead of
> >> AF_INET).
> >>
> >> Is this normal ?
> >
> > AF_* -- Address Format (used in sockaddr* structures)
> > PF_* -- Protocol Family (used in socket())
> >
> > AF_X and PF_X usually have the same value, but a
> > Berkeley-like socket implementation must define both.
>
>
> Yeah, sure, I agree, but see my previous message.
> PHP is using socket(PF_xxx) (in ftp) AND socket(AF_xxx)
> (in standard).
>
> You can't allow it to be half-correct... Either change
> the older code to use PF_xxx, or put the newest code in
> line with the rest by using AF_xxx.
>
> BeOS is not a reference here (its socket implementation is far from
> conformant anyway), but are you sure every system has the PF_xxx
> defines ? For example, the Linux socket(2) man page mentions only
> AF_xxx, not PF_xxx.
Often programmers misuse AF_INET/PF_INET, because their
applications work with either of them.
The Linux man pages are usually dated (the system has AF_*
and PF_*). For a more recent reference see
"Address Formats" --
http://www.gnu.org/manual/glibc-2.0.6/html_chapter/libc_11.html#SEC184
"The Internet Namespace" --
http://www.gnu.org/manual/glibc-2.0.6/html_chapter/libc_11.html#SEC191
--
Regards,
Sascha Schumann
Consultant