* Problem with putmsg() funtion
@ 2001-04-17 8:01 veronica luarca
0 siblings, 0 replies; only message in thread
From: veronica luarca @ 2001-04-17 8:01 UTC (permalink / raw)
To: tru64-unix-managers
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-04-17 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-17 8:01 Problem with putmsg() funtion veronica luarca
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox