diff --git a/src/unix/fs.c b/src/unix/fs.c index a0bd70d04ca..91bb82f725e 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -317,6 +317,18 @@ static ssize_t uv__fs_read(uv_fs_t* req) { req->bufs = NULL; req->nbufs = 0; +#ifdef __PASE__ + /* PASE returns EOPNOTSUPP when reading a directory, convert to EISDIR */ + if (result == -1 && errno == EOPNOTSUPP) { + struct stat buf; + ssize_t rc; + rc = fstat(req->file, &buf); + if (rc == 0 && S_ISDIR(buf.st_mode)) { + errno = EISDIR; + } + } +#endif + return result; }