Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #21665
Closed
Open
Created May 27, 2022 by Jaro Reinders@NoughtmareDeveloper

hGetBufNonBlocking still blocks on windows

Summary

The hGetBufNonBlocking function still blocks in powershell on windows even if hSetBuffering stdin NoBuffering is used.

Steps to reproduce

PS C:\Users\Jaro> ghci +RTS --io-manager=native
GHCi, version 9.0.2: https://www.haskell.org/ghc/  :? for help
ghci> import Foreign.Marshal.Alloc
ghci> import System.IO
ghci> hSetBuffering stdin NoBuffering
ghci> buf <- mallocBytes 100
ghci> hGetBufNonBlocking stdin buf 100

This blocks until I press at least one key (or until a console event happens).

Expected behavior

I expect hGetBufNonBlocking to never block. I don't even really expect to block with other buffering modes. I still need to test how it behaves on Linux, but it should match that behavior.

Environment

  • GHC version used: 9.0.2

Optional:

  • Operating System: Windows 10
  • System Architecture: x86_64
Edited May 27, 2022 by Jaro Reinders
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking