synchronous freebsd print

2008-02-27 Thread Sanjeev Kumar.S
Hi,
 I have a quick question, and I believe this will 
be a common requirement.
 
I do a print of some data and then immediately 
in a next statement there is a crash. But the
print is not complete, before it completes there
is a crash, the print is about 6-9 lines .
Is there anyway to get the complete print
before executing the next instruction. like
putting a delay before executing the next
instruction.

Regards,
Sanjeev.

 

   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: synchronous freebsd print

2008-02-27 Thread Peter Jeremy
On Wed, Feb 27, 2008 at 12:08:28AM -0800, Sanjeev Kumar.S wrote:
 I have a quick question, and I believe this will 
be a common requirement.

This is a standard C question.
 
I do a print of some data and then immediately 
in a next statement there is a crash.
...
Is there anyway to get the complete print
before executing the next instruction.

Look at fflush(3)

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.


pgphQFuplx4Je.pgp
Description: PGP signature


Re: synchronous freebsd print

2008-02-27 Thread Sanjeev Kumar.S
 This is a standard C question.
 
 Sorry, if this clarification is too simple, but I
 thought freeBSD kernel implemented its own
 print function. and the man for fflush says it is
 in the standard C-library.
 and the kernel source has no defn for fflush.
 
 I saw lots of kernel related questions asked 
in this list, so I posted my question here. Please
correct me if I am wrong.

and Yes in the kernel code I have a \n at the end
of my print, still the print is not complete and 
the line next to it that causes the crash does
not give the result I want. Is this a common
scenario or am I doing something wrong.

Sanjeev.

Peter Jeremy [EMAIL PROTECTED] wrote: On Wed, Feb 27, 2008 at 12:08:28AM 
-0800, Sanjeev Kumar.S wrote:
 I have a quick question, and I believe this will 
be a common requirement.

This is a standard C question.
 
I do a print of some data and then immediately 
in a next statement there is a crash.
...
Is there anyway to get the complete print
before executing the next instruction.

Look at fflush(3)

-- 
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.


   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: synchronous freebsd print

2008-02-27 Thread Eygene Ryabinkin
Sanjeev,

Wed, Feb 27, 2008 at 03:00:46AM -0800, Sanjeev Kumar.S wrote:
 and Yes in the kernel code I have a \n at the end
 of my print, still the print is not complete and 
 the line next to it that causes the crash does
 not give the result I want. Is this a common
 scenario or am I doing something wrong.

If you're not defining PRINTF_BUFR_SIZE, then, judging by the
/sys/kern/subr_prf.c, output will be unbuffered in any case.  However,
kernel printf is not protected by locks, so it can be interrupted
by another thread, if I am correct.

May be ddb(4) will become your friend?
-- 
Eygene
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: synchronous freebsd print

2008-02-27 Thread James K. Toothman

Use fprintf(stderr, ...) instead, as stderr is unbuffered by default.


James Toothman
About.com

Peter Jeremy wrote:

On Wed, Feb 27, 2008 at 12:08:28AM -0800, Sanjeev Kumar.S wrote:
  
I have a quick question, and I believe this will 
   be a common requirement.



This is a standard C question.
 
  
   I do a print of some data and then immediately 
   in a next statement there is a crash.


...
  

   Is there anyway to get the complete print
   before executing the next instruction.



Look at fflush(3)

  

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: synchronous freebsd print

2008-02-27 Thread Julian Elischer

Sanjeev Kumar.S wrote:

Hi,
 I have a quick question, and I believe this will 
be a common requirement.
 
I do a print of some data and then immediately 
in a next statement there is a crash. But the

print is not complete, before it completes there
is a crash, the print is about 6-9 lines .
Is there anyway to get the complete print
before executing the next instruction. like
putting a delay before executing the next
instruction.



in the kernel or in a program?



Regards,
Sanjeev.

 

   
-

Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]