tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: veronica luarca <veronica_lg10 () hotmail ! com>
To: tru64-unix-managers
Subject: Problem with putmsg() funtion
Date: Tue, 17 Apr 2001 08:01:07 +0000	[thread overview]
Message-ID: <98749453930373.tru64-unix-managers.marc@archive.invalid> (raw)

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.

                 reply	other threads:[~2001-04-17  8:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox