Git Product home page Git Product logo

Comments (2)

hvr avatar hvr commented on June 12, 2024

Even though this may appear convenient at first, I'm very sceptical about making unix into an emulation layer. I'd rather have unix's goal be focusing on providing API bindings for system calls provided by the underlying OS, unless there's a generic and portable fallback implementation possible that accurately implements the required semantics.

I'm strongly against starting to clutter the code with all sorts of #if darwin_HOST_OS conditionals, as this violates Autoconf's philosophy of checking for features rather than os/versions.

from unix.

hasufell avatar hasufell commented on June 12, 2024

fcntl is documented by posix: https://pubs.opengroup.org/onlinepubs/007904975/functions/fcntl.html

We seem to have a module for it: https://github.com/haskell/unix/blob/master/System/Posix/Fcntl.hsc

But no binding to it.

The main caveat is that fcntl is a variadic function. With the capi calling convention we can interface with such functions, but still have to give them a constant number of arguments: https://downloads.haskell.org/~ghc/8.10.7/docs/html/users_guide/ffi-chap.html?highlight=capi#varargs-not-supported-by-ccall-calling-convention

So I'm not sure how useful a raw binding would be here.

My guess would be someone can implement an alternative to fdatasync in a new library?

from unix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.