PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/sysvmsg - sysvmsg.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 164 175 93.7 %
Date: 2014-11-22 Functions: 10 10 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :   +----------------------------------------------------------------------+
       3             :   | PHP Version 7                                                        |
       4             :   +----------------------------------------------------------------------+
       5             :   | Copyright (c) 1997-2014 The PHP Group                                |
       6             :   +----------------------------------------------------------------------+
       7             :   | This source file is subject to version 3.01 of the PHP license,      |
       8             :   | that is bundled with this package in the file LICENSE, and is        |
       9             :   | available through the world-wide-web at the following url:           |
      10             :   | http://www.php.net/license/3_01.txt                                  |
      11             :   | If you did not receive a copy of the PHP license and are unable to   |
      12             :   | obtain it through the world-wide-web, please send a note to          |
      13             :   | license@php.net so we can mail you a copy immediately.               |
      14             :   +----------------------------------------------------------------------+
      15             :   | Author: Wez Furlong <wez@thebrainroom.com>                           |
      16             :   +----------------------------------------------------------------------+
      17             : */
      18             : 
      19             : /* $Id: d158366ea59ee20451796efeb236c99ad5f40696 $ */
      20             : 
      21             : #ifdef HAVE_CONFIG_H
      22             : #include "config.h"
      23             : #endif
      24             : 
      25             : #include "php.h"
      26             : #include "php_globals.h"
      27             : #include "ext/standard/info.h"
      28             : #include "php_sysvmsg.h"
      29             : #include "ext/standard/php_var.h"
      30             : #include "zend_smart_str.h"
      31             : 
      32             : /* In order to detect MSG_EXCEPT use at run time; we have no way
      33             :  * of knowing what the bit definitions are, so we can't just define
      34             :  * out own MSG_EXCEPT value. */
      35             : #define PHP_MSG_IPC_NOWAIT      1
      36             : #define PHP_MSG_NOERROR         2
      37             : #define PHP_MSG_EXCEPT          4
      38             : 
      39             : /* True global resources - no need for thread safety here */
      40             : static int le_sysvmsg;
      41             : 
      42             : /* {{{ arginfo */
      43             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_get_queue, 0, 0, 1)
      44             :         ZEND_ARG_INFO(0, key)
      45             :         ZEND_ARG_INFO(0, perms)
      46             : ZEND_END_ARG_INFO()
      47             : 
      48             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_send, 0, 0, 3)
      49             :         ZEND_ARG_INFO(0, queue)
      50             :         ZEND_ARG_INFO(0, msgtype)
      51             :         ZEND_ARG_INFO(0, message)
      52             :         ZEND_ARG_INFO(0, serialize)
      53             :         ZEND_ARG_INFO(0, blocking)
      54             :         ZEND_ARG_INFO(1, errorcode)
      55             : ZEND_END_ARG_INFO()
      56             : 
      57             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_receive, 0, 0, 5)
      58             :         ZEND_ARG_INFO(0, queue)
      59             :         ZEND_ARG_INFO(0, desiredmsgtype)
      60             :         ZEND_ARG_INFO(1, msgtype)
      61             :         ZEND_ARG_INFO(0, maxsize)
      62             :         ZEND_ARG_INFO(1, message)
      63             :         ZEND_ARG_INFO(0, unserialize)
      64             :         ZEND_ARG_INFO(0, flags)
      65             :         ZEND_ARG_INFO(1, errorcode)
      66             : ZEND_END_ARG_INFO()
      67             : 
      68             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_remove_queue, 0, 0, 1)
      69             :         ZEND_ARG_INFO(0, queue)
      70             : ZEND_END_ARG_INFO()
      71             : 
      72             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_stat_queue, 0, 0, 1)
      73             :         ZEND_ARG_INFO(0, queue)
      74             : ZEND_END_ARG_INFO()
      75             : 
      76             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_set_queue, 0, 0, 2)
      77             :         ZEND_ARG_INFO(0, queue)
      78             :         ZEND_ARG_INFO(0, data)
      79             : ZEND_END_ARG_INFO()
      80             : 
      81             : ZEND_BEGIN_ARG_INFO_EX(arginfo_msg_queue_exists, 0, 0, 1)
      82             :         ZEND_ARG_INFO(0, key)
      83             : ZEND_END_ARG_INFO()
      84             : /* }}} */
      85             : 
      86             : /* {{{ sysvmsg_functions[]
      87             :  *
      88             :  * Every user visible function must have an entry in sysvmsg_functions[].
      89             :  */
      90             : const zend_function_entry sysvmsg_functions[] = {
      91             :         PHP_FE(msg_get_queue,                           arginfo_msg_get_queue)
      92             :         PHP_FE(msg_send,                                        arginfo_msg_send)
      93             :         PHP_FE(msg_receive,                                     arginfo_msg_receive)
      94             :         PHP_FE(msg_remove_queue,                        arginfo_msg_remove_queue)
      95             :         PHP_FE(msg_stat_queue,                          arginfo_msg_stat_queue)
      96             :         PHP_FE(msg_set_queue,                           arginfo_msg_set_queue)
      97             :         PHP_FE(msg_queue_exists,                        arginfo_msg_queue_exists)
      98             :         PHP_FE_END
      99             : };
     100             : /* }}} */
     101             : 
     102             : /* {{{ sysvmsg_module_entry
     103             :  */
     104             : zend_module_entry sysvmsg_module_entry = {
     105             :         STANDARD_MODULE_HEADER,
     106             :         "sysvmsg",
     107             :         sysvmsg_functions,
     108             :         PHP_MINIT(sysvmsg),
     109             :         NULL,
     110             :         NULL,
     111             :         NULL,
     112             :         PHP_MINFO(sysvmsg),
     113             :         NO_VERSION_YET,
     114             :         STANDARD_MODULE_PROPERTIES
     115             : };
     116             : /* }}} */
     117             : 
     118             : #ifdef COMPILE_DL_SYSVMSG
     119             : ZEND_GET_MODULE(sysvmsg)
     120             : #endif
     121             : 
     122           7 : static void sysvmsg_release(zend_resource *rsrc TSRMLS_DC)
     123             : {
     124           7 :         sysvmsg_queue_t *mq = (sysvmsg_queue_t *) rsrc->ptr;
     125           7 :         efree(mq);
     126           7 : }
     127             : 
     128             : /* {{{ PHP_MINIT_FUNCTION
     129             :  */
     130       20507 : PHP_MINIT_FUNCTION(sysvmsg)
     131             : {
     132       20507 :         le_sysvmsg = zend_register_list_destructors_ex(sysvmsg_release, NULL, "sysvmsg queue", module_number);
     133       20507 :         REGISTER_LONG_CONSTANT("MSG_IPC_NOWAIT", PHP_MSG_IPC_NOWAIT, CONST_PERSISTENT|CONST_CS);
     134       20507 :         REGISTER_LONG_CONSTANT("MSG_EAGAIN",   EAGAIN,             CONST_PERSISTENT|CONST_CS);
     135       20507 :         REGISTER_LONG_CONSTANT("MSG_ENOMSG",   ENOMSG,             CONST_PERSISTENT|CONST_CS);
     136       20507 :         REGISTER_LONG_CONSTANT("MSG_NOERROR",    PHP_MSG_NOERROR,    CONST_PERSISTENT|CONST_CS);
     137       20507 :         REGISTER_LONG_CONSTANT("MSG_EXCEPT",     PHP_MSG_EXCEPT,     CONST_PERSISTENT|CONST_CS);
     138       20507 :         return SUCCESS;
     139             : }
     140             : /* }}} */
     141             : 
     142             : /* {{{ PHP_MINFO_FUNCTION
     143             :  */
     144         143 : PHP_MINFO_FUNCTION(sysvmsg)
     145             : {
     146         143 :         php_info_print_table_start();
     147         143 :         php_info_print_table_row(2, "sysvmsg support", "enabled");
     148         143 :         php_info_print_table_row(2, "Revision", "$Id: d158366ea59ee20451796efeb236c99ad5f40696 $");
     149         143 :         php_info_print_table_end();
     150         143 : }
     151             : /* }}} */
     152             : 
     153             : /* {{{ proto bool msg_set_queue(resource queue, array data)
     154             :    Set information for a message queue */
     155           6 : PHP_FUNCTION(msg_set_queue)
     156             : {
     157             :         zval *queue, *data;
     158           6 :         sysvmsg_queue_t *mq = NULL;
     159             :         struct msqid_ds stat;
     160             : 
     161           6 :         RETVAL_FALSE;
     162             : 
     163           6 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &queue, &data) == FAILURE) {
     164           1 :                 return;
     165             :         }
     166             : 
     167           5 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, queue, -1, "sysvmsg queue", le_sysvmsg);
     168             : 
     169           5 :         if (msgctl(mq->id, IPC_STAT, &stat) == 0) {
     170             :                 zval *item;
     171             : 
     172             :                 /* now pull out members of data and set them in the stat buffer */
     173           4 :                 if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_perm.uid", sizeof("msg_perm.uid") - 1)) != NULL) {
     174           1 :                         convert_to_long_ex(item);
     175           1 :                         stat.msg_perm.uid = Z_LVAL_P(item);
     176             :                 }
     177           4 :                 if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_perm.gid", sizeof("msg_perm.gid") - 1)) != NULL) {
     178           1 :                         convert_to_long_ex(item);
     179           1 :                         stat.msg_perm.gid = Z_LVAL_P(item);
     180             :                 }
     181           4 :                 if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_perm.mode", sizeof("msg_perm.mode") - 1)) != NULL) {
     182           1 :                         convert_to_long_ex(item);
     183           1 :                         stat.msg_perm.mode = Z_LVAL_P(item);
     184             :                 }
     185           4 :                 if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_qbytes", sizeof("msg_qbytes") - 1)) != NULL) {
     186           1 :                         convert_to_long_ex(item);
     187           1 :                         stat.msg_qbytes = Z_LVAL_P(item);
     188             :                 }
     189           4 :                 if (msgctl(mq->id, IPC_SET, &stat) == 0) {
     190           4 :                         RETVAL_TRUE;
     191             :                 }
     192             :         }
     193             : }
     194             : /* }}} */
     195             : 
     196             : /* {{{ proto array msg_stat_queue(resource queue)
     197             :    Returns information about a message queue */
     198           7 : PHP_FUNCTION(msg_stat_queue)
     199             : {
     200             :         zval *queue;
     201           7 :         sysvmsg_queue_t *mq = NULL;
     202             :         struct msqid_ds stat;
     203             : 
     204           7 :         RETVAL_FALSE;
     205             : 
     206           7 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
     207           1 :                 return;
     208             :         }
     209             : 
     210           6 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, queue, -1, "sysvmsg queue", le_sysvmsg);
     211             : 
     212           6 :         if (msgctl(mq->id, IPC_STAT, &stat) == 0) {
     213           5 :                 array_init(return_value);
     214             : 
     215           5 :                 add_assoc_long(return_value, "msg_perm.uid", stat.msg_perm.uid);
     216           5 :                 add_assoc_long(return_value, "msg_perm.gid", stat.msg_perm.gid);
     217           5 :                 add_assoc_long(return_value, "msg_perm.mode", stat.msg_perm.mode);
     218           5 :                 add_assoc_long(return_value, "msg_stime",  stat.msg_stime);
     219           5 :                 add_assoc_long(return_value, "msg_rtime",  stat.msg_rtime);
     220           5 :                 add_assoc_long(return_value, "msg_ctime",  stat.msg_ctime);
     221           5 :                 add_assoc_long(return_value, "msg_qnum",   stat.msg_qnum);
     222           5 :                 add_assoc_long(return_value, "msg_qbytes", stat.msg_qbytes);
     223           5 :                 add_assoc_long(return_value, "msg_lspid",  stat.msg_lspid);
     224           5 :                 add_assoc_long(return_value, "msg_lrpid",  stat.msg_lrpid);
     225             :         }
     226             : }
     227             : /* }}} */
     228             : 
     229             : /* {{{ proto bool msg_queue_exists(int key)
     230             :    Check whether a message queue exists */
     231           4 : PHP_FUNCTION(msg_queue_exists)
     232             : {
     233             :         zend_long key;
     234             : 
     235           4 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &key) == FAILURE)       {
     236           0 :                 return;
     237             :         }
     238             : 
     239           4 :         if (msgget(key, 0) < 0) {
     240           3 :                 RETURN_FALSE;
     241             :         }
     242             : 
     243           1 :         RETURN_TRUE;
     244             : }
     245             : /* }}} */
     246             : 
     247             : /* {{{ proto resource msg_get_queue(int key [, int perms])
     248             :    Attach to a message queue */
     249           7 : PHP_FUNCTION(msg_get_queue)
     250             : {
     251             :         zend_long key;
     252           7 :         zend_long perms = 0666;
     253             :         sysvmsg_queue_t *mq;
     254             : 
     255           7 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &key, &perms) == FAILURE) {
     256           0 :                 return;
     257             :         }
     258             : 
     259           7 :         mq = (sysvmsg_queue_t *) emalloc(sizeof(sysvmsg_queue_t));
     260             : 
     261           7 :         mq->key = key;
     262           7 :         mq->id = msgget(key, 0);
     263           7 :         if (mq->id < 0)   {
     264             :                 /* doesn't already exist; create it */
     265           7 :                 mq->id = msgget(key, IPC_CREAT | IPC_EXCL | perms);
     266           7 :                 if (mq->id < 0)   {
     267           0 :                         php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%lx: %s", key, strerror(errno));
     268           0 :                         efree(mq);
     269           0 :                         RETURN_FALSE;
     270             :                 }
     271             :         }
     272          14 :         RETVAL_ZVAL(zend_list_insert(mq, le_sysvmsg TSRMLS_CC), 0, 0);
     273             : }
     274             : /* }}} */
     275             : 
     276             : /* {{{ proto bool msg_remove_queue(resource queue)
     277             :    Destroy the queue */
     278           7 : PHP_FUNCTION(msg_remove_queue)
     279             : {
     280             :         zval *queue;
     281           7 :         sysvmsg_queue_t *mq = NULL;
     282             : 
     283           7 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &queue) == FAILURE) {
     284           0 :                 return;
     285             :         }
     286             : 
     287           7 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, queue, -1, "sysvmsg queue", le_sysvmsg);
     288             : 
     289           7 :         if (msgctl(mq->id, IPC_RMID, NULL) == 0) {
     290           7 :                 RETVAL_TRUE;
     291             :         } else {
     292           0 :                 RETVAL_FALSE;
     293             :         }
     294             : }
     295             : /* }}} */
     296             : 
     297             : /* {{{ proto mixed msg_receive(resource queue, int desiredmsgtype, int &msgtype, int maxsize, mixed message [, bool unserialize=true [, int flags=0 [, int errorcode]]])
     298             :    Send a message of type msgtype (must be > 0) to a message queue */
     299          13 : PHP_FUNCTION(msg_receive)
     300             : {
     301          13 :         zval *out_message, *queue, *out_msgtype, *zerrcode = NULL;
     302          13 :         zend_long desiredmsgtype, maxsize, flags = 0;
     303          13 :         zend_long realflags = 0;
     304          13 :         zend_bool do_unserialize = 1;
     305          13 :         sysvmsg_queue_t *mq = NULL;
     306          13 :         struct php_msgbuf *messagebuffer = NULL; /* buffer to transmit */
     307             :         int result;
     308             : 
     309          13 :         RETVAL_FALSE;
     310             : 
     311          13 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz/lz/|blz/",
     312             :                                 &queue, &desiredmsgtype, &out_msgtype, &maxsize,
     313             :                                 &out_message, &do_unserialize, &flags, &zerrcode) == FAILURE) {
     314           2 :                 return;
     315             :         }
     316             : 
     317          11 :         if (maxsize <= 0) {
     318           1 :                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "maximum size of the message has to be greater than zero");
     319           1 :                 return;
     320             :         }
     321             : 
     322          10 :         if (flags != 0) {
     323           7 :                 if (flags & PHP_MSG_EXCEPT) {
     324             : #ifndef MSG_EXCEPT
     325             :                         php_error_docref(NULL TSRMLS_CC, E_WARNING, "MSG_EXCEPT is not supported on your system");
     326             :                         RETURN_FALSE;
     327             : #else
     328           0 :                         realflags |= MSG_EXCEPT;
     329             : #endif
     330             :                 }
     331           7 :                 if (flags & PHP_MSG_NOERROR) {
     332           0 :                         realflags |= MSG_NOERROR;
     333             :                 }
     334           7 :                 if (flags & PHP_MSG_IPC_NOWAIT) {
     335           7 :                         realflags |= IPC_NOWAIT;
     336             :                 }
     337             :         }
     338             : 
     339          10 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t *, queue, -1, "sysvmsg queue", le_sysvmsg);
     340             : 
     341          10 :         messagebuffer = (struct php_msgbuf *) safe_emalloc(maxsize, 1, sizeof(struct php_msgbuf));
     342             : 
     343          10 :         result = msgrcv(mq->id, messagebuffer, maxsize, desiredmsgtype, realflags);
     344             : 
     345          10 :         zval_dtor(out_msgtype);
     346          10 :         zval_dtor(out_message);
     347          10 :         ZVAL_LONG(out_msgtype, 0);
     348          10 :         ZVAL_FALSE(out_message);
     349             : 
     350          10 :         if (zerrcode) {
     351           4 :                 ZVAL_DEREF(zerrcode);
     352           2 :                 zval_dtor(zerrcode);
     353           2 :                 ZVAL_LONG(zerrcode, 0);
     354             :         }
     355             : 
     356          10 :         if (result >= 0) {
     357             :                 /* got it! */
     358           7 :                 ZVAL_LONG(out_msgtype, messagebuffer->mtype);
     359             : 
     360           7 :                 RETVAL_TRUE;
     361           7 :                 if (do_unserialize)     {
     362             :                         php_unserialize_data_t var_hash;
     363             :                         zval tmp;
     364           2 :                         const unsigned char *p = (const unsigned char *) messagebuffer->mtext;
     365             : 
     366           2 :                         PHP_VAR_UNSERIALIZE_INIT(var_hash);
     367           2 :                         if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) {
     368           1 :                                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "message corrupted");
     369           1 :                                 RETVAL_FALSE;
     370             :                         } else {
     371           1 :                                 ZVAL_COPY_VALUE(out_message, &tmp);
     372             :                         }
     373           2 :                         PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
     374             :                 } else {
     375          10 :                         ZVAL_STRINGL(out_message, messagebuffer->mtext, result);
     376             :                 }
     377           3 :         } else if (zerrcode) {
     378           1 :                 ZVAL_LONG(zerrcode, errno);
     379             :         }
     380          10 :         efree(messagebuffer);
     381             : }
     382             : /* }}} */
     383             : 
     384             : /* {{{ proto bool msg_send(resource queue, int msgtype, mixed message [, bool serialize=true [, bool blocking=true [, int errorcode]]])
     385             :    Send a message of type msgtype (must be > 0) to a message queue */
     386          11 : PHP_FUNCTION(msg_send)
     387             : {
     388          11 :         zval *message, *queue, *zerror=NULL;
     389             :         zend_long msgtype;
     390          11 :         zend_bool do_serialize = 1, blocking = 1;
     391          11 :         sysvmsg_queue_t * mq = NULL;
     392          11 :         struct php_msgbuf * messagebuffer = NULL; /* buffer to transmit */
     393             :         int result;
     394          11 :         int message_len = 0;
     395             : 
     396          11 :         RETVAL_FALSE;
     397             : 
     398          11 :         if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz|bbz/",
     399             :                                 &queue, &msgtype, &message, &do_serialize, &blocking, &zerror) == FAILURE) {
     400           1 :                 return;
     401             :         }
     402             : 
     403          10 :         ZEND_FETCH_RESOURCE(mq, sysvmsg_queue_t*, queue, -1, "sysvmsg queue", le_sysvmsg);
     404             : 
     405          10 :         if (do_serialize) {
     406           2 :                 smart_str msg_var = {0};
     407             :                 php_serialize_data_t var_hash;
     408             : 
     409           2 :                 PHP_VAR_SERIALIZE_INIT(var_hash);
     410           2 :                 php_var_serialize(&msg_var, message, &var_hash TSRMLS_CC);
     411           2 :                 PHP_VAR_SERIALIZE_DESTROY(var_hash);
     412             : 
     413             :                 /* NB: php_msgbuf is 1 char bigger than a long, so there is no need to
     414             :                  * allocate the extra byte. */
     415           2 :                 messagebuffer = safe_emalloc(msg_var.s->len, 1, sizeof(struct php_msgbuf));
     416           2 :                 memcpy(messagebuffer->mtext, msg_var.s->val, msg_var.s->len + 1);
     417           2 :                 message_len = msg_var.s->len;
     418             :                 smart_str_free(&msg_var);
     419             :         } else {
     420             :                 char *p;
     421          16 :                 switch (Z_TYPE_P(message)) {
     422             :                         case IS_STRING:
     423           2 :                                 p = Z_STRVAL_P(message);
     424           2 :                                 message_len = Z_STRLEN_P(message);
     425           2 :                                 break;
     426             : 
     427             :                         case IS_LONG:
     428           1 :                                 message_len = spprintf(&p, 0, "%pd", Z_LVAL_P(message));
     429           1 :                                 break;
     430             :                         case IS_FALSE:
     431           0 :                                 message_len = spprintf(&p, 0, "0");
     432           0 :                                 break;
     433             :                         case IS_TRUE:
     434           1 :                                 message_len = spprintf(&p, 0, "1");
     435           1 :                                 break;
     436             :                         case IS_DOUBLE:
     437           2 :                                 message_len = spprintf(&p, 0, "%F", Z_DVAL_P(message));
     438           2 :                                 break;
     439             :                         default:
     440           2 :                                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Message parameter must be either a string or a number.");
     441           2 :                                 RETURN_FALSE;
     442             :                 }
     443             : 
     444           6 :                 messagebuffer = safe_emalloc(message_len, 1, sizeof(struct php_msgbuf));
     445           6 :                 memcpy(messagebuffer->mtext, p, message_len + 1);
     446             : 
     447          12 :                 if (Z_TYPE_P(message) != IS_STRING) {
     448           4 :                         efree(p);
     449             :                 }
     450             :         }
     451             : 
     452             :         /* set the message type */
     453           8 :         messagebuffer->mtype = msgtype;
     454             : 
     455           8 :         result = msgsnd(mq->id, messagebuffer, message_len, blocking ? 0 : IPC_NOWAIT);
     456             : 
     457           8 :         efree(messagebuffer);
     458             : 
     459           8 :         if (result == -1) {
     460           1 :                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "msgsnd failed: %s", strerror(errno));
     461           1 :                 if (zerror) {
     462           1 :                         ZVAL_LONG(zerror, errno);
     463             :                 }
     464             :         } else {
     465           7 :                 RETVAL_TRUE;
     466             :         }
     467             : }
     468             : /* }}} */
     469             : 
     470             : /*
     471             :  * Local variables:
     472             :  * tab-width: 4
     473             :  * c-basic-offset: 4
     474             :  * End:
     475             :  * vim600: noet sw=4 ts=4 tw=78 fdm=marker
     476             :  * vim<600: noet sw=4 ts=4 tw=78
     477             :  */

Generated by: LCOV version 1.10

Generated at Sat, 22 Nov 2014 23:01:27 +0000 (5 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.