Sponsored Content
Top Forums Programming Sleep or Dealy fucntion Issue Post 302129922 by Jagadeeswaran.K on Thursday 2nd of August 2007 09:29:21 AM
Old 08-02-2007
Basically UNIX is Bufferred system.
It has two types of buffering system.
1) Line Buffering
2) Block Buffering.

The printf() in C uses the Linf Buffering System. It means, first the Strings are moved to a Buffer. After the Buffer moves the strings to console/memory. The Buffer is cleared, when any one of the following scenario occurs.
1) If the Buffer is full
2) new line Char "\n" occurs
3) The Buffer is flushed by fflush()
4) The Program Terminates.


from the porter's Solution
we have to use the fflush to clear the buffer.
and also we have to use "\n" in all the printf().

Ex:
printf("Hi\n");
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sleep

what is the purpose of the sleep command? (5 Replies)
Discussion started by: Anna
5 Replies

2. Shell Programming and Scripting

Sleep under one second

If I want a script to sleep for less than a second, would I use a decimal? In other words, if I wanted my script to sleep for 1/4 of a second, would I say, SLEEP .25 ?? (5 Replies)
Discussion started by: Scoogie
5 Replies

3. UNIX for Dummies Questions & Answers

system sleep

Dear All , I installed new Linux Red Hat 9 system and it is working fine . but while i keep it for certain time ideal ( i mean ndo not wrok on system itself ) it goes to mode like sleep mode ,,, but while it is in sleep mode i can not ping it or telnet !! i discovered it while i was telnet... (8 Replies)
Discussion started by: tamemi
8 Replies

4. UNIX for Dummies Questions & Answers

Sleep less than 1 second

Does anyone know a way to sleep less than 1 second? Sometimes when I write scripts that iterates a loop many times it would be nice to slow things down, but sometimes 1 second is too much. (9 Replies)
Discussion started by: bjorno
9 Replies

5. Shell Programming and Scripting

Wrapping 'sleep' with my 'resleep' function (Resettable sleep)

This is a very crude attempt in Bash at something that I needed but didn't seem to find in the 'sleep' command. However, I would like to be able to do it without the need for the temp file. Please go easy on me if this is already possible in some other way: How many times have you used the... (5 Replies)
Discussion started by: deckard
5 Replies

6. UNIX for Dummies Questions & Answers

ISSUE on SFTP fucntion ,parameter passing!

Hi Everyone!! Hey i created a SFTP function to FTP the file from unix to Linux. I need to FTP the 48 files from unix to linux. IP=$1 Userid=$2 Prikeypath=$3 SrcPath=$4 DstPath=$5 Files=$6 BATCHFILE=sftp.batch.$$ LOGFILE=sftp.log.$$ #Compose batch file & pass as argument to the... (1 Reply)
Discussion started by: bobprabhu
1 Replies

7. Shell Programming and Scripting

Sleep while i > 0

Hi, I have a script that runs a process at the beginning and I want to sleep/wait until this process is finished and then continue with the rest of the script. I am trying with this, but it is not working: process=`ps -ef | grep "proc_p01 -c" | grep -v grep | wc -l` if ; do sleep 10 done... (7 Replies)
Discussion started by: apenkov
7 Replies
dontdump(5)							File Formats Manual						       dontdump(5)

NAME
dontdump - defines which classes of kernel memory pages are not dumped when a kernel panic occurs VALUES
Failsafe Default (Allow the kernel to choose which classes to dump.) Allowed values Integer values from to The integer value should be the sum of the integer values for the excluded classes as follows: 2 : Unused pages 4 : User pages 8 : Buffer cache 16 : Kernel text pages 32 : Process stack 64 : File-system Metadata 128 : Kernel dynamic data 256 : Kernel static data 512 : Unused superpage pool Recommended values (Allow the kernel to choose which classes to dump.) The value the kernel usually chooses is = The kernel chooses these classes because they are not usually useful in debugging kernel prob- lems. DESCRIPTION
On large systems, the time required to dump system memory when a kernel panic occurs can be excessive or even prohibitive, depending on how much physical memory is installed in the system. Fast-dump capabilities controlled by the and parameters provide a means for restricting kernel dumps to specific types of information: . Unused Physical Memory . User Process . Buffer Cache . Kernel Code . Process Stack . File-System Metadata . Kernel Dynamic Data . Kernel Static Data . Unused Superpage Pool The command, and its associated configuration file control which of these memory classes are to be included in the memory dumps associated with a kernel panic. On rare occasions, the system may panic before crashconf(1M) is run during the boot process. On those occasions, the configuration can be set using the and tunables. The bit-map value stored in specifies which of these memory classes are not to be included in the memory dumps associated with a kernel panic. The default value for this parameter is The system determines whether or not to dump classes of memory based on the type of crash that occurs, in this case. Note that certain types of system crash, require a full crash dump. Also, the system operator may request a full crash dump at the time the dump is taken. In either of these cases, a full dump will be performed regardless of the classes selected using Who Is Expected to Change This Tunable? Only HP Field engineers should change the value of this tunable. Restrictions on Changing Changes to this tunable take effect at next reboot. Use to change the selection of pages to take effect immediately. When Should the Tunable Be Turned On? This tunable should be turned on to exclude certain classes of pages from being dumped when there is a system crash. This can be done to speedup the dump. What Are the Side Effects of Turning the Tunable On? If pages necessary for analyzing the dump are excluded, then the dump may not be useful for identifying the cause of the system crash. When Should the Tunable Be Turned Off? The tunable is turned off by default. What Are the Side Effects of Turning the Tunable Off? The system decides the page classes that must not be dumped based on the type of crash. The dump may take longer. What Other Tunables Should Be Changed at the Same Time? The tunable should not contain the same page classes as WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. SEE ALSO
crashconf(1M), alwaysdump(5). Tunable Kernel Parameters dontdump(5)
All times are GMT -4. The time now is 01:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy