From 05605db9ec5e176dd440a1edf320a987210b1245 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 22 Mar 2010 10:05:14 -0500 Subject: Improve handling of O_NONBLOCK and O_CLOEXEC. * tapset/aux_syscalls.stp (_sys_pipe2_flag_str): Separate O_NONBLOCK and O_CLOEXEC support. (_sys_open_flag_str): Added O_CLOEXEC support. --- tapset/aux_syscalls.stp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp index bd62817d..cffb9244 100644 --- a/tapset/aux_syscalls.stp +++ b/tapset/aux_syscalls.stp @@ -577,9 +577,11 @@ function _sys_pipe2_flag_str:string (f:long) char *str = THIS->__retvalue; int len; -#if defined(O_NONBLOCK) && defined(O_CLOEXEC) +#if defined(O_NONBLOCK) if (flags & O_NONBLOCK) strlcat(str, "O_NONBLOCK|", MAXSTRINGLEN); +#endif +#if defined(O_CLOEXEC) if (flags & O_CLOEXEC) strlcat(str, "O_CLOEXEC|", MAXSTRINGLEN); #endif @@ -610,6 +612,10 @@ function _sys_open_flag_str:string (f:long) if (flags & O_APPEND) strlcat (THIS->__retvalue, "|O_APPEND", MAXSTRINGLEN); #endif +#ifdef O_CLOEXEC + if (flags & O_CLOEXEC) + strlcat (THIS->__retvalue, "|O_CLOEXEC", MAXSTRINGLEN); +#endif #ifdef O_CREAT if (flags & O_CREAT) strlcat (THIS->__retvalue, "|O_CREAT", MAXSTRINGLEN); -- cgit