01-04-2007
Note: you do realize that you have to call aio functions to guarantee completion of a write to disk, right? write() (called by stdio) only "promises" to write to disk sometime sooner or later, unless every i/o call has fdatasync (or fsync or whatever your box has) associated with it which slows down i/o a lot.
See: page 189, M J Rochkind 'Advanced UNIX Programming' 2nd ed
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I just download solaris 10, from sun.com, I have them ziped in my HD,
How can I install them, so I can run solaris10, my present os is RH9;
THANKS (5 Replies)
Discussion started by: mxlst14
5 Replies
2. UNIX for Advanced & Expert Users
i want to log the output of ps.
i want to see the ps outpıt line by line as i see in the stdout
but when i write it to a file it concatenates all lines
do you have any suggestion?
what i am using:
echo `ps -ef -o cmd,cpu,pcpu,cputime,nswap`>>log.txt
what i am getting:
Mon Sep 11... (3 Replies)
Discussion started by: gfhgfnhhn
3 Replies
3. Shell Programming and Scripting
Hi,
Currently I'm working on a lenghty script so I figured it would be useful to create a logfile so that output that is displayed on the users screen is also stored in the log file for later reference...... kinda like the whole point of a log file! Anyway, I was just wondering if there was an... (3 Replies)
Discussion started by: _Spare_Ribs_
3 Replies
4. Solaris
I'm looking for a CLI utility that will capture all the commands you type at the Solaris CLI (and their output) into a file. I'm sure it's called "scripter", but I can't find anything on a command called scripter.
Does anyone know of a such a command?
Your help will be greatly... (3 Replies)
Discussion started by: soliberus
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am trying to calculate the CPU Usage by getting the difference between the idle time reported by /proc/stat at 2 different intervals. Now the 4th entry in the first line of /proc/stat will give me the 'idle time'. But I also came across /proc/uptime that gives me 2 entries : 1st one as the... (0 Replies)
Discussion started by: coderd
0 Replies
6. UNIX for Dummies Questions & Answers
Hi,
This might be a bit stupid question, but what command to use to create like a session which logs the command line, and output on to the screen?
Basically, a log to a file, where I can review what I had install, uninstall, etc.
Thank you (4 Replies)
Discussion started by: kittoinc
4 Replies
7. UNIX for Advanced & Expert Users
I have a reqirement to serialise various rsh scripts that hit my server from an external scheduler. No matter how many scripts come via rsh, only one should execute at a time and others should wait.
I have made the scheduler make a request to my shell script with the command to be run as a... (4 Replies)
Discussion started by: nkamatam
4 Replies
8. Red Hat
Hi,
I am a newbie in Linux.
Appended is the output of cat /proc/version and uname -a.
# cat /proc/version
Linux version 2.6.32.12-115.fc12.i686 (mockbuild@x86-03.phx2.fedoraproject.org) (gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC) ) #1 SMP Fri Apr 30 20:34:53 UTC 2010
# uname -a... (7 Replies)
Discussion started by: Hari_Ganesh
7 Replies
9. Shell Programming and Scripting
How to convert string into an integer or number
For example :
% set tim = `date`
% echo $tim
Tue Feb 22 16:25:08 IST 2011
here How to increment time by 10 hrs
like 16+10 , here 16 is a string in date cmd. .. how to convert 16 to an integer and added to a another nimber ?
Thanks... (3 Replies)
Discussion started by: sbhamidi
3 Replies
10. Solaris
I need to log the size of physical/virtual memory consumed by any given given process using c/c++ code running on solaris and aix without using the proc filesystem. Please advise. (1 Reply)
Discussion started by: Manisha Paul
1 Replies
LEARN ABOUT OSF1
fdatasync
fdatasync(2) System Calls Manual fdatasync(2)
NAME
fdatasync - Writes data changes in a file to permanent storage
SYNOPSIS
#include <unistd.h>
int fdatasync ( int fildes );
PARAMETERS
Specifies a valid open file descriptor.
DESCRIPTION
The fdatasync function causes system buffers containing a file's modified data to be written to permanent storage. The fdatasync function
does not return until the operation has been completed. The fdatasync function provides data integrity, ensuring that data in permanent
storage is identical to data in the buffer. However, use of fdatasync does not guarantee that file control information such as owner and
modification time has been updated to permanent storage (see the fsync function).
NOTES
The file identified by the fildes parameter must be open for writing when the fdatasync function is issued or the call will fail.
RETURN VALUES
Upon successful completion, the fdatasync function returns a value of 0 (zero). If the fdatasync function fails, a value of -1 is returned
and errno is set to indicate the error. If fdatasync fails, outstanding I/O operations are not guaranteed to have been completed.
ERRORS
If the fdatasync function fails, errno may be set to one of the following values:
[EBADF] The fildes parameter is not a valid file descriptor.
[EINVAL] The fildes parameter does not refer to a file on which this operation is possible.
If any queued I/O operations fail, the fdatasync function returns error conditions defined for the read and write functions.
RELATED INFORMATION
Functions: fcntl(2), fsync(2), open(2), read(2), sync(2), write(2) delim off
fdatasync(2)