473,468 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

fsync()/fdatasync() issue

Hi,
I have a test app that writes to a device in raw initiated mode
(RedHat 2.4)

I use open() with O_SYNC flag
I call write() in a loop.
I call fdatasync(fd) in each loop (check for success status)
I call close()

in above test app if i unplug my device during the while loop and
reconnect it, all my data is lost i don't see anything written to the
disk. leads me to believe fdatasync() does not work as expected.

ps(in windows commit() function works fine. and data is actually
written to the disk)

please let me know if there is a way to get the expected result.

Thanks
Adnan Abbas
Nov 14 '05 #1
1 2421
Adnan Abbas wrote:
Hi,
I have a test app that writes to a device in raw initiated mode
(RedHat 2.4)

I use open() with O_SYNC flag
I call write() in a loop.
I call fdatasync(fd) in each loop (check for success status)
I call close()

in above test app if i unplug my device during the while loop and
reconnect it, all my data is lost i don't see anything written to the
disk. leads me to believe fdatasync() does not work as expected.

ps(in windows commit() function works fine. and data is actually
written to the disk)

please let me know if there is a way to get the expected result.


It may surprise you to learn that none of this has
anything at all to do with C. There's no open() function
in C. There's no O_SYNC flag in C. There's no write(),
no fdatasync(), no close(), and no commit() in C. There's
not even a disk in C, much less any notion of what happens
if you unplug one or hit it with a hammer.

All these things are platform-provided extensions to
the C language, and you need help from the experts on your
platform. I suggest you consult a Linux or RedHat forum --
because your problem is not a C problem. Good luck!

--
Er*********@sun.com

Nov 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Mateer | last post by:
Hi, I have been running some queries against a table in a my database and have noted an odd (at least it seems odd to me) performance issue. The table has approximately 5 million rows and...
7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
2
by: Anthony Cuttitta Jr. | last post by:
We have an application that outputs several different graphs from data downloaded from our AS400. The application has worked without (this) issue for several months now, but just recently, the...
2
by: Adnan Abbas | last post by:
Hi, I have a problem useing fdatasync()… This is how it goes. Setup: I have an external device connected through Firewire, I am running Redhat 2.4.
0
by: Kevin Spencer | last post by:
Hi all, I am working on a service that uploads METAR weather information to the National Weather Service FTP site. The service I'm authoring is hosted on a Windows 200 server, and the NWS FTP...
2
by: Ben Rush | last post by:
Hello World, Okay, I have spent the day browsing the newsgroups and reading up on article after article concerning ViewState corruption and so forth, and I have a couple questions. We...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
15
by: Ed L. | last post by:
I'm curious what the consensus is, if any, on use of fsync on ext3 filesystems with postgresql 7.3.4 or later. I did some recent performance tests demonstrating a 45%-70% performance improvement...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.