home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!kithrup!hoptoad!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!dsinc!ub!acsu.buffalo.edu!sivap-s
- From: sivap-s@acsu.buffalo.edu (Suresh .S)
- Newsgroups: comp.unix.wizards
- Subject: Re: system call write
- Message-ID: <BxxFoq.7vE@acsu.buffalo.edu>
- Date: 18 Nov 92 19:34:01 GMT
- References: <1992Nov13.164855.14013@tamsun.tamu.edu>
- Sender: nntp@acsu.buffalo.edu
- Organization: UB
- Lines: 22
- Nntp-Posting-Host: thuban.cs.buffalo.edu
- X-Newsreader: TIN [version 1.1 PL6]
-
- P S Narayan (pnarayan@cs.tamu.edu) wrote:
- : When I do a write (fd, buf, bytes), assuming that the file descriptor refers
- : to an open block device say disk, is the kernel going to copy buf from user
- : space to system buffer or is it going to flush it immediately onto disk ?
- : System V literature says that it is copied onto buffer and then by LRU
- : algorithm, it gets flushed when another process tries to access this buffer.
- : In that case how can the user process without closing the files, ensure that
- : his write system call flushes info onto disk ? Is there a way to do it ?
- :
- : My question is how can I get synchronous write ?
-
- When you are opening the file, you can set the O_SYNC option in the
- flags, which will give you synchronous writes. Another way could be to
- set the descriptor flags using fcntl()[cmd is F_SETFL].
-
- I am not sure if that is available in others OS, it is available in
- SunOS4.1.1.
-
- --
- Suresh Sivaprakasam
- Department of Computer Science, SUNY Buffalo, Amherst, NY - 14260-0001
- Internet :sivap-s@cs.Buffalo.EDU Bitnet : sivap-s@SUNYBCS.BITNET
-