From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <98749453930373.tru64-unix-managers.marc@archive.invalid> From: veronica luarca Date: Tue, 17 Apr 2001 08:01:07 +0000 To: tru64-unix-managers Subject: Problem with putmsg() funtion X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=98749453930373 Hi all, I have a communication problem between an client and the application. I have a DS20 runing Tru64 v4.0G and when the client tries to use putmsg() function they get the following error: #define ENOSTR 87 /* fd not associated with a stream */ The code is the following: void abrir_colas() { /***************************************************************************** Establezco timeout de 5 seg. y abro la cola de salida en modo bloqueante. Si el OPEN es correcto desactivo la alarma. Si no envio mensaje al LOG y paro el proceso. *****************************************************************************/ strcpy(w_cola, directorio); strcat(w_cola, "/"); strcat(w_cola,nom_proc_pi); strcat(w_cola,".col"); sigset(SIGALRM,manejador2); alarm(5); if ((colafds[COLA_SALIDA] = open(w_cola, O_WRONLY)) >= 0) alarm(0); else { strcpy(m80_entrada.situacion, "APERTURA "); strcpy(m80_entrada.dispositivo, nom_proc_pi ); sprintf(m80_entrada.num_error, "%.4d", errno); m80_entrada.niv_error = '1'; sprintf(m80_entrada.datos, "Cola S. %s Error %s",\ nom_proc_pi , strerror(errno)); enviar_log(); cerrar_log(); exit(-1); } /**************************************************************************** Por la cola de salida envio en el mensaje de enlace al PI ****************************************************************************/ bf_control.identificador = getpid(); bf_control.codigo = CONTROL; strncpy(bf_control.proceso,nom_proceso,8); bf_control.proceso[8] = '\0'; ctlbuffer.buf=(char *)&bf_control; ctlbuffer.maxlen=sizeof(bf_control); ctlbuffer.len=sizeof(bf_control); if ((outcome=putmsg(colafds[COLA_SALIDA], &ctlbuffer, NULL, 0)) != OK) { strcpy(m80_entrada.situacion, "ESCRITURA"); strcpy(m80_entrada.dispositivo, nom_proceso); sprintf(m80_entrada.num_error, "%.4d", errno); m80_entrada.niv_error='1'; sprintf(m80_entrada.datos, "Cola S. %s Error %s",\ nom_proceso, strerror(errno)); enviar_log(); cerrar_log(); exit(-1); } Any idea?. I would be very pleasent if someone could send me a program with putmsg or getmsg which works OK. Thanks, _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.