add and use xopen_nonblocking (-18b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Bernhard Reutner-Fischer
2009-10-26 23:27:08 +01:00
committed by Denys Vlasenko
parent ca254490d7
commit a48308701a
8 changed files with 17 additions and 7 deletions

View File

@@ -140,6 +140,15 @@ int FAST_FUNC xopen(const char *pathname, int flags)
return xopen3(pathname, flags, 0666);
}
/* Die if we can't open an existing file readonly with O_NONBLOCK
* and return the fd.
* Note that for ioctl O_RDONLY is sufficient.
*/
int FAST_FUNC xopen_nonblocking(const char *pathname)
{
return xopen(pathname, O_RDONLY | O_NONBLOCK);
}
// Warn if we can't open a file and return a fd.
int FAST_FUNC open3_or_warn(const char *pathname, int flags, int mode)
{