diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+0.8.2.0 Lars Petersen <info@lars-petersen.net> 2018-10-31
+
+  * Issue 61: Fixed unexpected `IOError` bubbling up from `threadWaitSTM`.
+  * Added message flag `msgPeek` (MSG_PEEK).
+
 0.8.1.0 Lars Petersen <info@lars-petersen.net> 2018-08-13
 
  * Issue 51: Add a `getAddress` operation for getting the local socket address.
diff --git a/platform/linux/src/System/Socket/Internal/Platform.hsc b/platform/linux/src/System/Socket/Internal/Platform.hsc
--- a/platform/linux/src/System/Socket/Internal/Platform.hsc
+++ b/platform/linux/src/System/Socket/Internal/Platform.hsc
@@ -42,14 +42,12 @@
 
 wait :: Socket f t p -> (Fd -> IO ()) -> (Fd -> IO (STM (), IO ())) -> IO ()
 wait (Socket mfd) threadWait threadWaitSTM
-  | rtsSupportsBoundThreads = mapException
-    ( const eBadFileDescriptor :: IOError -> SocketException )
-    ( bracketOnError
+  | rtsSupportsBoundThreads = bracketOnError
         ( withMVar mfd $ \fd -> do
             when (fd < 0) (throwIO eBadFileDescriptor)
             threadWaitSTM fd
-        ) snd ( atomically . fst )
-    )
+        )
+        snd ( atomically . fst ) `catch` (const (throwIO eBadFileDescriptor) :: IOError -> IO ())
   | otherwise = do
       m <- newEmptyMVar
       bracketOnError
diff --git a/socket.cabal b/socket.cabal
--- a/socket.cabal
+++ b/socket.cabal
@@ -1,5 +1,5 @@
 name:                socket
-version:             0.8.1.0
+version:             0.8.2.0
 synopsis:            An extensible socket library.
 description:
   This library is a minimal cross-platform interface for
diff --git a/src/System/Socket.hsc b/src/System/Socket.hsc
--- a/src/System/Socket.hsc
+++ b/src/System/Socket.hsc
@@ -98,6 +98,7 @@
   , msgEndOfRecord
   , msgOutOfBand
   , msgWaitAll
+  , msgPeek
   -- ** AddressInfoFlags
   , AddressInfoFlags ()
   , aiAddressConfig
diff --git a/src/System/Socket/Internal/Message.hsc b/src/System/Socket/Internal/Message.hsc
--- a/src/System/Socket/Internal/Message.hsc
+++ b/src/System/Socket/Internal/Message.hsc
@@ -14,6 +14,7 @@
   , msgNoSignal
   , msgOutOfBand
   , msgWaitAll
+  , msgPeek
   ) where
 
 import Data.Bits
@@ -52,7 +53,8 @@
           , if msg .&. msgNoSignal    /= mempty then Just "msgNoSignal"    else Nothing
           , if msg .&. msgOutOfBand   /= mempty then Just "msgOutOfBand"   else Nothing
           , if msg .&. msgWaitAll     /= mempty then Just "msgWaitAll"     else Nothing
-          , let (MessageFlags i) = msg `xor` (Data.Monoid.mconcat [msgEndOfRecord,msgNoSignal,msgOutOfBand,msgWaitAll] .&. msg)
+          , if msg .&. msgWaitAll     /= mempty then Just "msgPeek"        else Nothing
+          , let (MessageFlags i) = msg `xor` (Data.Monoid.mconcat [msgEndOfRecord,msgNoSignal,msgOutOfBand,msgWaitAll,msgPeek] .&. msg)
             in if                   i /= 0      then Just ("MessageFlags " ++ show i) else Nothing
           ]
       y = concat $ intersperse "," $ catMaybes x
@@ -111,3 +113,10 @@
 msgWaitAll          :: MessageFlags
 msgWaitAll           = MessageFlags (#const MSG_WAITALL)
 {-# WARNING msgWaitAll "Untested: Use at your own risk!" #-}
+
+-- | @MSG_PEEK@
+--
+--   A `System.Socket.receive` shall not actually remove the received
+--   data from the input buffer.
+msgPeek             :: MessageFlags
+msgPeek              = MessageFlags (#const MSG_PEEK)
