int main(char argc,char **argv) { mqd_t mqds; if(argc>1) { mqds=mq_open(argv[1],O_WRONLY); if(mqds==-1) printf("open error\n"); mq_send(mqds,"1234",5,0); mq_close(mqds); } return 0; }
void mqueue_check_functions(mqd_t m) { (void)mq_close(m); (void)mq_getattr(m, (struct mq_attr *)0); (void)mq_notify(m, (const struct sigevent *)0); (void)mq_open((const char *)0, 0, 0); (void)mq_receive(m, (char*)0, (size_t)0, (unsigned*)0); (void)mq_send(m, (const char *)0, (size_t)0, (unsigned)0); (void)mq_setattr(m, (const struct mq_attr *)0, (struct mq_attr *)0); (void)mq_timedreceive(m, (char*)0, (size_t)0, (unsigned*)0, (const struct timespec*)0); (void)mq_timedsend(m, (const char *)0, (size_t)0, (unsigned)0, (const struct timespec*)0); (void)mq_unlink((const char *)0); }
void msg_snd(mqd_t mqdes, int i) { char buf[16]; sprintf(buf, "%d", i); errno = 0; if (mq_send(mqdes, buf, strlen(buf) + 1, 0) == -1) { perror("mq_send failed"); fflush(stdout); sleep(1); exit(1); } }
int main(void) { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; mqd_t mqdes; unsigned rvprio, sdprio = 1; struct timespec ts; struct mq_attr attr; int unresolved = 0; sprintf(mqname, "/" FUNCTION "_" TEST "_%d", getpid()); attr.mq_msgsize = BUFFER; attr.mq_maxmsg = BUFFER; mqdes = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &attr); if (mqdes == (mqd_t) - 1) { perror(ERROR_PREFIX "mq_open"); unresolved = 1; } if (mq_send(mqdes, msgptr, strlen(msgptr), sdprio) != 0) { perror(ERROR_PREFIX "mq_send"); unresolved = 1; } ts.tv_sec = time(NULL) + 1; ts.tv_nsec = -1; if (mq_timedreceive(mqdes, msgrv, BUFFER, &rvprio, &ts) == -1) { printf("mq_timedreceive() did fail on invalid abs_time\n"); } else { printf("mq_timedreceive() did not fail on invalid abs_time\n"); } if (mq_close(mqdes) != 0) { perror(ERROR_PREFIX "mq_close"); unresolved = 1; } if (mq_unlink(mqname) != 0) { perror(ERROR_PREFIX "mq_unlink"); unresolved = 1; } if (unresolved == 1) { printf("Test UNRESOLVED\n"); return PTS_UNRESOLVED; } printf("Test PASSED\n"); return PTS_PASS; }
int main(int argc, char *argv[]) { if (argc != 2) { printf("Usage:\n%s [mq path]\n", argv[0]); exit(EXIT_FAILURE); } int buffersiz, nmessages; read_config(&buffersiz, &nmessages); struct mq_attr attr; attr.mq_flags = 0; attr.mq_maxmsg = 2; attr.mq_msgsize = buffersiz; attr.mq_curmsgs = 0; mq_unlink(argv[1]); /* Just to make sure it is clean. */ mqd_t mq; if ((mq = mq_open(argv[1], O_CREAT | O_EXCL | O_RDWR, 0666, &attr)) < 0) error("mq_open"); char data[buffersiz]; unsigned long i; unsigned prio; for (i = 0; i < nmessages; i++) { /* Read message. */ if (mq_receive(mq, data, buffersiz, &prio) < 0) error("mq_receive"); /* Send back acknowledgment. */ bzero(data, buffersiz); sprintf(data, "ACK"); if (mq_send(mq, data, buffersiz, 1) < 0) error("mq_send"); } if (mq_close(mq) < 0) error("mq_close"); if (mq_unlink(argv[1]) < 0) error("mq_unlink"); return 0; }
void handleWrite(const boost::system::error_code &/*ec*/, std::size_t /*bytes_transferred*/) { //now the mq is writable if (send_queue.empty()) { return; } boost::unique_lock<boost::mutex> lock(mutex); QueueData write_data = send_queue.top(); send_queue.pop(); lock.unlock(); int sendRet = mq_send(mqid, reinterpret_cast<const char*>(write_data.data.data()), write_data.data.size(), write_data.priority); int error = errno; if (sendRet) { if (errno != EAGAIN) { //This may happen often... std::cerr << "Sending to mq failed: " << strerror(error) << std::endl; } if (errno == EMSGSIZE) { //Message is too big, discard it //TODO: Notify sender } else { lock.lock(); //TODO: Maybe add a retry counter to write_data send_queue.push(write_data); lock.unlock(); } } if (send_queue.empty()) { return; } streamDescriptor.async_write_some( boost::asio::null_buffers(), boost::bind(&MessageQueue::handleWrite, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); }
int main() { char qname[NAMESIZE]; const char *msgptr = MSGSTR; mqd_t queue; int unresolved=0, failure=0, i; sprintf(qname, "/mq_send_13-1_%d", getpid()); queue = mq_open(qname, O_CREAT |O_RDWR, S_IRUSR | S_IWUSR, NULL); if (queue == (mqd_t)-1) { perror("mq_open() did not return success"); return PTS_UNRESOLVED; } for (i=0; i<NUMINVALID; i++) { if (mq_send(queue, msgptr, strlen(msgptr), invalidpri[i])== 0) { printf("mq_send() returned success on invalid %d\n", invalidpri[i]); failure = 1; } if (errno != EINVAL) { printf("errno not == EINVAL for invalid %d\n", invalidpri[i]); failure = 1; } } if (mq_close(queue) != 0) { perror("mq_close() did not return success"); unresolved=1; } if (mq_unlink(qname) != 0) { perror("mq_unlink() did not return success"); unresolved=1; } if (failure==1) { printf("Test FAILED\n"); return PTS_FAIL; } if (unresolved==1) { printf("Test UNRESOLVED\n"); return PTS_UNRESOLVED; } printf("Test PASSED\n"); return PTS_PASS; }
int main() { char mqname[NAMESIZE]; mqd_t mqdes; const char s_msg_ptr[MSG_SIZE] = "test message \n"; struct sigevent notification; struct sigaction sa; unsigned int prio = 1; sprintf(mqname, "/" FUNCTION "_" TEST "_%d", getpid()); mqdes = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); if (mqdes == (mqd_t)-1) { perror(ERROR_PREFIX "mq_open"); return PTS_UNRESOLVED; } notification.sigev_notify = SIGEV_SIGNAL; notification.sigev_signo = SIGUSR1; sa.sa_handler = msg_handler; sa.sa_flags = 0; sigaction(SIGUSR1, &sa, NULL); if (mq_notify(mqdes, ¬ification) != 0) { perror(ERROR_PREFIX "mq_notify"); mqclean(mqdes, mqname); return PTS_UNRESOLVED; } if (mq_notify(mqdes, NULL) != 0 ) { printf("Test FAILED \n"); mqclean(mqdes, mqname); return PTS_FAIL; } if (mq_send(mqdes, s_msg_ptr, MSG_SIZE, prio) == -1) { perror(ERROR_PREFIX "mq_send"); mqclean(mqdes, mqname); return PTS_UNRESOLVED; } sleep(1); if (mq_unlink(mqname) != 0) { perror(ERROR_PREFIX "mq_unlink"); return PTS_UNRESOLVED; } if (!enter_handler) { printf("Test PASSED \n"); mqclean(mqdes, mqname); return PTS_PASS; } else { printf("Test FAILED \n"); mqclean(mqdes, mqname); return PTS_FAIL; } }
int main() { char mqname[NAMESIZE], msgrv[BUFFER]; const char *msgptr = "test message"; mqd_t mqdes; int prio = 1; struct mq_attr mqstat; struct timespec ts; int unresolved = 0, failure = 0; sprintf(mqname, "/" FUNCTION "_" TEST "_%d", getpid()); memset(&mqstat, 0, sizeof(mqstat)); mqstat.mq_msgsize = BUFFER + 1; mqstat.mq_maxmsg = BUFFER + 1; mqdes = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, &mqstat); if (mqdes == (mqd_t)-1) { perror(ERROR_PREFIX "mq_open"); unresolved = 1; } if (mq_send(mqdes, msgptr, strlen(msgptr), prio) != 0) { perror(ERROR_PREFIX "mq_send"); unresolved = 1; } ts.tv_sec = time(NULL) + 1; ts.tv_nsec = 0; if (mq_timedreceive(mqdes, msgrv, BUFFER, NULL, &ts) > 0) { printf("FAIL: mq_timedreceive succeed unexpectly\n"); failure = 1; } if (mq_close(mqdes) != 0) { perror(ERROR_PREFIX "mq_close"); unresolved = 1; } if (mq_unlink(mqname) != 0) { perror(ERROR_PREFIX "mq_unlink"); unresolved = 1; } if (failure == 1) { printf("Test FAILED\n"); return PTS_FAIL; } if (unresolved == 1) { printf("Test UNRESOLVED\n"); return PTS_UNRESOLVED; } printf("Test PASSED\n"); return PTS_PASS; }
void Robot_Thread::run() { Msg_Com_Robot msg_com_robot; Msg_Vid_Robot msg_vid_robot; timespec delay; delay.tv_nsec = 1000000; // TODO : Temporaire delay.tv_sec = 0; for ( ; ; ) { bool modified = false; /*if (mq_timedreceive(bal_com_robot, (char*)&msg_com_robot, sizeof(Msg_Com_Robot), NULL, &delay) != -1) { modified = true; setNewPosition(robot1, msg_com_robot.robot1); setNewPosition(robot2, msg_com_robot.robot2); }*/ if (mq_receive(bal_video_robot, (char*)&msg_vid_robot, sizeof(Msg_Vid_Robot), NULL) != -1) { modified = true; setPositionsFromVideo(msg_vid_robot.robot1, msg_vid_robot.robot2, msg_vid_robot.balle); } if (modified) { Msg_Robot_IA msg_robot_ia; msg_robot_ia.robot1.angle = robot1.angle; msg_robot_ia.robot1.pos_x = robot1.pos_x; msg_robot_ia.robot1.pos_y = robot1.pos_y; msg_robot_ia.robot2.angle = robot2.angle; msg_robot_ia.robot2.pos_x = robot2.pos_x; msg_robot_ia.robot2.pos_y = robot2.pos_y; msg_robot_ia.balle.pos_x = balle.pos_x; msg_robot_ia.balle.pos_y = balle.pos_y; msg_robot_ia.balle.vit_x = balle.vit_x; msg_robot_ia.balle.vit_y = balle.vit_y; if (difftime(time(NULL), my_time) >= 2) { my_time = time(NULL); printf("position de la balle : %d, %d\n", balle.pos_x, balle.pos_y); printf("position du robot1 : %d, %d\n", robot1.pos_x, robot1.pos_y); printf("position du robot2 : %d, %d\n", robot2.pos_x, robot2.pos_y); mq_send(bal_robot_ia, (char*)&msg_robot_ia, sizeof(Msg_Robot_IA), 0); } } } }
// create the stream for client/server interaction struct SC_STREAM register_user(char *name){ struct SC_STREAM message_Ques; char *receive_que; mqd_t mq = mq_open("/register",O_WRONLY); mqd_t mq_server; size_t size = strlen(name); mq_send(mq,name,size,1); // register this user with server mq_close("/register"); message_Ques.server = mq_open("/server",O_WRONLY); //send messages to server to handle strcat(receive_que,"/"); strcat(receive_que,name); message_Ques.client = mq_open(receive_que,O_RDONLY); //receive messages from server (all users) return message_Ques; }
void start_play(int player) { int rc; long msg = (long) START_PLAY; if (player == PLAYER_A) { printf(" player %s to serve\n", PLAYER_A_STR); fflush(stdout); rc = mq_send(playerA_queue, (char *) &msg, sizeof(msg), 1); } else { printf(" player %s to serve\n", PLAYER_B_STR); fflush(stdout); rc = mq_send(playerB_queue, (char *) &msg, sizeof(msg), 1); } if (rc == -1) { perror("error: start_play"); exit(EXIT_FAILURE); } }
void deposer_pc_brt() { char * msg = "depose\0"; //alarm(TIMEOUT); //signal(SIGALRM, fnc_evenementielle_timerRA); //armer_timer(timer_RA, 20 sec); deposer_piece_brute(); //alarm(0); //desarmer_timer(timerRA); //kill(sender, PIECEDEPOSEE); mq_send(messageQueueRobotAl, msg, strlen(msg), (unsigned int) 0); //send(fin_depot_piece_brute_sur_convoyeur, X); }
void storageFileFinish( void *streamHandle ) { storageMsg_t msg; if (!((streamInfo_t*)streamHandle)->storageHandle) return; printf("%s\n", __FUNCTION__); msg.cmd = STORAGE_CMD_FINISH; msg.handle = streamHandle; mq_send(storageMsgQ, (const char *) &msg, sizeof(storageMsg_t), 0); }
int writeMessage(MessageContainer* container, mqd_t fd) { int result; DEBUG(2, "writing mq"); result = mq_send(fd, (char*)container, sizeof(MessageContainer), 0); if (result == -1) { ERROR("error writing mq"); } return result; }
int main(int argc, char *argv[]) { if ( argc != 3 ) fail( "usage: client <add/remove/query> <word>" ); // make arguments into char char *word = argv[2]; char *para = argv[1]; // Open the message queue for talking to the server. mqd_t serverQueue = mq_open( SERVER_QUEUE, O_WRONLY ); mqd_t clientQueue = mq_open( CLIENT_QUEUE, O_RDONLY ); if ( serverQueue == -1 || clientQueue == -1) fail( "Can't open message queue" ); // Send the parameter(arg 2) mq_send( serverQueue, para, strlen( para ), 0 ); // Send the word (arg 3) mq_send( serverQueue, word, strlen( word ), 0 ); //receive the answer from server char ans[MESSAGE_LIMIT +1]; int len = mq_receive(clientQueue, ans, sizeof( ans ), NULL); if(len >=0){ for ( int i = 0; i < len; i++ ) printf( "%c", ans[ i ] ); printf("\n"); } // We're done, close our copy of the queue (which would happen when we exit anyway). mq_close( serverQueue ); mq_close( clientQueue ); exit(0); }
int main(int argc, char * argv[]){ signal(SIGUSR2,wait_for_nack); signal(SIGUSR1,wait_for_ack); if(argc<2){ printf("podaj nazwe klienta\n"); return 1; } mqd_t queue_id = createQueue(QUEUENAME,sizeof(message)); if(queue_id<0){ printf("SERVER not opened\n"); perror(NULL); exit(1); } printf("opended server id:%d\n",queue_id); signal(SIGINT,breakloop); while(ender){ /** wysylamy nasza wiadomosc */ printf("any key to send message\n"); getchar(); message comm; comm.pid=getpid(); sprintf(comm.who,"%s",argv[1]); int i; srand(times(NULL)); for(i=0;i<LEN;i++){ if(!(rand()%128))break; char c ='a'+rand()%24; comm.what[i]=c; } comm.what[i-1]=0; int rc = mq_send(queue_id, (char*)(&comm), sizeof(comm) , 0); if (rc < 0) { printf("message not send"); perror(NULL); return 1; } else { flag=0; while(!flag){sleep(1);}; if(flag==1){ printf("ALREADY FULLL\n"); }else{ printf("SEND:\t%s\n%s\n",comm.who,comm.what); } } } return 0; }
/** * Destroy (by creator) or detach (by others) a shared memory segment * * Creator detaching is an error. * Other destroying will be converted to a detach * * @param B BAKA World * @param shmmap Shared memory map structure * @param flags */ void bk_shmmap_destroy(bk_s B, struct bk_shmmap *shmmap, bk_flags flags) { BK_ENTRY(B, __FUNCTION__, __FILE__, "libbk"); struct bk_shmmap_cmds bop; if (!shmmap) { bk_error_printf(B, BK_ERR_ERR, "Illegal arguments\n"); BK_VRETURN(B); } if (shmmap->sm_userbucket) { shmmap->sm_userbucket->su_state = BK_SHMMAP_USER_STATECLOSE; bop.bsc_pid = shmmap->sm_userbucket->su_pid; strncpy(bop.bsc_name, shmmap->sm_userbucket->su_name,BK_SHMMAP_MAXCLIENTNAME); bop.bsc_op = bk_shmmap_op_detach; } else { bop.bsc_op = bk_shmmap_op_destroy; shmmap->sm_addr->sh_state = BK_SHMMAP_CLOSE; } if (shmmap->sm_addr) { // Mark as going down munmap(shmmap->sm_addr, shmmap->sm_addr->sh_size); } if (shmmap->sm_shmfd >= 0) close(shmmap->sm_shmfd); if (shmmap->sm_creatorcmds >= 0) if (shmmap->sm_userbucket) mq_close(shmmap->sm_creatorcmds); // manage needs to keep the structure around if (shmmap->sm_userbucket) { if (shmmap->sm_name) free(shmmap->sm_name); free(shmmap); } mq_send(shmmap->sm_creatorcmds, (void *)&bop, sizeof(bop), 0); BK_VRETURN(B); }
queue_err_t queue_send(void *p, const char *msg, int msg_len) { posix_queue_t *q; q = (posix_queue_t *) p; if (msg_len < 0) { msg_len = strlen(msg); } if (0 == mq_send(q->mq, msg, msg_len, 0)) { return QUEUE_ERR_OK; } else { // TODO: error return QUEUE_ERR_GENERAL_FAILURE; } }
void toylog(const char* format, ...) { va_list args; char buf[128]; // How va_start va_end works? va_start(args, format); /* vprintf(format, args); */ vsnprintf(buf, 128, format, args); va_end(args); if (mq_send(mqd, buf, strlen(buf)+1, 1) == -1) { perror("mq_send"); exit(EXIT_FAILURE); } }
int producer() { mqd_t mq; struct mq_attr attr; char buffer[MAX_SIZE]; int msg, i; attr.mq_flags = 0; attr.mq_maxmsg = 10; attr.mq_msgsize = MAX_SIZE; attr.mq_curmsgs = 0; mq = mq_open(Q_NAME, O_CREAT | O_WRONLY, 0644, &attr); /* seed random */ srand(time(NULL)); i = 0; while (i < 500) { msg = rand() % 256; memset(buffer, 0, MAX_SIZE); sprintf(buffer, "%x", msg); printf("Produced: %s\n", buffer); fflush(stdout); mq_send(mq, buffer, MAX_SIZE, 0); i=i+1; } memset(buffer, 0, MAX_SIZE); sprintf(buffer, M_EXIT); mq_send(mq, buffer, MAX_SIZE, 0); mq_close(mq); mq_unlink(Q_NAME); return 0; }
void *writer_thread(void *write_data_arg) { int thread_index = *((int *) write_data_arg); PRINT(LOG_CRITICAL,"\n %d ",thread_index); unsigned long prio = 0; char buf[MSGSIZE] = {0}; for (prio = 0; prio < no_of_msg-1; prio += 1) { snprintf(buf,100,"msg no %lu of %d",prio,thread_index); PRINT(LOG_CRITICAL,"\nThread no : %d is writing a message with priority %lu .\n",thread_index,prio); if (mq_send ((mq_info[thread_index]).mq_des, buf, sizeof(buf), (prio % 100)) == -1) perror ("mq_send()"); PRINT(LOG_CRITICAL,"write thread Prio %lu threadindex %d",prio,thread_index); } PRINT(LOG_CRITICAL,"Exiting thread %d:",thread_index); }
int ipc_mq_posix_send(ipc_mq obj, const struct ipc_mq_data* data, size_t data_size) { struct ipc_mq_posix* priv = NULL; if(!obj || !data || data_size == 0) { errno = EINVAL; return -1; } priv = (struct ipc_mq_posix*)&obj->priv; return mq_send(priv->mq, data->data, data_size, (unsigned int)data->priv); }
static void sc_send( t_sc *sc, char msg, int priority) /* * Send the given message to the given synchronisation controller */ { mqd_t stat; /* Status from mq_send() */ stat = mq_send(sc->mq, &msg, sizeof(msg), priority); if(stat == (mqd_t)-1) E("Failed to send message %d", (int)msg); } /* sc_send() */
/** * socket_udp_recv - the function will be callbacked by LWIP when LWIP recieve * a udp * * @param arg the user private point * @param pcb the point of the target udp pcb * @param pbuf the package of the udp * @param addr the address of the remote IP address * @param port the port number of the remote IP device */ static void socket_udp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *pbuf, struct ip_addr *addr, u16_t port) { if (pbuf != NULL) { char ret = 0; struct socket *socket= (struct socket *)arg; mq_send(socket->rx_mqd, &ret, 1, 0); } }
int * send_2(void * mq) { int i; mqd_t mq2 = *(mqd_t *)mq; printf("Enter into send_2 \n"); for (i = 0; i < MAX_MSG; i++) { if (-1 == mq_send(mq2, s_msg_ptr[i], MSG_SIZE, i)) { perror("mq_send doesn't return success \n"); pthread_exit((void *)1); } printf("[%d] send '%s' in thread send_2. \n", i+1, s_msg_ptr[i]); } pthread_exit((void *)0); }
void sendNumber(int clientID) { queueMessageType msg; if(clientID >= clientsCounter) { printf("Error while sending number! Invalid client id!\n"); return; } msg.message.type = SERVER_RESPONSE; msg.message.number = (rand() % 10000) + 1; if(mq_send(clients[clientID], msg.bytes, SIZE, 0) == -1) { printf("Error while sending number to client %d!\n", clientID); } }
void childloop(mqd_t mq) { char c; register char *cptr = &c; for ( ;; ) { if (mq_receive(mq, buf, sizeof(buf), NULL) == -1 || mq_send(mq, cptr, sizeof(c), 0) == -1) { perror("(w) receive/send on mq"); mq_close(mq); exit(1); } } }
int nilfs_cleaner_reload(struct nilfs_cleaner *cleaner, const char *conffile) { struct nilfs_cleaner_request_with_path req; struct nilfs_cleaner_response res; size_t pathlen, reqsz; int bytes, ret = -1; if (cleaner->sendq < 0 || cleaner->recvq < 0) { errno = EBADF; goto out; } if (nilfs_cleaner_clear_queueu(cleaner) < 0) goto out; if (conffile) { if (myrealpath(conffile, req.pathname, NILFS_CLEANER_MSG_MAX_PATH) == NULL) goto out; pathlen = strlen(req.pathname); req.hdr.argsize = pathlen + 1; reqsz = sizeof(req.hdr) + pathlen + 1; } else { req.hdr.argsize = 0; reqsz = sizeof(req.hdr); } req.hdr.cmd = NILFS_CLEANER_CMD_RELOAD; uuid_copy(req.hdr.client_uuid, cleaner->client_uuid); ret = mq_send(cleaner->sendq, (char *)&req, reqsz, NILFS_CLEANER_PRIO_NORMAL); if (ret < 0) goto out; bytes = mq_receive(cleaner->recvq, (char *)&res, sizeof(res), NULL); if (bytes < sizeof(res)) { if (bytes >= 0) errno = EIO; ret = -1; goto out; } if (res.result == NILFS_CLEANER_RSP_NACK) { ret = -1; errno = res.err; } out: return ret; }
void * build_histogram_entry(void * data) { int i = 0; int num_blocks, error; struct Histogram32 h32; struct Histogram16 h16; mqd_t mq_histogram_in, mq_histogram_out; char buffer[BLOCK_SIZE_MAX]; // set up mqs for communication mq_histogram_in = mq_open("/mq_build_histogram_in",O_RDWR); if(mq_histogram_in == (mqd_t)(-1)){ perror("could not open /mq_build_histogram_in"); exit(1); } mq_histogram_out = mq_open("/mq_build_histogram_out",O_RDWR); if(mq_histogram_out == (mqd_t)(-1)){ perror("could not open /mq_build_histogram_out"); exit(1); } // get the number of blocks i = mq_receive(mq_histogram_in, (char*)&num_blocks, BLOCK_SIZE_MAX, NULL); assert(i == 4); // receive blocks and add the symbols to the 31-bit histogram histogram32_init(&h32); while(num_blocks){ i = mq_receive(mq_histogram_in, buffer, BLOCK_SIZE_MAX, NULL); histogram32_add(&h32, buffer, i); num_blocks--; } // convert the histogram to 16-bit resolution histogram32to16(&h32, &h16); // send the histogram error = mq_send( mq_histogram_out, (char*)&h16, sizeof h16, 0); if(error){ perror("mq_send: /mq_build_histogram_out"); } return NULL; }