return values of socket_recvmsg

  101680
January 25, 2018 22:11 samding@ca.ibm.com ("Sam Ding")
The test case  ext/sockets/tests/socket_recvmsg.php  has following output
on x86_64:

=======
....
1 Array
2 (
3    [name] => Array
4        (
5            [family] => 10
6            [addr] => ::1
7            [port] => 7001
8            [flowinfo] => 0
9            [scope_id] => 0
10        )
11
12    [control] => Array
13       (
14            [0] => Array
15               (
16                    [level] => 41
17                    [type] => 50
18                    [data] => Array
19                       (
20                            [addr] => ::1
21                            [ifindex] => 1
22                        )
23                )
24        )
....
=======
This is output  by c
function:"socket_recvmsg"(/home/work/php/php/ext/sockets/sendrecvmsg.c:214),
 which returns a struct "executor_globals.current_execute_data".

The struct  is defined as :

(gdb)  ptype executor_globals.current_execute_data
type = struct _zend_execute_data {
    const zend_op *opline;
    zend_execute_data *call;
    zval *return_value;
    zend_function *func;
    zval This;
    zend_execute_data *prev_execute_data;
    zend_array *symbol_table;
    void **run_time_cache;
    zval *literals;
} *

Where do  the above output values  (line 18-21) store in the struct
_zend_execute_data ?


Thanks,

Sam
  101687
January 26, 2018 06:58 kalle@php.net (Kalle Sommer Nielsen)
Hi Sam

2018-01-25 23:11 GMT+01:00 Sam Ding <samding@ca.ibm.com>:
> > The test case ext/sockets/tests/socket_recvmsg.php has following output > on x86_64: > > ======= > ... > 1 Array > 2 ( > 3 [name] => Array > 4 ( > 5 [family] => 10 > 6 [addr] => ::1 > 7 [port] => 7001 > 8 [flowinfo] => 0 > 9 [scope_id] => 0 > 10 ) > 11 > 12 [control] => Array > 13 ( > 14 [0] => Array > 15 ( > 16 [level] => 41 > 17 [type] => 50 > 18 [data] => Array > 19 ( > 20 [addr] => ::1 > 21 [ifindex] => 1 > 22 ) > 23 ) > 24 ) > ... > ======= > This is output by c > function:"socket_recvmsg"(/home/work/php/php/ext/sockets/sendrecvmsg.c:214),
You can find the implementation of socket_recvmsg() in the ext/sockets directory here: http://git.php.net/?p=php-src.git;a=blob;f=ext/sockets/sendrecvmsg.c;h=7b9c4e8ad357b73b514dc5feb8dc8d9ca215126b;hb=HEAD#l210 -- regards, Kalle Sommer Nielsen kalle@php.net
  101695
January 26, 2018 14:36 samding@ca.ibm.com ("Sam Ding")
Thank Kalle,

I knew the implementaion of socket_recvmsg(), but want to know the return
data structure.
The test on Big_endian (s390x) got a little different return result than on
x86_64, try to dig out
where the problem is.

Thanks,

Sam


kalle.php@gmail.com wrote on 01/26/2018 01:58:23 AM:

> From: Kalle Sommer Nielsen <kalle@php.net> > To: Sam Ding <samding@ca.ibm.com> > Cc: PHP internals <internals@lists.php.net> > Date: 01/26/2018 01:58 AM > Subject: Re: [PHP-DEV] return values of socket_recvmsg > Sent by: kalle.php@gmail.com > > Hi Sam > > 2018-01-25 23:11 GMT+01:00 Sam Ding <samding@ca.ibm.com>: > > > > The test case ext/sockets/tests/socket_recvmsg.php has following output
> > on x86_64: > > > > ======= > > ... > > 1 Array > > 2 ( > > 3 [name] => Array > > 4 ( > > 5 [family] => 10 > > 6 [addr] => ::1 > > 7 [port] => 7001 > > 8 [flowinfo] => 0 > > 9 [scope_id] => 0 > > 10 ) > > 11 > > 12 [control] => Array > > 13 ( > > 14 [0] => Array > > 15 ( > > 16 [level] => 41 > > 17 [type] => 50 > > 18 [data] => Array > > 19 ( > > 20 [addr] => ::1 > > 21 [ifindex] => 1 > > 22 ) > > 23 ) > > 24 ) > > ... > > ======= > > This is output by c > > function:"socket_recvmsg"(/home/work/php/php/ext/sockets/sendrecvmsg.c:214),
> > You can find the implementation of socket_recvmsg() in the ext/sockets > directory here: > https://urldefense.proofpoint.com/v2/url? > u=http-3A__git.php.net_-3Fp-3Dphp-2Dsrc.git-3Ba-3Dblob-3Bf-3Dext_sockets_sendrecvmsg.c-3Bh-3D7b9c4e8ad357b73b514dc5feb8dc8d9ca215126b-3Bhb-3DHEAD-23l210&d=DwIBaQ&c=jf_iaSHvJObTbx-
> siA1ZOg&r=CBZ1IFMUPf-s4Wt- > elABGKFWisr3DNfFfWYNaKkXXUE&m=f8KTE9WyceLmQxKXG77FBkDIVqCnJ54BBnXEQuSQCo4&s=GOFChuk86IBBBORDL3I50gHrzmF4kTmYkq1qCeMufBQ&e=
> > > > -- > regards, > > Kalle Sommer Nielsen > kalle@php.net >