From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <102653669621996.tru64-unix-managers.marc@archive.invalid> From: Jerome M Berkman Date: Tue, 21 Aug 2001 04:40:32 +0000 To: tru64-unix-managers Subject: milters+mkstemp X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=102653669621996 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 /* 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); } }