Comments (8)
O_DIRECT is specific to Linux and additionally appears to be deprecated in favor of using raw(8).
If you're in desperate need you can bind to open(2) and pass the flag in yourself using the FFI.
from unix.
Err... Exactly the other way around: https://lkml.org/lkml/2007/2/16/431.
from unix.
Keep searching. They changed their minds after that.
On Wed, Oct 7, 2015, 1:10 AM mr-hands [email protected] wrote:
Err... Exactly the other way around: https://lkml.org/lkml/2007/2/16/431.
—
Reply to this email directly or view it on GitHub
#48 (comment).
from unix.
Well:
config RAW_DRIVER
tristate "RAW driver (/dev/raw/rawN)"
depends on BLOCK
help
The raw driver permits block devices to be bound to /dev/raw/rawN.
Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O.
See the raw(8) manpage for more details.
Applications should preferably open the device (eg /dev/hda1)
with the O_DIRECT flag.
This is from the latest master. Could you provide some links that O_DIRECT is deprecated?
from unix.
I misread the entry in the man page. In any case this is both Linux
specific and is it's something you need urgently today you will get the
best results with the ffi. (I'm not the maintainer, so I'm not claiming to
be ruling on the outcome of this ticket.)
On Wed, Oct 7, 2015, 7:38 AM mr-hands [email protected] wrote:
Well:
config RAW_DRIVER
tristate "RAW driver (/dev/raw/rawN)"
depends on BLOCK
help
The raw driver permits block devices to be bound to /dev/raw/rawN.
Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O.
See the raw(8) manpage for more details.Applications should preferably open the device (eg /dev/hda1) with the O_DIRECT flag.
This is from the latest master. Could you provide some links that O_DIRECT
is deprecated?—
Reply to this email directly or view it on GitHub
#48 (comment).
from unix.
My FreeBSD 10.1 system has O_DIRECT
in the man page. I've never personally used it on FreeBSD, but I'll assume the man page is accurate.
This said, this is an ongoing issue (see #6). I echo Gregory Collins' sentiments from that issue: "The old design is dirty, but we're stuck with it for the moment. I'll be happy to accept a pull request adding the new flags. It will require a major version bump."
I will add that this is yet another flag (see the handling of RTLD_NEXT
for another) which requires _GNU_SOURCE
on certain Linux platforms (e.g., SuSe). We will not enable the _GNU_SOURCE
flag, so any provided fix must be able to work around this issue without changing the general structure of the OpenFileFlags
(thereby breaking backward compatibility) or breaking pattern matching in a cross-platform setting (by e.g., changing the data structure with an #ifdef
).
Alternatives include using the FFI (thanks for fielding this one, @glguy), modifying a copy of unix for local use, or using the raw
command line utility to work around the issue.
For the record, I will not get to this in the near future. This, of course, should not rule out pull requests. If and when I do make a change here, it will probably be as a set of major changes which will break backward compatibility and require multiple active versions (similar to the base
update of a few years back).
I'll leave this issue open for the rest of the day for general conversation (if desired). Please direct any further technical discussion pertinent to adding O_DIRECT
to #6.
from unix.
not part of posix, so should not be added, see http://www.unix.com/man-page/posix/3p/open/
from unix.
I guess no one is pushing for this anymore, so let's close as wontfix. If anyone wants to revive the discussion, open a new ticket.
from unix.
Related Issues (20)
- System.Posix.Semaphore.semThreadWait polls unnecessarily with threaded RTS
- Remove config.sub
- Revitalise System.Posix.DynamicLinker.Module
- Consider paring down the set of output modes HOT 7
- Include GHC 9.4 in CI ? HOT 4
- System library dependencies not documented HOT 3
- Build error with wasm32-wasi: system `wasi' not recognized HOT 11
- `unix-2.8` release for GHC 9.6 HOT 4
- `System.Posix.Env.ByteString.getEnvironment` segfaults on empty environment HOT 5
- NetBSD CI broken HOT 1
- System.Posix.User stopped exporting UserEntry HOT 3
- Should `mkstemp` use `throwErrnoIfMinus1Retry` instead of `throwErrnoIfMinus1`? HOT 3
- Add CI for the JS backend
- getAllGroupEntries fail on rhel8 HOT 23
- Memory unsafety in `withFilePath` in 2.8.2.0 HOT 6
- 2.8.3.0 fails to build on Linux 6.1.62 / glibc 2.35 HOT 2
- Release 2.8.4.0 HOT 10
- waitToSetLock can block but is an unsafe FFI import HOT 6
- Please revise time dependency to < 1.15 HOT 4
- CI: caching is likely broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unix.