02-21-2010
Hmm. Try fsync(fd) after the write. If it returns anything other than zero an error happened while syncing the data to disk.
7 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I want to do a low level format like in windows (C:\format c:) but I don't know how it works in unix or linux.. Can somebody help me ? thnx :) (3 Replies)
Discussion started by: day
3 Replies
2. HP-UX
Hello
How to access to a second hard disk on a HP-UX system?
Thanks (3 Replies)
Discussion started by: ouniss
3 Replies
3. IP Networking
Hi,
What is the best reference that gives in detail on nic cards configuration , assigning multiple ip addresses to a single interface, netlink library etc and all basic stuff at this level..?
Thanks (2 Replies)
Discussion started by: Gopi Krishna P
2 Replies
4. AIX
Hello All
I have a system running AIX 61 shared uncapped partition (with 11 physical processors, 24 Virtual 72GB of Memory) .
The output from NMON, vmstat show a high run queue (60+) for continous periods of time intervals, but NO paging, relatively low I/o (6000) , CPU % is 40, Low network.... (9 Replies)
Discussion started by: IL-Malti
9 Replies
5. Programming
Hi friends,
I hope everyone is fine and doing well. I queried in my previous thread about the low-level qualities of C/C++ languages.I really thank you people for explaining, it was really helpful. One more ambiquity that I have in my mind is regarding the unix system calls like open, creat,... (1 Reply)
Discussion started by: gabam
1 Replies
6. Programming
Hi friends,
I hope everyone is doing well and fine. I have always been hearing that C/C++ are relatively low-level as compared to Java/C# etc. Could you please tell me some low-level qualities of C/C++? And I think disk deframenters are written in C/C++, please correct me if I am wrong. And please... (5 Replies)
Discussion started by: gabam
5 Replies
7. Programming
How to use X11 without Xlib not XCB? How draw window directly on low level?
I must use anyway window manager like Motif?
I have ridden that X11 has server-client architecture, client send via TCP/IP to port 6000 request for primitives and get replies.
Where is detailed description of it? In X11... (0 Replies)
Discussion started by: AndrzejB
0 Replies
fsync(2) System Calls Manual fsync(2)
Name
fsync - synchronize a file's in-core state with that on disk
Syntax
fsync(fd)
int fd;
Description
The system call causes all modified data and attributes of fd to be moved to a permanent storage device. This results in all in-core modi-
fied copies of buffers for the associated file to be written to a disk.
The call should be used by programs that require a file to be in a known state, for example, in building a simple transaction facility.
Return Values
A 0 value is returned on success. A -1 value indicates an error.
Diagnostics
The call fails under the following conditions:
[EBADF] The fd argument is not a valid descriptor.
[EINVAL] The fd argument refers to a socket.
[EIO] An I/O error occurred while reading from or writing to the file system.
[EINTR] The function was interrupted by a signal.
If an error occurs on an asynchronous write over NFS, the error cannot always be returned from a system call. The error code is returned
on or The following are NFS-only error messages:
[EACCESS] The requested address is protected, and the current user has inadequate permission to access it.
[ENOSPC] There is no free space remaining on the file system containing the file.
[EDQUOT] The user's quota of disk blocks on the file system containing the file has been exhausted.
[EROFS] The file is on a read-only file system.
[ESTALE] The fd argument is invalid because the file referred to by that file handle no longer exists or has been revoked.
[ETIMEDOUT] A write operation failed because the server did not properly respond after a period of time that is dependent on the
options.
See Also
sync(1), close(2), sync(2), write(2), update(8)
fsync(2)