tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* milters+mkstemp
@ 2001-08-21  4:40 Jerome M Berkman
  0 siblings, 0 replies; only message in thread
From: Jerome M Berkman @ 2001-08-21  4:40 UTC (permalink / raw)
  To: tru64-unix-managers

I've been experimenting with the sample milter (mail filter), sample.c,
which comes with sendmail 8.11.4.  It invokes mkstemp().  mkstemp() is
supplied an argument string which must end in 6 "X" characters which
are replaced by the unique file name.  That would seem to allow for
many unique file names from each template.

However, I found that on our DU V4.0F sysem, the mkstemp(3) function
quits after creating only 32 files from the template.  The man page has
no mention of a limit.  I'm posting this to see if I'm missing
something basic, and, if not, to warn people about the problem.

	- Jerry Berkman, UC Berkeley


#include <stdio.h>

/*  see how many files mkstemp() can make from one template */

main(){
	char vec[50];
	int fd;
	int i;
	FILE *stream;

	for( i = 1 ; i < 50; i++ ) {
		strcpy( vec, "abcXXXXXX" );
		fd = mkstemp( vec );
		printf( "i=%2d, name=%s\n", i, vec );
		if( fd < 0 ) {
			printf( "*** mkstemp failed, fd = %d\n", fd );
			exit(0);
		}
		stream = fdopen(fd, "w+");
		fprintf( stream, "hi\n" );
		fclose( stream );
		if( i % 8 == 0 ) sleep (1);
	}
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-08-21  4:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-21  4:40 milters+mkstemp Jerome M Berkman

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