[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mailq can't talk to scheduler on 64-bit machines



The scheduler communicates with mailq through a protocol which prints (as
text) machine addresses of pointers, to be reconstructed by mailq.  The
scheduler writes them as unsigned longs, but mailq reads them as ints (with
atoi).

This obviously can't work on a machine with 64-bit addresses.  I thought at
first of making mailq read the numbers as longs, but that won't work if mailq
is running on a 32-bit machine.

So here is a sleazy hack:  the scheduler writes only the low 32 bits of the
address, and we hope that they are unique.

*** 1.1	1993/08/23 21:53:08
--- qprint.c	1993/08/23 21:53:39
***************
*** 98,104 ****
  	/* assert cfp != NULL */
  	for (vp = cfp->head; vp != NULL; vp = vp->next[L_CTLFILE]) {
  		(void) fprintf(qpfp, "%lu:\t%s\t%d;",
! 			      (u_long)vp, cfp->mid, vp->ngroup);
  		qpch = ' ';
  		for (i = 0; i < vp->ngroup; ++i) {
  			fprintf(qpfp, "%c%ld",
--- 98,104 ----
  	/* assert cfp != NULL */
  	for (vp = cfp->head; vp != NULL; vp = vp->next[L_CTLFILE]) {
  		(void) fprintf(qpfp, "%lu:\t%s\t%d;",
! 			      (u_long)vp & 0xffffffff, cfp->mid, vp->ngroup);
  		qpch = ' ';
  		for (i = 0; i < vp->ngroup; ++i) {
  			fprintf(qpfp, "%c%ld",
***************
*** 150,156 ****
  
  	(void) fprintf(qpfp, "%s:\t", wc->name);
  	for (vp = wc->link; vp != NULL; vp = vp->next[L_CHANNEL])
! 		(void) fprintf(qpfp, ">%lu", (u_long)vp);
  	(void) fprintf(qpfp, "\n");
  	return 0;
  }
--- 150,156 ----
  
  	(void) fprintf(qpfp, "%s:\t", wc->name);
  	for (vp = wc->link; vp != NULL; vp = vp->next[L_CHANNEL])
! 		(void) fprintf(qpfp, ">%lu", (u_long)vp & 0xffffffff);
  	(void) fprintf(qpfp, "\n");
  	return 0;
  }
***************
*** 164,170 ****
  
  	(void) fprintf(qpfp, "%s:\t", wc->name);
  	for (vp = wc->link; vp != NULL; vp = vp->next[L_HOST])
! 		(void) fprintf(qpfp, ">%lu", (u_long)vp);
  	(void) fprintf(qpfp, "\n");
  	return 0;
  }
--- 164,170 ----
  
  	(void) fprintf(qpfp, "%s:\t", wc->name);
  	for (vp = wc->link; vp != NULL; vp = vp->next[L_HOST])
! 		(void) fprintf(qpfp, ">%lu", (u_long)vp & 0xffffffff);
  	(void) fprintf(qpfp, "\n");
  	return 0;
  }