Ok, here is the magic code in PERL...


sub sendldmail
{
 local ($mailbox, $message) = @_;

 $TO="$mailbox";
 $SENDMAIL="/usr/lib/sendmail";
 $subject = "MCI Long Distance Signup\n";
 $header = "From: $mailbox\nTo: $TO\nSubject: $subject\n";
 $message = $header . $message;

 open(OUTPUT, "| $SENDMAIL -t -n");
 print OUTPUT $message;
 close (OUTPUT);

 return;
}



This is the C source code that pulls the nanosecond value for the time
index...

#include <stdio.h>
#include <sys/time.h>

main()
{

hrtime_t t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
int i, iters = 100;

t1 = gethrtime();
//t2 = gethrtime();
//t3 = gethrtime();
//t4 = gethrtime();
//t5 = gethrtime();
//t6 = gethrtime();
//t7 = gethrtime();
//t8 = gethrtime();
//t9 = gethrtime();
//t10 = gethrtime();

printf( "%lld", t1);
//printf( "Time2 is (%lld)\n", t2);
//printf( "Time3 is (%lld)\n", t3);
//printf( "Time4 is (%lld)\n", t4);
//printf( "Time5 is (%lld)\n", t5);
//printf( "Time6 is (%lld)\n", t6);
//printf( "Time7 is (%lld)\n", t7);
//printf( "Time8 is (%lld)\n", t8);
//printf( "Time9 is (%lld)\n", t9);
//printf( "Time10 is (%lld)\n", t10);

}

And this is the PERL code that sets the cookie value and adds the
nanoseconds to it.

 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time());
 if( $input{AUTOT} =~ /7618/ ) # for auto tester
 {
  $cookievalue = "7618";
 }
 elsif( $input{ACCESS} eq "KARINLS" )
 {
        if( $input{REGTYPE} eq "TOKEN" )
        {
                $cookievalue = "TOK_KARINLS";
        }
        else
        {
                $cookievalue = "KARINLS";
        }
 }
 else
 {
  $cookievalue = sprintf( "%2.2d%3.3d%2.2d%2.2d%2.2d%5.5d", $year,
$yday, $hour,
 $min, $sec, getppid );
  $nano = "";
  $nano = `$path/donano`;
 $cookievalue .= "-$nano";






--
=-=-=-=-=-=-=-=-=-=
Focus on the candy.
--E. Cartman

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to