Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Brian A. Seklecki
On Mon, 29 Dec 2008, Ilia Alshanetsky wrote: Here is a pretty simple patch that will provide the indicated function. If no one objects I'll commit it to 5.3/6 branches in the next day or two. This patch builds cleanly against 5.2.8 in FreeBSD ports! I'll shoot you an e-mail from my work acco

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Ilia Alshanetsky
On 30-Dec-08, at 10:21 AM, Antony Dovgal wrote: On 30.12.2008 18:15, Ilia Alshanetsky wrote: What is the benefit of the new API, documents better, has a longer name, helps some fuzzing suit to determine if functions take args or not? It produces much better & verbose error messages error mes

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Antony Dovgal
On 30.12.2008 18:15, Ilia Alshanetsky wrote: > What is the benefit of the new API, documents better, has a longer > name, helps some fuzzing suit to determine if functions take args or > not? It produces much better & verbose error messages error messages. Take a look at these for example: 5_3

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Ilia Alshanetsky
What is the benefit of the new API, documents better, has a longer name, helps some fuzzing suit to determine if functions take args or not? Also, is this documented anywhere? On 30-Dec-08, at 4:31 AM, Antony Dovgal wrote: On 30.12.2008 03:24, Ilia Alshanetsky wrote: There is nothing wro

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Ilia Alshanetsky
The gethostname() is a POSIX function and therefor should be available on windows as well as any other posix complaint system. The php_uname() function uses a radically different code between Win32 and Linux and therefor is not guaranteed to return the same equivalents, if win32 supports (w

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Antony Dovgal
On 30.12.2008 03:24, Ilia Alshanetsky wrote: > There is nothing wrong with using WRONG_PARAM_COUNT, it worked in the > past and still works fine and quite a bit of code still uses it. True, but we're trying to get rid of it, so please use new parameter parsing API when adding new functions. Tha

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-30 Thread Pierre Joye
hi, On Tue, Dec 30, 2008 at 1:00 AM, Kalle wrote: > Hi Ilia > > Den 30/12/2008 kl. 00.30 skrev Ilia Alshanetsky : > >> Here is a pretty simple patch that will provide the indicated function. If >> no one objects I'll commit it to 5.3/6 branches in the next day or two. >> >> > > You should use ze

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread M.
Isn't this whole function the same as calling php_uname('n') ? According to gethostname()'s manpage on Linux: The GNU C library implements gethostname() as a library function that calls uname(2) and copies up to len bytes from the returned nodename field into name. php_uname('n') is already imp

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread Cristian Rodríguez
Ilia Alshanetsky escribió: > + char buf[4096]; Shouldnt that be char buf[HOST_NAME_MAX + 1] ? -- "We have art in order not to die of the truth" - Friedrich Nietzsche Cristian Rodríguez R. Platform/OpenSUSE - Core Services SUSE LINUX Products GmbH Research & Development http://www.opens

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread Ilia Alshanetsky
There is nothing wrong with using WRONG_PARAM_COUNT, it worked in the past and still works fine and quite a bit of code still uses it. The code itself should work on windows, if the define for the function is specified. On 29-Dec-08, at 7:00 PM, Kalle wrote: Hi Ilia Den 30/12/2008 kl. 0

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread Kalle
Hi Ilia Den 30/12/2008 kl. 00.30 skrev Ilia Alshanetsky : Here is a pretty simple patch that will provide the indicated function. If no one objects I'll commit it to 5.3/6 branches in the next day or two. You should use zend_parse_parameters_none() here. I have no test env here, but do

Re: [PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread Ilia Alshanetsky
Here is a pretty simple patch that will provide the indicated function. If no one objects I'll commit it to 5.3/6 branches in the next day or two. Index: ext/standard/dns.c === RCS file: /repository/php-src/ext/standard/dns.c,v r

[PHP-DEV] Re: [PHP] POSIX 1003.1-2001 gethostname(2)

2008-12-29 Thread Daniel Brown
On Mon, Dec 29, 2008 at 16:26, Brian A. Seklecki wrote: > > All: > > Is anyone interested in adding POSIX 1003.1-2001 gethostname(2) support? I'm > interested in sponsoring a small contract development initiative. > > I need something more reliable than $_ENV[]. Not all shells export > $HOSTNAME