zhangtianci, >POSIX's require on fdopen: > > The application shall ensure that the mode of the stream as > expressed by the mode argument is allowed by the file access mode of > the open file description to which fildes refers. > >So I think the example above should return EINVAL. No, the "application" is the user code, so this is a requirement for you, not musl. Otherwise it would say "The *implementation* shall ensure …" Jens -- :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::